I'm trying to use a listbox inside a wxPopupTransientWindow to implement something like a tab-completion mechanism for a wxTextCtrl, and it doesn't work. The listbox in the popup-window does not respond to any events (the scrollbar does, however), so I can't select any items, nor does the popup-window disappear when it looses focus.
When digging in the archives, I found this:
Robin Dunn:
One thing that should work is to put the listbox on a wxPopupWindow,
or perhaps a wxTransientPopupWindow. They're undocumented but you
can seen examples of their use in the wxPython demo.
I looked into these when someone else pointed me towards them, but
there are problems.
First, they're not quite what I'm after, because I would like to be
able to interact with some of the controls on the main window while
the listbox is up, and these seem to prevent that. I can work around
that if necessary, though.
Second, I can't get them to work properly. If I put a listbox inside a
wxPopupTransientWindow, I can't seem to get the listbox to respond to
any events. If I use a wxPopupWindow instead, the listbox works okay,
but then I have no way of dismissing the popup.
The demo contains code for a wxPopupWindow with a listbox in it, but
it's commented out. I commented it in and changed it to use a
wxPopupTransientWindow, and found that it has exactly the same problem
-- the listbox doesn't respond to user actions.
Does anyone know how to get this to work properly?
but this seems to have gone unanswered. Is this a known bug? Is there a workaround for it, or do I have to look for another solution?
I'm trying to use a listbox inside a wxPopupTransientWindow to implement something like a tab-completion mechanism for a wxTextCtrl, and it doesn't work. The listbox in the popup-window does not respond to any events (the scrollbar does, however), so I can't select any items, nor does the popup-window disappear when it looses focus.
When digging in the archives, I found this:
[...]
but this seems to have gone unanswered. Is this a known bug? Is there a workaround for it, or do I have to look for another solution?
I don't think it has been fixed yet. The wxPopupWindow (and subclasses) are kind of tricky to work on as many things in the wxUniv port depend on how they work now and I'm afraid that any tinkering that is done would break things there...
···
--
Robin Dunn
Software Craftsman http://wxPython.org Java give you jitters? Relax with wxPython!
I don't think it has been fixed yet. The wxPopupWindow (and subclasses)
are kind of tricky to work on as many things in the wxUniv port depend on
how they work now and I'm afraid that any tinkering that is done would
break things there...
Ok. I managed to get a wxDialog to work almost as a popup-window should've
done.
> I don't think it has been fixed yet. The wxPopupWindow (and subclasses)
> are kind of tricky to work on as many things in the wxUniv port
depend on
> how they work now and I'm afraid that any tinkering that is done would
> break things there...
Ok. I managed to get a wxDialog to work almost as a popup-window should've
done.
Well, I'm glad I'm not the only person that couldn't figure that out!
Believe it or not, the wx.PopupWindow demo in V2.4 (and upcoming 2.5) has
that very scenario in it, but it was commented out at some point for the
very reasons you described. I've been going nuts trying to get it to work