Complete.Org: Mailing Lists: Archives: freeciv-dev: July 2000:
[Freeciv-Dev] PATCH: Accelerators (even more!) for Races dialog
Home

[Freeciv-Dev] PATCH: Accelerators (even more!) for Races dialog

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: freeciv-dev@xxxxxxxxxxx
Subject: [Freeciv-Dev] PATCH: Accelerators (even more!) for Races dialog
From: Luke Reeves <luke949@xxxxxxxxxxxx>
Date: Tue, 18 Jul 2000 23:09:11 -0400

This patch adds accelerators and a default selection of OK to the racial
selection dialog box.  I like playing FreeCiv with just the keyboard,
and that's justification for these patches, and possibly more down the
line.

    Luke Reeves, Neurotech
    luke949@xxxxxxxxxxxx
    http://www.submail.net/
    http://www.neuro-tech.net/
--- dialogs.c.orig      Tue Jul 18 23:02:56 2000
+++ dialogs.c   Tue Jul 18 23:01:06 2000
@@ -1870,6 +1870,7 @@
   GSList    *sgroup = NULL;
   GSList    *cgroup = NULL;
   GtkWidget *f, *fs, *fa;
+  GtkAccelGroup *accel = gtk_accel_group_new();
 
   races_dialog_shell = gtk_dialog_new();
     gtk_signal_connect( GTK_OBJECT(races_dialog_shell),"delete_event",
@@ -1972,17 +1973,18 @@
 
   /* ------- OK/Disc/Quit buttons ------- */
 
-  races_ok_command = gtk_button_new_with_label( _("Ok") );
+  races_ok_command = gtk_accelbutton_new( _("_Ok"), accel );
   GTK_WIDGET_SET_FLAGS( races_ok_command, GTK_CAN_DEFAULT );
   gtk_box_pack_start( GTK_BOX( GTK_DIALOG( races_dialog_shell )->action_area ),
        races_ok_command, TRUE, TRUE, 0 );
+  gtk_widget_grab_default(races_ok_command);
 
-  races_disc_command = gtk_button_new_with_label( _("Disconnect") );
+  races_disc_command = gtk_accelbutton_new( _("_Disconnect"), accel );
   GTK_WIDGET_SET_FLAGS( races_disc_command, GTK_CAN_DEFAULT );
   gtk_box_pack_start( GTK_BOX( GTK_DIALOG( races_dialog_shell )->action_area ),
                      races_disc_command, TRUE, TRUE, 0 );
 
-  races_quit_command = gtk_button_new_with_label( _("Quit") );
+  races_quit_command = gtk_accelbutton_new( _("_Quit"), accel );
   GTK_WIDGET_SET_FLAGS( races_quit_command, GTK_CAN_DEFAULT );
   gtk_box_pack_start( GTK_BOX( GTK_DIALOG( races_dialog_shell )->action_area ),
                      races_quit_command, TRUE, TRUE, 0 );

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