Re: Some issues calling atk methods II



From: Joseph Scheuhammer <clown alum mit edu>

> One thing: In JavaScript, one invokes a constructor with the 'new'
> operator.  That is:
> let x = new Atk.Relation(...);
> 
> not:
> let x = Atk.Relation.new(...);

Well, I was just reading from atk headers, and calling the atk method
available, but you are right that I should call the method in this
way. But this is not the problem.

> The log output was:
> JS LOG: new St.Label():  [0x8ebdad0 StLabel ("ForAPI")]
> JS LOG: accLabel.get_role():  66
> JS LOG: accRelation.get_relation_type(): 0
> 
> I *think* 66 is ATK_ROLE_TOOL_TIP.  Is that what it should be?

No, 66 is ATK_ROLE_UNKNOWN, the default one. If you want the "real"
role you would require the patch on this bug [1]

> In order to avoid a crash when invoking 'new Atk.Relation(...)', I
> didn't pass an array, but passed the accessible itself, with a count
> of one.  Why that works doesn't make much sense to me, though.

Yes, it doesn't make too much sense, as it doesn't work for me ;). I
got this error:

Expected type array for Argument 'targets' but got type 'object' 0xblabla

As I said in my mail, I needed to change atk_relation_new annotations,
did you do that?

> Also, the Atk.Relation that is returned has the wrong relation type.
> It's zero (= no relation), but it should be 4 (= labelled-by).
> 
> As I said, no definitive answer; just clues to a puzzle.

Anyway, thanks for your effort.

BR

[1] https://bugzilla.gnome.org/show_bug.cgi?id=626658

===
API (apinheiro igalia com)


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