wx.EVT_PAINT in wxGTK

Schoenborn, Oliver wrote:

Using the pubsub module in the wxPython lib you can subscribe to specific messages and the publisher will only send it to those specific subscribers.

One question regarding pubsub: How does this technique differ from creating
a new wx event type (other than by the fact that pubsub doesn't require a
listener to be a wx.EvtHandler)?

As Roger mentioned, it is designed for broadcast, (but 1 to 1 is just a special case of broadcast.) The other big difference is that it allows for a looser coupling between message sender and message receiver, neither has to be aware of the other.

There are also other ways to do it that may be closer to what you already have. You could use EVT_IDLE or EVT_TIMER and have the controls update themselves periodically if the data has changed.

Wouldn't EVT_IDLE suffer the same problem as EVT_PAINT in terms of
portability?

No, EVT_IDLE does not rely on any native behaviours (other than how it senses when the event queue "becomes" empty) and is totally implemented in wx.

ยทยทยท

--
Robin Dunn
Software Craftsman
http://wxPython.org Java give you jitters? Relax with wxPython!