Submenus broken on applets!



I'm getting lots of applet crashes when using submenus. So I wrote a little applet to
test
if it's my fault, but the little app also crashes. When commenting out the source
creating
the submenus, the applet will run till the end of the universe.
Run the applet and wait 5-10 minutes. If you try to right click the applet it will
segfault
(and the panel too) or the submenus entries will not appear.
UPDATE: with gnome-core-1.0.12 I don't get any segfault, but the submenus dissapear!!!
Please compile it and tell if it's also wrong for you.
compile with: gcc `gnome-config --cflags gnomeui applets` `gnome-config --libs gnomeui
applets` main.c
Hope some of you can reproduce this VERY annoying bug.
----- begin program -------
#include <gnome.h>
#include <applet-widget.h>
void print_number(AppletWidget *w, gpointer data)
{
g_print("%i\n", data); /*Just print something*/
}
int
main(int argc, char **argv)
{
GtkWidget *applet;
GtkWidget *applet_widget;
applet_widget_init("crash_menus", NULL, argc, argv, NULL, 0, NULL);
/* create a new applet_widget */
applet = applet_widget_new("crash_menus");
/* in the rare case that the communication with the panel
failed, error out */
if (!applet)
g_error("Can''t create applet!\n");
/* Make the applet_widget */
applet_widget = gtk_label_new("right click me!");
gtk_widget_show (applet_widget);
applet_widget_add (APPLET_WIDGET (applet), applet_widget);
gtk_widget_show (applet);
applet_widget_register_stock_callback_dir(APPLET_WIDGET(applet),
"actions/", GNOME_STOCK_MENU_EXEC, _("Actions"));
applet_widget_register_stock_callback(APPLET_WIDGET(applet),
"actions/1", GNOME_STOCK_MENU_NEW,
_("write one..."), print_number, applet);
applet_widget_register_stock_callback_dir(APPLET_WIDGET(applet),
"programs/", GNOME_STOCK_MENU_JUMP_TO, _("Programs"));
applet_widget_register_stock_callback(APPLET_WIDGET(applet),
"programs/2", GNOME_STOCK_MENU_NEW,
_("write two..."), print_number, applet);
applet_widget_register_stock_callback(APPLET_WIDGET(applet),
"another_one", GNOME_STOCK_MENU_NEW,
_("write three..."), print_number, applet);
/* special corba main loop */
applet_widget_gtk_main ();
return 0;
}
----- end program -------



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