Re: [g-a-devel] Focus problems
- From: "padraig o'briain" <Padraig Obriain Sun COM>
- To: Ashu Sharma <ashutoshsharma gmail com>
- Cc: gnome-accessibility-devel gnome org
- Subject: Re: [g-a-devel] Focus problems
- Date: Wed, 15 Dec 2004 15:07:54 -0800
Ashu,
You might also look at gtkhtml2/libgtkhtml/a11y/htmlviewaccessible.c.
This code deals with a similar problem to yours.
gtkhtml2 is used in GNOME's help browser, yelp. When a link is focused
a "grab_focus" signal is emitted on the containing widget, a HtmlView.
Its code is in gtkhtml2/libgtkhtml/view/htmlview.c.
The function html_view_accessible_grab_focus_cb() ensure that the focus
notification is received on the correct object.
Padraig
padraig o'briain wrote:
> Ashu,
>
> If you are creating your own AtkObjects you will also need to deal with
> focus notification. If you want gnopernicus to become aware that an
> object has received focus you need to call atk_focus_tracker_notify()
> for the object which has focus.
>
> You could look at how we deal with this in gail.c.
>
> Padraig
>
> Ashu Sharma wrote:
>
>>Hi again,
>>
>>I'm having some problems with the focus and how gnopernicus follows it.
>>
>>If we have a webpage which has a number of "widgets" on it (that are
>>not actual GtkWidget's but are things directly drawn on the GdkWindow
>>of the client area) and we manually draw focusrects around links etc,
>>how do we notify atk so that gnopernicus queries us for that "widget"
>>and reads it out.
>>
>>I have a GtkLayout on which the entire page is rendered and when the
>>focus is on a link on the page, I create an AtkObject for it (with
>>AtkAction, etc.) and issue the following notification:
>>
>>AtkStateSet *stateSet = my_link_ref_state_set (linkAtkObject);
>>atk_state_set_add_state (stateSet, ATK_STATE_FOCUSED);
>>atk_object_notify_state_change (linkAtkObject, ATK_STATE_FOCUSED, true);
>>
>>After this, gnopernicus does query the linkAtkObject for its details
>>but never reads them out. Is this because there is no physical widget
>>for the link? Or is it because the actual focus (gtk's focus) is on
>>the GtkLayout which houses all the content of the page? I also tried
>>atk_state_set_remove_state(stateSetOfPageAtkObject,
>>ATK_STATE_FOCUSED); but it did not help.
>>
>>What should be the correct procedure here? This seems like a generic
>>problem with any AtkObjects that do not have an actual GtkWidget. I
>>think I'm doing the above incorrectly.
>>
>>Thanks,
>>Ashutosh
>>_______________________________________________
>>Gnome-accessibility-devel mailing list
>>Gnome-accessibility-devel gnome org
>>http://mail.gnome.org/mailman/listinfo/gnome-accessibility-devel
>
>
>
> _______________________________________________
> Gnome-accessibility-devel mailing list
> Gnome-accessibility-devel gnome org
> http://mail.gnome.org/mailman/listinfo/gnome-accessibility-devel
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]