assertion failure on call to gtk_menu_set_tearoff_state()



HI

I'd like to make a menu, that pops up in the 
torn of state. In some code I made a normal menu
and it pops up with no trouble, when in the 
callback function to a button, I put this:



static gint
callback_menu_popup ( GtkWidget *widget, GdkEvent *event ) {
if (event->type == GDK_BUTTON_PRESS) {
   GdkEventButton *bevent = (GdkEventButton *) event;
   gtk_menu_popup (GTK_MENU (widget), NULL, NULL, MenuPosition, 
                                   event, bevent->button, bevent->time);
  /*  gtk_menu_set_tearoff_state(GTK_MENU(widget),TRUE);*/
/*   DOESNT WORK, GENERATES ASSERTION FAILURE */
   return TRUE;
}
return FALSE;
}



but then when I call the function gtk_menu_set_tearoff_state like
shown above, clicking the button mysteriously generates 2 
assertion failures:



Gtk-CRITICAL **: file gtkwidget.c: line 2971 (gtk_widget_reparent):
assertion `new_parent != NULL' failed.

Gtk-CRITICAL **: file gtkwidget.c: line 3786 (gtk_widget_set_usize):
assertion `widget != NULL' failed.



does anyone know what these mean? and maybe what I could
do about it..

best regards


jos




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