GNOME Development Tools

To find GNOME development tools use http://developer.gnome.org/tools/ or http://www.gnomefiles.org/category.php?cat_id=8. Below are some useful tools and some of their features which can help you develop and test accessibility enablement in GTK+ and other accessible GNOME applications.

Glade

Glade is a user-interface builder you can use to rapidly prototype GTK+ and GNOME applications. This tool can generate C/C++ user interface code or an XML user interface description that you can use in your application. From a tool palette, you can select different types of windows, dialogs, control widgets, and containers. If you are a developer from a Microsoft Windows background, you will be tempted to use the GTK Fixed container. You should avoid that temptation and learn to use the box containers for control widget layouts in your windows, dialogs, notebooks, panes, etc. For each widget, you should add appropriate accessiblity information using the Properties Window. You can look at the generated code file (.c and .h) to see the GTK and ATK methods used to set the accessible information for each widget. Refer to Essential Accessibility Programming Practices section in this guide for more detailed information about how to enable your GTK+ applications for accessibility. Refer to the GTK+ Reference Manual and ATK API reference documentation for more detailed information about interfaces and methods.

Keyboard equivalents, mnemonics for access keys, and accelerators

Under the Widget tab, if you want to add an access key mnemonic in a label for a control widget, type an underline before the access key letter (mnemonic) in the Label text. If there is a Use Underline property, set that to "Yes". For labels which are separate from the control widget (like text boxes, combo boxes, scales/sliders, spin buttons, etc), set the Focus Target property to the name of the widget which should receive keyboard focus when the underlined access key is pressed. Glade generates code that uses the following GTK methods to set access keys (mnemonics) and associate those access keys with their respective widgets:

gtk_label_new_with_mnemonic

gtk_label_set_mnemonic_widget

gtk_radio_button_new_with_mnemonic

You can set accelerators (shortcut keys) for commonly used functions, usually menu items. In Glade, you can use the Accelerators property under the Common tab. GTK functions which define global key combinations for applications and associate key bindings with specific widgets include:

gtk_window_add_accel_group
gtk_widget_add_accelerator

Accessible names and descriptions

Under the Accessibility tab (with the wheelchair icon), specify a Name property for each control widget that matches the text label for the widget. Type a Description for each widget that matches the tooltip (contextual) help for a widget. The actual Tooltip property is set under the Common tab for some control widgets. Glade does not allow you to set the tooltip for all controls, but you can use the gtk_tooltips_set_tip method to set a tooltip for any widget control that receives events. Also, add a Name and Description property for image widgets. Glade generates code that uses the following GTK and ATK methods to set accessible names, descriptions, and tooltips:

gtk_widget_get_accessible

atk_object_set_name

atk_object_set_description

atk_image_set_name

atk_image_set_description

gtk_tooltips_set_tip

Accessible relationships

Under the Accessibility tab (with the wheelchair icon), you should show the relationships between labels (including group labels) and controls using the Label For and Labelled By properties. When you have a logical group, such as radio buttons within a Frame widget, you should specify the Member Of property to show that each control is a member of the same group. If interaction with one widget controls the state, visibility, or some other property of another widget, then use the Controlled By and Contoller For properties to show that relationship between those widgets. Refer to the ATK Relation interface for descriptions of other relationships. Glade generates code that uses the following GTK and ATK methods to establish accessible relationships between widgets:

gtk_widget_get_accessible

atk_object_ref_relation_set

atk_relation_type_for_name

atk_relation_new

atk_relation_set_add

Accerciser

The Accerciser tool allows developers to inspect every running accessible program by viewing its complete widget tree and accessible information as well as log and listen to accessible events (focus, mouse, object, window, keyboard, toolkit) in the application.

To use accerciser to examine the accessibility information for pure GTK+ applications, be sure to set /desktop/gnome/accessibility with gconf or set the value of the GTK_MODULES environment variable to "gail:atk-bridge".

Accessibility/Documentation/GNOME2/AtkGuide/Tool (last edited 2011-07-21 17:35:16 by JoanmarieDiggs)