Okay, how do I make a GtkTreeView accessible?
- From: Dylan McCall <dylanmccall gmail com>
- To: gnome-accessibility-list gnome org
- Subject: Okay, how do I make a GtkTreeView accessible?
- Date: Tue, 15 Jan 2013 12:46:16 -0800
Hello,
This is basically a question I asked on StackOverflow:
http://stackoverflow.com/questions/14223296. It's probably better
answered on this mailing list, so here I am!
I'm working on a Python + Gtk3 application with a fancy-looking
GtkTreeView. Here's a picture of it:
http://i.stack.imgur.com/cOAfl.png
This is great for sighted users, but here's what Orca (the screen
reader) says for a row in that tree view: "Image, Devhelp, Collapsed,
9.2 MB"
A few problems, of course. First, it doesn't mention the checkbox for
each row because I'm packing three cell renderers into a column. The
three are available, but for some reason Orca doesn't mention the
checkbox when it's buried that deep. Meanwhile, the image it mentions
is the one on the far left, which is usually empty but sometimes a
"restart required" indicator. Naturally, a blind user, much like a
sighted user, couldn't care less that it is an image. The order of the
elements also seems arbitrary, so I wouldn't mind having some say over
it, but that problem can wait.
What I would like to do is to poke at the accessibility objects that
describe this table in order to make them a little more helpful. Using
Accerciser, I can see that these exist, but they all seem to be
implemented with private, undocumented classes (like
GtkTreeViewAccessible), and they don't look terribly extensible, but
I'm hoping I'm wrong. Knowing that the treeview's accessible object is
an AtkTable at some level, I did the following to set an accessible
description for the image cell in the Backup row:
access = self.treeview_update.get_accessible()
cell_access = access.ref_at(0,0)
cell_access.set_image_description("Requires system restart")
(Orca still says "Image" after speaking the description, but I'll
assume it knows what it's doing).
However, that code isn't very nice. When I call access.ref_at, I'm
making particular assumptions about how GTK is mapping cell positions
to rows and columns in the ATK object. I'm also limited to calling
that when I first populate the tree, and I'm not sure if that is
particularly sane.
So there's my problem: I would like to add accessible descriptions for
my tree view cells in a nice way that won't break unexpectedly. How
can I do that? Can you point me to any example code?
Dylan
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]