Possible Gtk+ 1.2.0 Bug. Testcase included.




I am developing an application with gtk+ on a Linux/alpha box.
There seems to be a problem with nonhomogeneous packing of entry
widgets into tables.  Test case below.

Tim

p.s.  Why do all gtk+ sample programs (and my app)  have a load of 1?  
This seems way too cpu intensive.  Is this a linux/alpha problem only?

/* This program is intended to show a bug in gtk+ 1.2.0. When the
 * homogeneous flag for the gtk_table_new is set to TRUE, the program
 * display both the  entry box and the button within the window.  When it
 * is set to FALSE, only part of the entry box is displayed in the window,
 * the rest of the entry box and the button are outside the window
 * boundary.
 */

#include <gtk/gtk.h>

int main( int argc, char *argv[] ) {
  
  GtkWidget *main_window, *table, *entry, *button;
 
  gtk_init(&argc, &argv);
  
  main_window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
  gtk_widget_set_usize(main_window, 100, 100);
  gtk_window_set_policy(GTK_WINDOW(main_window), FALSE, TRUE, FALSE);

  table= gtk_table_new(1, 2, TRUE);
  entry= gtk_entry_new (); 
  button=gtk_button_new_with_label("FOO");
 
  gtk_table_attach_defaults (GTK_TABLE(table), entry, 0, 1, 0, 1);
  gtk_table_attach_defaults (GTK_TABLE(table), button, 1, 2, 0, 1);
 
  gtk_container_add(GTK_CONTAINER(main_window), table);  
  
  gtk_widget_show(entry);
  gtk_widget_show(button);
  gtk_widget_show(table);

  gtk_widget_show(main_window);

  gtk_main ();

  return(0);
}




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