Project Design: Knowing Your Object Hierarchy

only for RuBoard - do not distribute or recompile

Project Design: Knowing Your Object Hierarchy

Knowing and understanding the widget hierarchy in your project will make development of complex projects much more manageable. In addition, specifying the widget tree for your project in the design phase will help you avoid unnecessarily repeating work later in the project. The widget tree is key to understanding and creating effective user interfaces in GTK+.

The Widget Tree Window

As you can see in Figure 5.19, the widgets displayed are layered one inside the next . Understanding this paradigm will take you a long way toward understanding how best to use GTK+ widgets.

Figure 5.19. The widget hierarchy window.
graphics/05fig19.gif

As you can see in Figure 5.20, if you right-click a displayed widget, a popup menu appears, displaying a list of widgets from the inside out. This allows you to select any widget in the tree, delete the widget, and add or insert widgets before or after other widgets in the selected widget path . This is very helpful when you need to add a widget (for example, scrollbars to display a widget of some type) without deleting all widgets that will be the child of the widget you are adding and then having to re-create the widgets again and set their properties.

Figure 5.20. Right-click a deeply embedded widget to access a popup menu of options.
graphics/05fig20.gif
only for RuBoard - do not distribute or recompile


MySQL Building User Interfaces
MySQL: Building User Interfaces (Landmark)
ISBN: 073571049X
EAN: 2147483647
Year: 2001
Pages: 119

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net