Re: Some issues calling atk methods



From: Dan Winship <danw gnome org>

> On 08/13/2010 01:04 PM, Piñeiro wrote:
>>> hm... try Atk.Object.prototype.get_name.call(atk_label) ?
>> 
>> Just tested. Doesn't work. It says that call is not defined.
> 
> ah... because introspection functions aren't JS Function objects...

Ok

>> Launching the g_return_val_if_fail warning. So I guess that atk_label
>> is not valid as a real AtkObject
> 
> no, the atk_label argument is just being ignored: you'll get the same
> error if you call "Atk.Object.prototype.get_name()" with no argument.
> The problem is that it's passing "Atk.Object.prototype" as the argument
> to atk_object_get_name(), and that's a JavaScript internal object, not
> an AtkObject instance.

Ok

>>> That assumes AtkLabel isn't overriding AtkObjectClass->get_name... if it
>>> is, I don't think there's any way in gjs to refer to AtkLabel's
>>> implementation of the method.
>> 
>> Well, sorry, there isn't any AtkLabel class/interface. I guess that
>> you are talking about AtkAction.
> 
> Oh, no, I meant StallyLabel. If stally_label_get_class() was overriding
> atk_object_class->get_name, then there'd be no way to access that method
> from gjs. Not that this matters at this point since there isn't even any
> way to get the original AtkObject get_name method either.

Ok, sorry for the misunderstanding. Yes, StallyLabel overrides
get_name (I'm using my patch here [1]).

> Probably the easiest solution for now is to just add a C method
> "shell_get_accessible_name (AtkObject *obj)" or something, that calls
> atk_object_get_name(obj), and then you can use
> "Shell.get_accessible_name(atk_label)" from JS.

Well, as I said in my original mail, I found this issue making some
tests, in fact testing that my patch [1] was working. But right now I
don't need to call atk_object_get_name, but I found that I can't call
it making that tests. The purpose of the mail were check if there are
a way to call it, as I still need to check if this problem affects to
other ATK methods.

As in the end there are no way to do that, and in order to found
workarounds, I search a little on AtkObject, and the name is also
exported as a property [2]. I have used it and works with problem.

Thanks for all your help, and hints.

BTW: you still thinks that this is a problem with ATK, in the sense of
a bad name-policy?

[1] https://bugzilla.gnome.org/show_bug.cgi?id=626658
[2] http://library.gnome.org/devel/atk/stable/AtkObject.html#AtkObject--accessible-name

BR

===
API (apinheiro igalia com)


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