开发者

How to show GtkToolItem in the overflow menu of a GtkToolbar?

I am working on a Haskell application using gtk2hs. This application has a toolbar which consists of several GtkToggleToolButton, GtkToolButton and GtkToolItem elements. For being able to resize the applications window, I set the ShowArrow attribute to True, so that elements, that would be outside the window, are listed in an overflow menu.

This works fine for GtkToggleToolButton and GtkToolButton elem开发者_StackOverflow中文版ents, but GtkToolItem elements do not show up in the menu. This would not be such a big problem, but if those elements are not inside the window frame, the menu arrow does not show up only for them. So that you have no indication that the toolbar has actually more elements.

The GtkToolItem contains a GtkTable which contains a label and two GtkToolButton elements. Can I tell GTK that it should display a label in the overflow menu for my GtkToolItem elements?

Thank you in advance!

Tobias


GtkToolButton itself is a GtkToolItem (and you can add that table to it)! Then why you are using GtkToolItem directly?

And I think you should use GtkToolButton.set_stock_id (or set_icon_widget) aditional to set_label, instead of createing a table...


ToolItem has a method toolItemSetProxyMenuItem which allows you to specify the menu item that is displayed in the overflow menu:

http://hackage.haskell.org/packages/archive/gtk/0.11.0/doc/html/Graphics-UI-Gtk-MenuComboToolbar-ToolItem.html#v:toolItemSetProxyMenuItem

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜