Re: dogtail text attributes



Zack,
I was not able to find the queryText method you mentioned, but I was able to find the underlying text object using n._Node__text. (I'm using dogtail 0.6.1; perhaps the method you speak of is new?)
At any rate, I now have access to the atspi level text object, but to my amazement, I find that the text object does not support the getAttribute or getDefaultAttribute methods I find documented at http://library.gnome.org/devel/at-spi-cspi/stable/at-spi-cspi-AccessibleText-Interface.html. (Looking through the atspi doc will confirm this.) I see there is a editabletext object I can obtain which supports setAttributes (but, oddly, not getAttributes!). This is rather frustrating. Do you know of another way to get at the attributes of a text object?
Allen

>>> Zack Cerza <zcerza redhat com> 2009-02-11 11:34 >>>
Oh, I misunderstood you before. You're right, dogtail does not currently
have its own API for the finer-grained AccessibleText attributes. *But*
for situations like this, there is always a workaround. You may access
the "real" AccessibleText object by doing something like this:

(n is a Node instance that implements the AccessibleText interface)
>>> nText = n.queryText()
>>> print str(nText)
"<CORBA.Object 'IDL:Accessibility/Text:1.0' at 0x7fcf54570c90>"

And you can use any of the normal AccessibleText attributes/methods as
documented in the AT-SPI docs.

That said, the above is a workaround. It won't go away, but I am
certainly not opposed to adding more convenience attributes/methods to
the Node class itself. Patches always accepted :)

Zack


Allen Taylor wrote:
> Well, actually, I'm looking for the attributes of the text, i.e.,
> fg-color, bg-color, etc. as displayed in Accerciser. I believe Node.text
> just gives me the text content itself (i.e., it is not an object). Is
> this not the case?
> Allen
>
>  >>> Zack Cerza <zcerza redhat com> 2009-02-10 16:51 >>>
> Allen Taylor wrote:
>  > Does anyone know if dogtial makes the text attributes available (i.e.,
>  > the one in the AccessibleText interface)?
>  > Allen Taylor
>
> It does: you want the Node.text attribute.
>
> Zack
> _______________________________________________
> dogtail-list mailing list
> dogtail-list gnome org
> http://mail.gnome.org/mailman/listinfo/dogtail-list

_______________________________________________
dogtail-list mailing list
dogtail-list gnome org
http://mail.gnome.org/mailman/listinfo/dogtail-list


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