[gtkmm] Drop down menu from a tollbar item?



Does anyone have any idea how to do this? Looks like I see such a thing on gedit's recently used file-open down arrow button on its toolbar. Also looks like nautilus does something like it in the side pane (the information/history/emblems/etc button).

Best I can figure is that they are adding a ToggleElem to the toolbar and having its handler call popup on a popup menu and then manually untoggling the ToggleElem after the menu selection has been made. As nasty as it is, I suppose I could pull all that off *IF* I only new where to place the popup menu.  I'm not sure how to get the lower left coordinates of the toggle button. I don't want the menu popping up at the mouse pointer. I tried reading the gedit source, but couldn't find the code that builds the toolbar.

Anyone care to complete my method above or enlighten me otherwise. Thanks!

BTW, I think it's pretty weak that GTK doesn't have native support for this. Having a toolbar item drop down a menu seems to be a very common feature in other toolkits.

Myles


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]