guname resizing problem



  I'm using gnome-utils 1.0.50 on Debian GNU/Linux (potato).  When
LANG=ja_JP.eucJP, 'guname' in gnome-utils constantly changes its size.

  I think, gtk_widget_set_usize(GTK_WIDGET(list), ..., 200) in list.c
causes this problem.

  I've made a patch to fix this. Is this a right solution?

  KUSANO Takayuki <URL:http://www.asahi-net.or.jp/~AE5T-KSN/>

diff -ur gnome-utils-1.0.50.orig/mini-utils/guname/guname.c gnome-utils-1.0.50/mini-utils/guname/guname.c
--- gnome-utils-1.0.50.orig/mini-utils/guname/guname.c	Thu Jul 29 12:11:12 1999
+++ gnome-utils-1.0.50/mini-utils/guname/guname.c	Sun Nov 21 23:10:10 1999
@@ -586,6 +586,7 @@
   GtkCList * list;
   GtkWidget *sw;
   const gchar * titles[] = { N_("Category"), N_("Your System") };
+  gint width, height;
 
   titles[0]=_(titles[0]);
   titles[1]=_(titles[1]);
@@ -610,9 +611,11 @@
   gtk_signal_connect(GTK_OBJECT(list), "button_press_event",
                      GTK_SIGNAL_FUNC(list_clicked_cb), NULL);
 
-  fill_clist(list, descriptions, info, end_system_info);
+  fill_clist(list, descriptions, info, end_system_info, &width, &height);
 
   gtk_clist_thaw(list);
+
+  gtk_widget_set_usize(GTK_WIDGET(sw), width, height);
 
   gtk_container_add(GTK_CONTAINER(box), GTK_WIDGET(sw));
 }
diff -ur gnome-utils-1.0.50.orig/mini-utils/guname/list.c gnome-utils-1.0.50/mini-utils/guname/list.c
--- gnome-utils-1.0.50.orig/mini-utils/guname/list.c	Mon Feb 15 13:59:57 1999
+++ gnome-utils-1.0.50/mini-utils/guname/list.c	Sun Nov 21 23:18:03 1999
@@ -35,12 +35,13 @@
 
 void fill_clist(GtkCList * list, 
 		const gchar ** col1_items, const gchar ** col2_items, 
-		gint numitems)
+		gint numitems, gint * width, gint * height)
 {
   const gchar * row[2];
   int i;
   gint col_zero_width, col_one_width;
   GdkFont * font;
+  GtkRequisition req;
 
   font = gtk_widget_get_style(GTK_WIDGET(list))->font;
 
@@ -73,8 +74,9 @@
   gtk_clist_set_column_width(list, 0, col_zero_width + 10);
   gtk_clist_set_column_width(list, 1, col_one_width);
   
-  gtk_widget_set_usize(GTK_WIDGET(list), col_zero_width+col_one_width + 30, 
-                       200);
+  *width = col_zero_width+col_one_width + 30;
+  gtk_widget_size_request(GTK_WIDGET(list), &req);
+  *height = req.height + 30;
 }
 
 #ifdef HAVE_LIBGTOP_SYSINFO
diff -ur gnome-utils-1.0.50.orig/mini-utils/guname/list.h gnome-utils-1.0.50/mini-utils/guname/list.h
--- gnome-utils-1.0.50.orig/mini-utils/guname/list.h	Sun Sep 13 03:02:15 1998
+++ gnome-utils-1.0.50/mini-utils/guname/list.h	Sun Nov 21 21:40:35 1999
@@ -33,7 +33,7 @@
 
 void fill_clist(GtkCList * clist,
                 const gchar ** col1, const gchar ** col2, 
-                gint numitems);
+                gint numitems, gint * width, gint * height);
 
 GtkWidget * create_clist(const gchar * titles[]);
 
diff -ur gnome-utils-1.0.50.orig/mini-utils/guname/moreinfo.c gnome-utils-1.0.50/mini-utils/guname/moreinfo.c
--- gnome-utils-1.0.50.orig/mini-utils/guname/moreinfo.c	Thu Jul 29 12:11:12 1999
+++ gnome-utils-1.0.50/mini-utils/guname/moreinfo.c	Sun Nov 21 21:47:18 1999
@@ -160,6 +160,7 @@
   GtkWidget * label;
   const gchar * titles[] = { N_("Memory"), N_("Kilobytes") };
   gchar * s;
+  gint width, height;
 
   titles [0] = _(titles[0]);
   titles [1] = _(titles[1]);
@@ -175,8 +176,10 @@
   gtk_container_add(GTK_CONTAINER(sw),clist);
   gtk_clist_freeze(GTK_CLIST(clist));
   fill_clist(GTK_CLIST(clist), (const char **)memory_descriptions, 
-             (const char **)memory, end_memory_info);
+             (const char **)memory, end_memory_info, &width, &height);
   gtk_clist_thaw(GTK_CLIST(clist));
+
+  gtk_widget_set_usize(GTK_WIDGET(sw), width, height);
 
   s = g_strdup_printf("%ld%% memory used.", (guint)(memory_percent_full * 100));
   hbox = gtk_hbox_new(FALSE, GNOME_PAD);



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