tAccelerators now use Alt/Meta in some dialogs; try to avoid using GTK+2 with G… | |
git clone git://src.adamsgaard.dk/vaccinewars | |
Log | |
Files | |
Refs | |
README | |
LICENSE | |
--- | |
commit 1bf0580bf885a6bef379a4b744c8f5f0c9fc3ee1 | |
parent 9f0e098414c68f4d7ca59d35224e39dcbc5b9177 | |
Author: Ben Webb <[email protected]> | |
Date: Mon, 25 Mar 2002 16:49:38 +0000 | |
Accelerators now use Alt/Meta in some dialogs; try to avoid using GTK+2 | |
with GLIB1 (or vice versa); workaround for different g_strsplit behaviour | |
between GLIB1 and GLIB2. | |
Diffstat: | |
M src/gtkport/gtkport.c | 11 ++++++----- | |
M src/winmain.c | 4 ++++ | |
2 files changed, 10 insertions(+), 5 deletions(-) | |
--- | |
diff --git a/src/gtkport/gtkport.c b/src/gtkport/gtkport.c | |
t@@ -4332,7 +4332,7 @@ void gtk_entry_set_visibility(GtkEntry *entry, gboolean … | |
guint SetAccelerator(GtkWidget *labelparent, gchar *Text, | |
GtkWidget *sendto, gchar *signal, | |
- GtkAccelGroup *accel_group) | |
+ GtkAccelGroup *accel_group, gboolean needalt) | |
{ | |
gtk_signal_emit(GTK_OBJECT(labelparent), "set_text", Text); | |
return 0; | |
t@@ -4974,14 +4974,15 @@ void gtk_timeout_remove(guint timeout_handler_id) | |
#else /* CYGWIN */ | |
guint SetAccelerator(GtkWidget *labelparent, gchar *Text, | |
GtkWidget *sendto, gchar *signal, | |
- GtkAccelGroup *accel_group) | |
+ GtkAccelGroup *accel_group, gboolean needalt) | |
{ | |
guint AccelKey; | |
AccelKey = | |
gtk_label_parse_uline(GTK_LABEL(GTK_BIN(labelparent)->child), Text); | |
if (sendto && AccelKey) { | |
- gtk_widget_add_accelerator(sendto, signal, accel_group, AccelKey, 0, | |
+ gtk_widget_add_accelerator(sendto, signal, accel_group, AccelKey, | |
+ needalt ? GDK_MOD1_MASK : 0, | |
GTK_ACCEL_VISIBLE); | |
} | |
return AccelKey; | |
t@@ -5003,7 +5004,7 @@ GtkWidget *gtk_scrolled_text_new(GtkAdjustment *hadj, Gt… | |
return text; | |
} | |
-#ifdef HAVE_GTK2 | |
+#ifdef HAVE_GLIB2 | |
gint GtkMessageBox(GtkWidget *parent, const gchar *Text, | |
const gchar *Title, gint Options) | |
t@@ -5096,7 +5097,7 @@ gint GtkMessageBox(GtkWidget *parent, const gchar *Text, | |
if (Options & (1 << i)) { | |
button = gtk_button_new_with_label(""); | |
SetAccelerator(button, _(ButtonData[i]), button, | |
- "clicked", accel_group); | |
+ "clicked", accel_group, FALSE); | |
if (!imm_return) { | |
gtk_object_set_data(GTK_OBJECT(button), "retval", &retval); | |
} | |
diff --git a/src/winmain.c b/src/winmain.c | |
t@@ -252,7 +252,11 @@ int APIENTRY WinMain(HINSTANCE hInstance, HINSTANCE hPrev… | |
"# informative messages resulting from configuration\n" | |
"# file processing and the like.\n\n")); | |
+#ifdef HAVE_GLIB2 | |
+ split = g_strsplit(lpszCmdParam, " ", 1); | |
+#else | |
split = g_strsplit(lpszCmdParam, " ", 0); | |
+#endif | |
argc = 0; | |
while (split[argc] && split[argc][0]) | |
argc++; |