3 // Import and initialize GTK+
8 var window = new Gtk.Window({title: "Hello World"});
9 window.set_default_size(600, 500);
10 window.signal.hide.connect(Gtk.main_quit);
12 // Create the GtkStatusIcon from a file
13 var icon = new Gtk.StatusIcon({stock : Gtk.STOCK_MEDIA_PLAY});
16 var menu = new Gtk.Menu();
19 var item = new Gtk.MenuItem({label: "Hello"});
22 // Signal connecting the popup_menu event of the icon to the "activate" function
23 icon.signal.popup_menu.connect(active, menu);
25 function active(status_icon, button, time, data)
27 // GtkMenu.popup, calling the Gtk.StatusIcon.position_menu function
29 var area = new Gdk.Rectangle();
30 var orient = new Gtk.Orientation();
32 status_icon.get_geometry(ret, area, orient);
33 console.log(JSON.stringify(area));
34 console.log(JSON.stringify(orient));
36 menu.popup(null, null, Gtk.StatusIcon.position_menu, status_icon, button, time);