Bug in gtk_option_menu


I think I have found a bug in the gtk_option_menu. I have tried a bit
around to fix it, but I had to take more time to undestand the whole
structure of the gtk-library. Anyway I have included a small program
that shows the error (at least with gtk-1.2.6 and 1.2.7).

The optionmenu-button is drawn at the wrong position, but after you
press it, the button moves to the right position. This can also be
achieved by resizing the window.

If the bug has already been fixed, excuse my mail.



#include <gtk/gtk.h>

int quit_all (GtkWidget *window, GdkEvent *event, gpointer data)
  gtk_main_quit ();
  return 0;

int main  (int argc, char *argv[])
  GtkWidget *menu, *window, 
            *menuitem, *optionmenu;

  gtk_init (&argc, &argv);

  window = gtk_window_new (GTK_WINDOW_TOPLEVEL);

  gtk_signal_connect (GTK_OBJECT (window), "delete_event",
                      GTK_SIGNAL_FUNC (quit_all), NULL);
  menu = gtk_menu_new ();

  menuitem = gtk_menu_item_new_with_label ("  test  ");

  gtk_menu_append (GTK_MENU (menu), menuitem);
  gtk_widget_show (menuitem);
  optionmenu = gtk_option_menu_new ();
  gtk_container_add (GTK_CONTAINER (window), optionmenu);
  gtk_container_set_border_width (GTK_CONTAINER (optionmenu), 3);
  gtk_option_menu_set_menu (GTK_OPTION_MENU (optionmenu), menu);

  gtk_widget_show (menu);

  gtk_widget_show (optionmenu);
  gtk_widget_show (window); 

  gtk_main ();


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