Hello,
I'm trying to use a custom combo control (i.e. a TextCtrl plus a custom
popup window) inside a modal dialog on Linux, but no matter what I do,
the popup remains completely inert. It seems that it doesn't generate or
react to mouse events. wx.ComboBox doesn't have this problem, so this
doesn't seem to be an intrinsic limitation of wxWidgets. See the
attached sample for a demonstration of the different behaviours (I used
wx.lib.combotreebox.ComboTreeBox as an example of Python-created combo
box).
I understand that modal dialogs create their own event loop, so how can
I interact with it from Python? Is there any way of fishing out the
popup's mouse events from whichever hole they're falling into?
My config: Ubuntu 10.10, Python 2.6.6, wxPython 2.8.11.0
Regards,
Ronan
popup_in_dialog.py (1.59 KB)
Hi, I have seen the type of widget you want in a wxPython app before, I will go look through the source for it.
···
–
Hi, I will kill all ads in google gmail.
They will all be dead and gone for all my emails to you. HA HA bye bye ads I just massacred you!!!
hi, I found it and I have attached it. treecombo.py and the util folder need to reside next to each other unless you work out some other hierarchy.
treecombo.tar.gz (31.7 KB)
···
–
Hi, I will kill all ads in google gmail.
They will all be dead and gone for all my emails to you. HA HA bye bye ads I just massacred you!!!
It works, thanks a lot!
Unfortunately, it seems to mean that I have to rewrite my widget (a text
input box with an autocompletion dropdown[1]) to use wx.combo.ComboCtrl
and .ComboPopup and I am struggling with their undocumented quirks. I
don't mind reading the C++ source, but I wish there had been another way
to know that ComboCtrl.HidePopup() and ComboPopup.Dismiss()
automatically update the TextCtrl in addition to hiding the popup. My
problem now is to find a way to send key events back to the TextCtrl
even when the popup is shown. At worse, I could update the text directly
from the popup handler but it would feel much cleaner to let the
TextCtrl handle it in the usual way. Does anybody know how to do that?
[1]: It's actually a modified version of
http://wiki.wxpython.org/TextCtrlAutoComplete
···
Le mercredi 01 décembre 2010 à 17:05 -0500, Micah Nordland a écrit :
hi, I found it and I have attached it. treecombo.py and the util
folder need to reside next to each other unless you work out some
other hierarchy.