Re: Use user_data in callback

2015-09-24 Thread Jay Strict
Nice, thank you, your answers help a lot in learning this entire gnome-shell stuff. Best regards, Jay On 23.09.2015 16:46, Norman L Smith wrote: > Jay, > > See https://git.gnome.org/browse/gjs/tree/modules if you have not > done so. I did not think about the fact that your distro might > not

Re: Use user_data in callback

2015-09-23 Thread Norman L Smith
Jay, See https://git.gnome.org/browse/gjs/tree/modules if you have not done so. I did not think about the fact that your distro might not provide the files I referenced. Sorry about that.. Norman On Wed, 2015-09-23 at 14:52 +0200, Jay Strict wrote: > On 23.09.2015 12:45, Norman L Smith wrote: >

Re: Use user_data in callback

2015-09-23 Thread Emmanuele Bassi
Hi; On 23 September 2015 at 13:52, Jay Strict wrote: > On 23.09.2015 12:45, Norman L Smith wrote: >> Hello Jay, >> >> From /usr/share/gnome-js/signals.js > > Where do I find this file "signals.js"? It is not in my file system tree. Both signals.js and lang.js are modules provided by GJS. Ciao,

Re: Use user_data in callback

2015-09-23 Thread Jay Strict
On 23.09.2015 12:45, Norman L Smith wrote: > Hello Jay, > > From /usr/share/gnome-js/signals.js Where do I find this file "signals.js"? It is not in my file system tree. > > function _connect(name, callback) { > > The connect takes two arguments. > > The callback argument, without binding add

Re: Use user_data in callback

2015-09-23 Thread Norman L Smith
Hello Jay, >From /usr/share/gnome-js/signals.js function _connect(name, callback) { The connect takes two arguments. The callback argument, without binding additional arguments to the callback, consists of only the function and its first and second argument. lang.bind as noted in the commen

Re: Use user_data in callback

2015-09-23 Thread Jay Strict
It is very useful, as this is exactly how it works now. Thank you. What is the reason that without Lang.bind() the function can access the first two arguments ("emitter" and "event") but not the third one? And why is it different with Lang.bind()? Regards Jay On 22.09.2015 19:05, Norman

Re: Use user_data in callback

2015-09-22 Thread Norman L Smith
You need to use Lang.bind. See https://paste.fedoraproject.org/270197/ or http://ur1.ca/nu9t9 Hope this is useful. Norman On Tue, 2015-09-22 at 11:44 +0200, Jay Strict wrote: > I am writing a gnome-shell extension and I am trying to connect the > 'activate'-signal of a PopupMenuItem to a call