This site has been retired. For up to date information, see handbook.gnome.org or gitlab.gnome.org.


[Home] [TitleIndex] [WordIndex

IMPORTANT: This article is being preserved for historical purposes. Current information and documentation about GNOME Accessibility can be found at: the GNOME Accessibility Project


Prev Next


Coding Guidelines for Supporting Accessibility

Here are some things you can do in your code to make your program work as well as possible with assistive technologies. (You can find a list of things to consider when designing your GUI in the User Interface Guidelines for Supporting Accessibility section later in this document):

      {
        AtkObject *obj;
        obj = gtk_widget_get_accessible (button);
        atk_object_set_description (obj, _("Closes the window"));
      }

      {
              GtkWidget *widget;
              GtkLabel *label;

              AtkObject *atk_widget, *atk_label;
              AtkRelationSet *relation_set;
              AtkRelation *relation;
              AtkObject *targets[1];

              atk_widget = gtk_widget_get_accessible (widget);
              atk_label = gtk_widget_get_accessible (GTK_WIDGET (label));

              relation_set = atk_object_ref_relation_set (atk_label);
              targets[0] = atk_widget;

              relation = atk_relation_new (targets, 1, ATK_RELATION_LABEL_FOR);
              atk_relation_set_add (relation_set, relation);
              g_object_unref (G_OBJECT (relation));
      }


Home Prev Next


2024-10-23 10:57