Default Delay in wxTreeCtrl

Hello,

I am running version 2.4.1.2 in a debian system. In the wxTreeCtrl.py
demo, if I insert the line "time.sleep(1)" at the end of the
OnSelChanged method, I find that the default action (highlighting the
selected node) is delayed. Is there a way to avoid that delay?
As it stands, the highlighting loses its usefulness when the user
selects a node to start a program requiring a second or two to fire up.

Thanks for any thoughts.

Bob Parnes

···

--
Bob Parnes
rparnes@megalink.net

Bob Parnes wrote:

switchboard.py (2.67 KB)

···

On Fri, Feb 13, 2004 at 10:30:57AM -0500, Bob Parnes wrote:

On Tue, Feb 10, 2004 at 02:28:47PM -0800, Robin Dunn wrote:

Bob Parnes wrote:

Hello,

I am running version 2.4.1.2 in a debian system. In the wxTreeCtrl.py
demo, if I insert the line "time.sleep(1)" at the end of the
OnSelChanged method, I find that the default action (highlighting the
selected node) is delayed. Is there a way to avoid that delay?

Don't block the GUI. Events can't be processed if you do not return from the event handler to the MainLoop in a timely manner.

I finally managed to avoid GUI blocking by using wxExecute to run the
program associated with a tree node. However, during various alternative
attempts, I discovered that wxpython allows me to create my own events.
This seems more elegant if I could get it to work. It does work for me
partially: GUI blocking is avoided when using pushbuttons to select
applications, but not when using a tree control.

Attached is a switchboard and two applications demonstrating the
difference.

After tweaking switchboard.py to not have layout problems (wrong parents and an extra panel with nothing on it,) taking out the time.sleep, and adding some wxStopWatch timing, I noticed no significant difference in time.

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