Make the "Start" button of the GTK start-up window the default button of the window, which means pressing Enter now works at you'd expect.

git-svn-id: https://svn.eduke32.com/eduke32@1664 1a8010ca-5511-0410-912e-c29ae57300e0
This commit is contained in:
plagman 2010-07-02 01:26:56 +00:00
parent 386c50d41c
commit a346acfccb
3 changed files with 6 additions and 0 deletions

View file

@ -388,6 +388,8 @@ void (*gtk_window_set_title) (GtkWindow *window,
const gchar *title); const gchar *title);
void (*gtk_window_set_type_hint) (GtkWindow *window, void (*gtk_window_set_type_hint) (GtkWindow *window,
GdkWindowTypeHint hint); GdkWindowTypeHint hint);
void (*gtk_window_set_default) (GtkWindow *window,
GtkWidget *default_widget);
// gunicode.h // gunicode.h
gint (*g_utf8_collate) (const gchar *str1, gint (*g_utf8_collate) (const gchar *str1,
@ -614,6 +616,7 @@ void dynamicgtk_uninit(void);
#define gtk_window_set_resizable dynamicgtksyms.gtk_window_set_resizable #define gtk_window_set_resizable dynamicgtksyms.gtk_window_set_resizable
#define gtk_window_set_title dynamicgtksyms.gtk_window_set_title #define gtk_window_set_title dynamicgtksyms.gtk_window_set_title
#define gtk_window_set_type_hint dynamicgtksyms.gtk_window_set_type_hint #define gtk_window_set_type_hint dynamicgtksyms.gtk_window_set_type_hint
#define gtk_window_set_default dynamicgtksyms.gtk_window_set_default
// gunicode.h // gunicode.h
#define g_utf8_collate dynamicgtksyms.g_utf8_collate #define g_utf8_collate dynamicgtksyms.g_utf8_collate

View file

@ -159,6 +159,7 @@ int32_t dynamicgtk_init(void)
GETDLSYM(gtk_window_set_resizable) GETDLSYM(gtk_window_set_resizable)
GETDLSYM(gtk_window_set_title) GETDLSYM(gtk_window_set_title)
GETDLSYM(gtk_window_set_type_hint) GETDLSYM(gtk_window_set_type_hint)
GETDLSYM(gtk_window_set_default)
GETDLSYM(g_utf8_collate) GETDLSYM(g_utf8_collate)
} }
while (0); while (0);

View file

@ -691,6 +691,8 @@ static GtkWidget *create_window(void)
gtk_container_add(GTK_CONTAINER(stwidgets.buttons), stwidgets.startbutton); gtk_container_add(GTK_CONTAINER(stwidgets.buttons), stwidgets.startbutton);
GTK_WIDGET_SET_FLAGS(stwidgets.startbutton, GTK_CAN_DEFAULT); GTK_WIDGET_SET_FLAGS(stwidgets.startbutton, GTK_CAN_DEFAULT);
gtk_window_set_default(GTK_WINDOW(stwidgets.startwin), stwidgets.startbutton);
stwidgets.startbuttonalign = gtk_alignment_new(0.5, 0.5, 0, 0); stwidgets.startbuttonalign = gtk_alignment_new(0.5, 0.5, 0, 0);
gtk_container_add(GTK_CONTAINER(stwidgets.startbutton), stwidgets.startbuttonalign); gtk_container_add(GTK_CONTAINER(stwidgets.startbutton), stwidgets.startbuttonalign);