Complete.Org: Mailing Lists: Archives: freeciv-dev: November 2004:
[Freeciv-Dev] (PR#10927) GTK errors: gtkspinbutton, etc.
Home

[Freeciv-Dev] (PR#10927) GTK errors: gtkspinbutton, etc.

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: nijpels@xxxxxxxxxx
Subject: [Freeciv-Dev] (PR#10927) GTK errors: gtkspinbutton, etc.
From: "Vasco Alexandre da Silva Costa" <vasc@xxxxxxxxxxxxxx>
Date: Sat, 13 Nov 2004 15:47:29 -0800
Reply-to: rt@xxxxxxxxxxx

<URL: http://rt.freeciv.org/Ticket/Display.html?id=10927 >

Silly GTK+. It seems you cannot pass a range with min == max without its
silly complaints (in this case, min == max == 0.0). Here is a patch.

Index: client/gui-gtk-2.0/diplodlg.c
===================================================================
RCS file: /home/freeciv/CVS/freeciv/client/gui-gtk-2.0/diplodlg.c,v
retrieving revision 1.22
diff -u -r1.22 diplodlg.c
--- client/gui-gtk-2.0/diplodlg.c       13 Jul 2004 21:54:16 -0000      1.22
+++ client/gui-gtk-2.0/diplodlg.c       13 Nov 2004 23:45:40 -0000
@@ -537,7 +537,7 @@
   gtk_table_set_row_spacings(GTK_TABLE(table), 6);
   gtk_box_pack_start(GTK_BOX(vbox), table, TRUE, TRUE, 0);
 
-  spin = gtk_spin_button_new_with_range(0.0, plr0->economic.gold, 1.0);
+  spin = gtk_spin_button_new_with_range(0.0, plr0->economic.gold + 0.1, 1.0);
   gtk_spin_button_set_digits(GTK_SPIN_BUTTON(spin), 0);
   gtk_table_attach_defaults(GTK_TABLE(table), spin, 1, 2, 0, 1);
   g_object_set_data(G_OBJECT(spin), "plr", plr0);
@@ -593,7 +593,7 @@
   gtk_table_set_row_spacings(GTK_TABLE(table), 6);
   gtk_box_pack_start(GTK_BOX(vbox), table, TRUE, TRUE, 0);
 
-  spin = gtk_spin_button_new_with_range(0.0, plr1->economic.gold, 1.0);
+  spin = gtk_spin_button_new_with_range(0.0, plr1->economic.gold + 0.1, 1.0);
   gtk_spin_button_set_digits(GTK_SPIN_BUTTON(spin), 0);
   gtk_table_attach_defaults(GTK_TABLE(table), spin, 1, 2, 0, 1);
   g_object_set_data(G_OBJECT(spin), "plr", plr1);

[Prev in Thread] Current Thread [Next in Thread]