3.13 Further Topics


3.13 Further Topics

An entire book would be needed to describe all of the GTK+ widgets. By this point, though, you have seen the most important widgets and can now proceed to GNOME. Here is what awaits you if you want to delve deeper into GTK+.

  • Accessibility with ATK. ATK offers many choices for presenting information in and around your widgets so that your application can provide full accessibility. If you do not build your own widgets, you do not have much work to do; the default GTK+ widgets offer built-in accessibility features.

  • GDK. The link between GTK+ and its underlying windowing system (X11, for the most part) is GDK. All GTK+ widgets use the GDK library to draw to the screen and get input. However, if you don't need to create your own custom widgets, you will hardly ever use GDK.

  • GtkEventBox. This container holds a single widget and does nothing other than capture events as an X window and send them to its child. This doesn't come up much; examples are context menus on labels, images, and any other widget that doesn't have its own event mechanism.

  • GtkFixed. If you want to place widgets at fixed pixel positions , put them in a GtkFixed container. However, this usually isn't a good idea, because these containers don't respond well to resizing.

  • GdkPixbufAnimation. This class offers a simple way to display animations.

  • GdkPixbufLoader. If you have very large graphics, you can use this class to load images piece by piece rather than in one motion.

  • GtkAspectFrame. This container's width and height always keep the same proportions .

  • GtkCalendar. A monthly calendar that you can use for data entry. See Section 4.3.10 for GnomeDataEdit , a complete widget that provides date and time entry capability.

  • GtkCurve and GtkGammaCurve. Two very specialized floating-point number mapping widgets that are important to image processing programs such as The GIMP.

  • GtkMessageDialog. This class provides a quick and easy interface for common dialogs. It is limited in capability, and strangely enough, it's difficult to use for dialogs that conform to GUP guidelines (for example, it makes frowned-upon dialogs with Yes and No buttons ). These limitations arise primarily because the class dates from before the guidelines. If you need a lot of dialog boxes, you can create your own utility functions and/or use Glade for the interface design (see Chapter 5).

  • GtkRuler, GtkHRuler, and GtkVRuler. To precisely position certain elements inside your interface, you can put a ruler widget along one of the edges.

  • GtkSizeGroup. This class can couple several arbitrary widgets so that they all remain the same size . This comes up very rarely in user applications, because other widgets such as GtkTable provide an easier interface.

  • GtkToggleButton. These widgets are identical in function to GtkCheckButton widgets, but don't have a check box. Instead, they stay in a depressed state when turned on and snap up when turned off. You might use toggle buttons if you're really tight on space, but it's best to find a way around them because they look too much like regular buttons. If you absolutely must use them, group them in a place where it's obvious that they are not normal buttons.

  • Selected stock item topics. The stock item system is expandable; if you find yourself using the same labels and images over and over, you can insert them as stock items so that you can call them by identifier rather than do everything by hand every time. The built-in stock items cover most of the bases, though.

  • Drag-and-drop and transparency in tree views. Although you can set a tree view to reorder items with a property, you can exert more control by implementing your own system without too much trouble. In addition, you can enable interactive transparency in a tree view ” for example, you can configure a keystroke to mark a matching row.

  • Pango. This chapter covers only aspects of Pango relevant to GTK+. You normally do not need direct access to the Pango library.

  • Signals. Only the most important signals have found their way into this chapter. Many signals come into play only when you develop your own widgets or other do something that is at a similarly lower level.

  • Themes, styles, and gtkrc files. As mentioned earlier, you can significantly change the appearance of GTK+ widgets with themes. You can also alter widget settings on a global or per-class basis with configuration files such as $HOME/.gtkrc.

  • Widget development. You can create your own widgets with GTK+. To do so, you need to derive a new class from some base class and then expand the class as shown in Chapter 2. If this doesn't suit your needs, you can employ GDK's drawing and event primitives to create an entirely new widget.




The Official GNOME 2 Developers Guide
The Official GNOME 2 Developers Guide
ISBN: 1593270305
EAN: 2147483647
Year: 2004
Pages: 108

Similar book on Amazon

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