Some issues calling atk methods II



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

In this case I'm trying to call atk_relation_new.

First, I needed to complete the current atk introspection annotations,
as this method is incomplete right now. So the annotated method:

 * atk_relation_new:
 * @targets: (array length=n_targets) (element-type Atk.Object): an array of pointers to #AtkObjects
 * @n_targets: number of #AtkObjects pointed to by @targets
 * @relationship: an #AtkRelationType with which to create the new
 *  #AtkRelation

My purpose is replicate with javascript a c-code like this:
   AtkObject *array[1];
   accessible = gtk_widget_get_accessible (label);
   array [0] = accessible;
   relation = atk_relation_new (array, 1, ATK_RELATION_LABELLED_BY);

So, my javascript code is something like this:
   const Atk = imports.gi.Atk;
   <skip>
   accessible = label.get_accessible () // label is a StLabel, any ClutterActor would be valid
   let array = []
   array [0] = accessible;
   let relation = Atk.Relation.new (array, 1, Atk.RelationType.LABELLED_BY);

But doing that I get this exception:

("Unhandled array element type 16")@gjs_throw:0

I have checked Atk-1.0.gir, and it seems correct (I can paste the
method data if required).

I'm doing something wrong? Suggestions?

Thanks for your attention.

BR

PD: for my specific needs, I can (and should) use
atk_object_add_relationship [2] (in fact, this method is basically the
previous c-code). But anyway, I would like to know what I'm doing
wrong, to avoid future problems.

[1] http://library.gnome.org/devel/atk/stable/AtkRelation.html#atk-relation-new
[2] http://library.gnome.org/devel/atk/stable/AtkObject.html#atk-object-add-relationship

===
API (apinheiro igalia com)



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