GtkPopover bug ?



Hi,

Consider following code:

int
main (int argc, char **argv)
{
  GtkWidget *window;
  GtkWidget *popover;
  GtkWidget *button;
  GtkWidget *mbutton;

  gtk_init (&argc, &argv);
  
  window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
  gtk_widget_set_size_request (window, 300, 300);
  
  popover = gtk_popover_new (window);
  
  button = gtk_button_new_with_label ("Test");
  gtk_container_add (GTK_CONTAINER (popover), button);
  
  mbutton = gtk_menu_button_new ();
  gtk_menu_button_set_popover (GTK_MENU_BUTTON (mbutton), popover);
  gtk_container_add (GTK_CONTAINER (window), mbutton);

  g_signal_connect (G_OBJECT (window),
                    "delete-event",
                    G_CALLBACK (gtk_main_quit),
                    NULL);
                    
  gtk_widget_show_all (window);
  
  gtk_main();
  
  return 0;
}

When I build and run and then click on the MenuButton the popover
doesn't appear and I see on console:

Gtk-CRITICAL **: gtk_widget_child_focus: assertion 'GTK_IS_WIDGET
(widget)' failed

I've tried also popover = gtk_popover_new (NULL); but the result is
same, except that the there's nothing Gtk-CRITICAL.

I've not filled a bug report because I'm not sure if this a bug or my
mistake in something with that code.

Thanks.



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