Re: libseed-list Gtk.StatusIcon.position_menu and Gtk.Menu.Popup : problem

Yes, it's a known bug - I need to have a look at the source to fix this. - there are 2 issues
a) the function pointer needs to get sent as the argument.
b) the void* userdata needs to point to the gobject.

I've got a workaround here;a=blob;f=StatusIcon.js;h=7f78a731baac142d6a3362d7f66edfa05067a827;hb=HEAD

but this needs fixes to the GIR
the last two arguments of gtk_statusicon_get_geometry should be inout. - that's in bugzilla at present.


Marin Moulinier wrote:
I try to do a status icon with a popup menu who shows when the popup_menu event is triggered by the GtkStatusIcon.

Here is the code :

#!/usr/bin/env seed

// Import and initialize GTK+
Gtk =;
Gtk.init(null, null);

// Create the window
var window = new Gtk.Window({title: "Hello World"});
window.set_default_size(600, 500);

// Create the GtkStatusIcon from a file
var icon = new Gtk.StatusIcon({file : "/home/marin/Bureau/Bric_a_brac/notify/icon.png"});

// Create the menu
var menu = new Gtk.Menu();

// Create an item
var item = new Gtk.MenuItem({label: "Hello"});

// Signal connecting the popup_menu event of the icon to the "activate" function
icon.signal.popup_menu.connect(active, menu);

function active(status_icon, button, time, data)
    // GtkMenu.popup, calling the Gtk.StatusIcon.position_menu function
menu.popup(null, null, Gtk.StatusIcon.position_menu, status_icon, button, time);



The problem : when I do a right click on the GtkStatusIcon, the menu does not appear and I get this error :

(seed:4657): Gtk-CRITICAL **: gtk_status_icon_position_menu: assertion `GTK_IS_STATUS_ICON (user_data)' failed

Yet, status_icon - that GtkMenu.popup() has sent to Gtk.StatusIcon.position_menu() as the user_data argument - is a status icon...

Gtk.Menu.popup on the documentation : Gtk.StatusIcon.position_menu on the documentation :

Thank you in advance.

libseed-list mailing list
libseed-list gnome org

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