comparison src/gui_gtk.c @ 864:bc620d6bdf06

updated for version 7.0g03
author vimboss
date Thu, 04 May 2006 21:54:08 +0000
parents 8cd729851562
children a5677b7ce858
comparison
equal deleted inserted replaced
863:dbc6b23eff3e 864:bc620d6bdf06
2219 static gboolean 2219 static gboolean
2220 dialog_key_press_event_cb(GtkWidget *widget, GdkEventKey *event, gpointer data) 2220 dialog_key_press_event_cb(GtkWidget *widget, GdkEventKey *event, gpointer data)
2221 { 2221 {
2222 DialogInfo *di = (DialogInfo *)data; 2222 DialogInfo *di = (DialogInfo *)data;
2223 2223
2224 #ifndef HAVE_GTK2
2224 /* Ignore hitting "Enter" if there is no default button. */ 2225 /* Ignore hitting "Enter" if there is no default button. */
2225 if (event->keyval == GDK_Return) 2226 if (event->keyval == GDK_Return)
2226 { 2227 {
2227 if (!di->ignore_enter) 2228 if (!di->ignore_enter)
2228 gtk_dialog_response(di->dialog, GTK_RESPONSE_ACCEPT); 2229 gtk_dialog_response(di->dialog, GTK_RESPONSE_ACCEPT);
2229 return TRUE; 2230 return TRUE;
2230 } 2231 }
2232 #endif
2231 2233
2232 /* Close the dialog when hitting "Esc". */ 2234 /* Close the dialog when hitting "Esc". */
2233 if (event->keyval == GDK_Escape) 2235 if (event->keyval == GDK_Escape)
2234 { 2236 {
2235 gtk_dialog_response(di->dialog, GTK_RESPONSE_REJECT); 2237 gtk_dialog_response(di->dialog, GTK_RESPONSE_REJECT);
2288 } 2290 }
2289 else 2291 else
2290 dialoginfo.noalt = TRUE; 2292 dialoginfo.noalt = TRUE;
2291 2293
2292 /* Allow activation of mnemonic accelerators without pressing <Alt> when 2294 /* Allow activation of mnemonic accelerators without pressing <Alt> when
2293 * there is no textfield. Handle pressing Enter and Esc. */ 2295 * there is no textfield. Handle pressing Esc. */
2294 g_signal_connect(G_OBJECT(dialog), "key_press_event", 2296 g_signal_connect(G_OBJECT(dialog), "key_press_event",
2295 G_CALLBACK(&dialog_key_press_event_cb), &dialoginfo); 2297 G_CALLBACK(&dialog_key_press_event_cb), &dialoginfo);
2296 2298
2297 if (def_but > 0) 2299 if (def_but > 0)
2298 { 2300 {