tut-gtk2-mnstbs
Menus and Toolbars
- Contents of this chapter:
-
- 9 Menus and Toolbars
- 9.1 Pop-up Menus
- 9.1.1 Creating Pop-up Menus (!)
- 9.1.1.1 Menu Item Separators
- 9.1.1.2 Pop-up Menu Callbacks
- 9.1.1 Creating Pop-up Menus (!)
- 9.2 Keyboard Accelerators
- 9.2.1 Accelerator Path
- 9.3 Status Bar
- 9.3 1 Status Bar Hints
- 9.3.2 The Status Bar Widget
- 9.3.3 Menu Item Information
- 9.4 Menu Items
- 9.4.1 Submenus
- 9.4.2 Different Kinds Of Menu Items
- 9.4.2.1 Image Menu Items
- 9.4.2.2 Check Menu Items
- 9.4.2.3 Radio Menu Items
- 9.5 Menu Bars
- 9.6 Tool Bars
- 9.6.1 Menus And Sub-menus As Toolbar Items
- 9.6.2 Some +toolbar-item-menu.rb+ Program Notes
- 9.6.2.1 Tool Bar Style
- 9.6.2.2 Icon Size On Your Tool Bars
- 9.6.3 Dragging And Dropping Tool Bars
- 9.6.3.1 Detached Toolbar Example
- 9.6.3.1.1 Orientation Of Detached Toolbar
- 9.6.3.2 Dragging a Toolbar Within a Window
- 9.6.3.1 Detached Toolbar Example
- 9.7 Toolbar Items (!)
- 9.8 Dynamic Menu Creation
- 9.8.1 Creating UI Files
- 9.8.2 Loading UI Files
- 9.8.2.1 Additional Action Types
- 9.8.2.2 Placeholders
- 9.9 Custom Stock Items (!)
- 9.10 Test Your Understanding
- 9.1 Pop-up Menus
- 9 Menus and Toolbars
This chapter will teach you how to create pop-up menus, menu bars, and toolbars. You will begin by creating each of them manually, so you learn how the widgets are constructed. This will give you a firm understanding of all of the concepts on which menus and toolbars rely.
After you understand each widget, you will be introduced to Gtk::UIManager, which allows you to dynamically create menus and toolbars through custom XML files. A user interface file is loaded, and each element applied to a corresponding action object, which tells the item how it will be displayed and how it will act.
- In this chapter we will learn:
-
- How to create pop-up menus, menu bars, and toolbars
- How to apply keyboard accelerators to menu items
- What a Gtk::StatusBar? widget is and how you can use it to provide more information to the user about a menu item
- What types of menus and toolbar items are provided by GTK+
- How to dynamically create menus and toolbars with UI files
- How to create custom stock items with Gtk::IconFactory
Keyword(s):
References:[tut-gtk2-dnd-intro] [tut-gtk] [tut-gtk2-mnstbs]