Some issues calling atk methods



(Not sure if this is the proper list, but detected using gnome-shell,
sorry for the noise if this is the case).

These days I was experimenting with atk on javascript. I was able to
import it without problem, and execute the methods and so on, so all
seems to work fine.

But then, I tried to call the method atk_object_get_name [1]. Using
looking glass, I get something like that:

>>> <inspect x:73 y:15>
 r(0) = [0xXXXXXX StLabel ("Activities")]
>>> label = r (0)
 r(1) = [0xXXXXXX StLabel ("Activities")]
>>> atk_label = label.get_accessible ()
 r(2) = [object instance proxy GIName:Atk.GObjectAccessible jsobj 0xXXXXXXX native 0xXXXXXX]
>>> atk_label.get_name ()
 r(3) = <exception Error: Too few arguments to method Atk.get_name expected 1 got 0>
>>> atk_label.get_name (0)
 r(4) = press

After thinking a little about it, I realize that this .get_name that
is being called is atk_action_get_name [2], as this class implements
AtkAction interface.

So I suppose that when the prototype is created, the
AtkObject.get_name is overriden by AtkAction.get_name.

This would also means that if this object starts to implementing other
interface with a .get_name (atk_whatever_get_name), atk_label.get_name
could be this one (without a written policy to know what one, probably
the last used on the definition time).

Although I tried some (random) ways to call atk_object_get_name on
this object, I was not able to do that.

Any idea or hint?

Thanks for your attention.


[1] http://library.gnome.org/devel/atk/stable/AtkObject.html#atk-object-get-name
[2] http://library.gnome.org/devel/atk/stable/AtkAction.html#atk-action-get-name

===
API (apinheiro igalia com)


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