X-Git-Url: http://git.chise.org/gitweb/?a=blobdiff_plain;f=src%2Fmenubar-gtk.c;h=4af66591e9da2e5bb186e57282f2b2f8ebdcf8db;hb=250c5448c6dd6ac9289aded72ed66fb928979cb6;hp=8d2dac90fccae5ae5b2a77009a42aaba3881c39d;hpb=7ee7b9fd0c91842f267cf6e412286d647f68e32a;p=chise%2Fxemacs-chise.git- diff --git a/src/menubar-gtk.c b/src/menubar-gtk.c index 8d2dac9..4af6659 100644 --- a/src/menubar-gtk.c +++ b/src/menubar-gtk.c @@ -1216,11 +1216,21 @@ static void gtk_popup_menu (Lisp_Object menu_desc, Lisp_Object event) { struct Lisp_Event *eev = NULL; - GtkWidget *widget = menu_descriptor_to_widget (menu_desc); - GtkWidget *menu = GTK_MENU_ITEM (widget)->submenu; - gpointer id = gtk_object_get_data (GTK_OBJECT (widget), XEMACS_MENU_GUIID_TAG); - + GtkWidget *widget = NULL; + GtkWidget *menu = NULL; + gpointer id = NULL; + + /* Do basic error checking first... */ + if (SYMBOLP (menu_desc)) + menu_desc = Fsymbol_value (menu_desc); + CHECK_CONS (menu_desc); + CHECK_STRING (XCAR (menu_desc)); + + /* Now lets get down to business... */ + widget = menu_descriptor_to_widget (menu_desc); + menu = GTK_MENU_ITEM (widget)->submenu; gtk_widget_set_name (widget, "XEmacsPopupMenu"); + id = gtk_object_get_data (GTK_OBJECT (widget), XEMACS_MENU_GUIID_TAG); __activate_menu (GTK_MENU_ITEM (widget), id);