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 =;
   accessible = label.get_accessible () // label is a StLabel, any ClutterActor would be valid
   let array = []
   array [0] = accessible;
   let relation = (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.


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.


API (apinheiro igalia com)

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