views:

279

answers:

1

Hi everyone! I'm looking for a way to implement this design in wxPython on Linux...
I have a toolbar with a button, when the button is pressed a popup should appear, mimicking an extension of the toolbar (like a menu), and this popup should show two columns of radio buttons (say 2x5) and a text box... My main problem is that the toolbar is small in height, so the popup has to overflow the bounds of the window/client area..

I thought of two possible implementations:

  • by using a wxMenu, since a menu can be drawn outside the client area. I fear that the layout possibilities aren't flexible enough for my goal
  • by using a shaped frame. Pressing the button would re-shape the frame and draw the needed widgets as requested.

My question is: am I missing something / wrong on something? :) Is this doable at all?

+1  A: 

Using a menu is a no-go, because wxWidgets can't put widgets on a menu. Using the shaped frame would be possible in principle, but the problem is then to get the position of the button you clicked, to display the window at the right position. I tried to do that back then, but didn't have luck (in C++ wxWidgets). Maybe this situation changed in between though, good luck.

You can also try a wxComboCtrl, which allows you to have a custom popup window. That one could then display the radio boxes and the input control.

Johannes Schaub - litb
The wxComboCtrl looks like the way to go, many thanks :) Now on to working on the next problem.. X-) http://stackoverflow.com/questions/464717/redirecting-an-event-in-wxwidgets
Joril
This problem is blocking me.. :/ It looks like the "shaped-window" path is also promising, I'll try that, meanwhile..
Joril
Joril, there is a window that is exactly for this purpose. i've forgotten its name. it gets focus, and when you click otherwhere, it disappears. there is an example in the samples directory of wx. good luck :)
Johannes Schaub - litb
ah. the name is "wxPopupTransientWindow". that's the window you want to use, instead of a shaped frame, i believe
Johannes Schaub - litb
I'm screaming "d'oh!" from the top of my lungs *_* I just finished doing the whole thing with a shaped window.. Why-oh-why doesn't SO RSS feed show "received comments"? :( Anyway many thanks for your help :)
Joril