[wxPython-users] what's reasonable to do in a idle handler
Robin Dunn
robin at alldunn.com
Tue Jul 25 22:38:53 PDT 2006
Phil Mayes wrote:
> At 08:50 AM 7/22/2006, you wrote:
>> Hi,
>> I just thought I found an elegant way to maintain consistency in the
>> gui of an
>> app, i.e. enable/disable buttons in dependence on the state of other
>> controls,
>> by putting the relevant code in an idle handler, in contrast to checking
>> consistency every time when something has been clicked. Is that a
>> reasonable
>> method in terms of e.g. cpu load? In the current implementation I'll call
>> .Disable()/Enable() over and over again if nothing happens. It looks
>> like it's
>> working, but what happens if similar code runs parallel in many panels?
>> Thanks for any comments, Christian
>
>
> MFC uses a method like this to maintain the state of toolbar buttons
> etc., Google for ON_UPDATE_COMMAND_UI for more details.
So does wx. Take a look at the EVT_UPDATE_UI event.
--
Robin Dunn
Software Craftsman
http://wxPython.org Java give you jitters? Relax with wxPython!
More information about the wxpython-users
mailing list