Use user_data in callback
- From: Jay Strict <jay strict posteo de>
- To: gnome-shell-list gnome org
- Subject: Use user_data in callback
- Date: Tue, 22 Sep 2015 11:44:31 +0200
I am writing a gnome-shell extension and I am trying to connect the
'activate'-signal of a PopupMenuItem to a callback function like this:
======================================================================
let item = new PopupMenu.PopupMenuItem("test")
item.connect(
'activate',
function(emitter, event, user_data) {
Main.notifyError("user_data: " + user_data);
},
"test1",
"test2",
"test3",
"test4");
this.folderMenu.addMenuItem(item);
======================================================================
I expected the output to be "user_data: test1".
However, when I click on the PopupMenuItem, the output is "user_data:
undefined".
How can I assign some user_data to this signal?
Thank you in advance.
Jay
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]