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



Hello,
This is most simple fix developers can do to their apps and it really gives back more awesome experience. It is really easy. Another thing I would be happy to learn my-self is how to properly implement popup menu trigger. I am not sure how to call this so I'll rather describe so you can point me to where I can read on this. When browsing the list of files in nautilus I can select a file or a group of files by holding ctrl key and pressing space on each item I wish to select. When items are selected like this I can press the menu key also known as the applications key on the keyboard which is usually positioned to the right of a spacebar key. Pressing this menu key will popup a menu and corresponding actions related to the selection are displayed in that popup menu. In apps such as file roller, brasero and maybe some others there is also a popup menu implemented however the menu key can't be used to spawn it. In file roller and brasero we do have to emulate right mouse click on the selection. Is there a standard technique for doing this?


Greetings

Peter

On 28.05.2015 at 02:01 Joanmarie Diggs wrote:
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

_______________________________________________
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]