[wxpython-users] CallAfter, ListCtrl, and Modal dialog issue
Conrado PLG
conradoplg at gmail.com
Mon Sep 15 19:09:52 PDT 2008
On Mon, Sep 15, 2008 at 19:29, Robin Dunn <robin at alldunn.com> wrote:
>
> This is definitely very weird... Rod Sterling weird...
>
> My best guess is that the native listctrl is doing something as part of the
> events following the selection that captures the mouse, and it is during
> that time that the CallAfter event is processed and the dialog is shown. So
> you get into a state that the dialog can't get mouse events because the
> listctrl has captured it, and the mouse won't be released until the
> ShowModal exits and control returns into the main loop.
>
I took a peek at the listctrl code and couldn't find anything
suspicious... though I have very little experience with wx code.
>
> Try this: Instead of having the CallAfter function show the dialog, have it
> set a short timer (wx.CallLater can help with this) and show the dialog from
> there. Waiting an extra 100ms won't be noticable to the user, but will
> probably give the listctrl enough time to finish whatever it is doing.
>
It works, but it's not very reliable. At 100ms it locks often, at
300ms it's rare. It's good enough for me, for now...
I've just confirmed that it's a wxWidgets issue, by reproducing the
bug with a changed ListCtrl sample (and I've just remembered how I
hate C++ :) ). Should I submit a bug in the tracker or ask the wx
list?
Thanks,
Conrado
More information about the wxpython-users
mailing list