Re: [orca-list] technical question about gtk labels



Hey Kendell.

gtk_label_new() creates a new GtkLabel. That does not in any way connect
the label to the widget. What app developers sometimes do is just
position the label next to the widget. Sighted users then conclude the
former describes the latter. But there's no actual connection.

In terms of making an actual and accessible connection between a label
and a widget, the app developer needs to create a label-for/labelled-by
AtkRelation pair between the label and the widget it labels. Many times
Gtk+ app developers get this AtkRelation pair for free -- and possibly
without even knowing it -- because the app developer chooses to set the
mnemonic-widget property. Setting that property makes things like Alt+R
give focus to the Resolution combo box. It also causes Gtk+ to do the
ATK work. In the example you provide, in which there is no underlined
letter, it would be a hack to set the mnemonic-widget property. Some
developers are happy to do the hack because it's easy. Some developers
will frown at the hack because it's sad. The frowners can call
atk_object_add_relationship(). It's also easy. Docs are here:
https://developer.gnome.org/atk/unstable/AtkObject.html#atk-object-add-relationship.

Lastly, if you look at the bottom of this fix I did for Evince, you'll
see an example of using atk_object_add_relationship() to set the pair.
(Along with a detailed commit message explaining why this stuff needs
doing.) https://git.gnome.org/browse/evince/commit/?id=a6cdc12b66a

Hope this helps!
--joanie


On 05/27/2015 07:11 PM, kendell clark wrote:
hi all
This isn't a bug report, or anything like that, but a question. There
are still quite a few things in gnome control center and in gnome
itself which aren't labeled properly, causing orca to simply announce
only the role of the object "button" "combo box" etc, instead of it's
label, followed by the role. I cloned the gnome control center's git
repository and checked out the gnome 3.16 branch to make sure I was
using the latest code for gnome 3.16, and looked through some of the
code. I'm no expert in c code, I barely know enough to have a basic
understanding of what I'm reading, but looking at most of it, orca
should announce most things. Here's a fragment taken from the display
panel in gnome control center.  cc-display-panel.c.
  label  gtk_label_new (_("Resolution"));
  gtk_style_context_add_class (gtk_widget_get_style_context (label),
                               GTK_STYLE_CLASS_DIM_LABEL);

There are more lines but I tried to paste the most relevant. Looking
at that code,  it looks like orca should announce "resolution combo
box xxxx times yyyy ratio" instead of "combo box xxxx times yyyy
ratio". Any c or c++ experts around who can answer this one? This
looks like it's labeled properly, and yet orca doesn't see the label.
Thanks a lot for any help, I'm trying to iron out the remaining a11y
bugs in gnome. Plus, I'm getting tired of unlabeled controls that linger
Thanks
Kendell clark
_______________________________________________
orca-list mailing list
orca-list gnome org
https://mail.gnome.org/mailman/listinfo/orca-list
Visit http://live.gnome.org/Orca for more information on Orca.
The manual is at http://library.gnome.org/users/gnome-access-guide/nightly/ats-2.html
The FAQ is at http://live.gnome.org/Orca/FrequentlyAskedQuestions
Log bugs and feature requests at http://bugzilla.gnome.org
Find out how to help at http://live.gnome.org/Orca/HowCanIHelp




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]