hi;

to define new signals, you need to use the `Signals` key in object you
pass to the Lang.Class() constructor you use when subclassing a
GObject.

you can look at this code:

https://git.gnome.org/browse/gjs/tree/installed-tests/js/testGObjectClass.js#n115

for how to define properties and signals on GObject classes implemented via gjs.

ciao,
 Emmanuele.


On 4 July 2014 18:56, Dimitri Giardina <dimitri.giard...@gmail.com> wrote:
> Hi list,
>
> i'm searching for some days on google about attaching custom signals to
> custom widgets on gjs.
> i see some examples for seed-js but they seem not to be applicable on gjs.
>
> i found the overriding of gobject.js but i don't know if i can use that:
> https://mail.gnome.org/archives/commits-list/2012-January/msg11238.html
>
> something like:
>
> gi.signal_new(this.prototype,'close-clicked',GObject.SignalFlags.RUN_FIRST,GObject.AccumulatorType.NONE,GObject.TYPE_NONE,[]);
>
> where gi is const gi=imports.gi;
> but it don't work.
>
> if i use
> this.connect('close-clicked',this.close_clicked);
>
> interpreter give me a message that close-ticket is not one of signals.
>
> anyone can help me?
>
> thanks
> Dimitri.
>
> _______________________________________________
> javascript-list mailing list
> javascript-list@gnome.org
> https://mail.gnome.org/mailman/listinfo/javascript-list
>



-- 
W: http://www.emmanuelebassi.name
B: http://blogs.gnome.org/ebassi/
_______________________________________________
javascript-list mailing list
javascript-list@gnome.org
https://mail.gnome.org/mailman/listinfo/javascript-list

Reply via email to