/*
 * DO NOT EDIT THIS FILE - it is generated by Glade.
 */

#ifdef HAVE_CONFIG_H
#  include <config.h>
#endif

#include <sys/types.h>
#include <sys/stat.h>
#include <unistd.h>
#include <string.h>

#include <gdk/gdkkeysyms.h>
#include <gtk/gtk.h>

#include "gtk-callbacks.h"
#include "gtk-interface.h"
#include "gtk-support.h"

GtkWidget*
create_main_window (void)
{
  GtkWidget *main_window;
  GtkWidget *vbox1;
  GtkWidget *menubar;
  GtkWidget *item1;
  GtkWidget *item1_menu;
  GtkAccelGroup *item1_menu_accels;
  GtkWidget *mnu_game_new_archon;
  GtkWidget *mnu_game_new_adept;
  GtkWidget *mnu_game_unpause;
  GtkWidget *mnu_game_stop;
  GtkWidget *separator4;
  GtkWidget *mnu_game_exit;
  GtkWidget *mnu_settings;
  GtkWidget *mnu_settings_menu;
  GtkAccelGroup *mnu_settings_menu_accels;
  GtkWidget *mnu_settings_define;
  GtkWidget *mnu_settings_select;
  GtkWidget *separator2;
  GtkWidget *mnu_settings_theme;
  GtkWidget *separator3;
  GtkWidget *mnu_settings_sound;
  GtkWidget *item3;
  GtkWidget *item3_menu;
  GtkAccelGroup *item3_menu_accels;
  GtkWidget *mnu_help_tips;
  GtkWidget *separator1;
  GtkWidget *mnu_help_about;
  GtkWidget *logo;
  GtkWidget *progressbar;
  GtkAccelGroup *accel_group;

  accel_group = gtk_accel_group_new ();

  main_window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
  gtk_object_set_data (GTK_OBJECT (main_window), "main_window", main_window);
  gtk_window_set_title (GTK_WINDOW (main_window), "X ARCHON");
  gtk_window_set_position (GTK_WINDOW (main_window), GTK_WIN_POS_CENTER);
  gtk_window_set_policy (GTK_WINDOW (main_window), FALSE, FALSE, FALSE);
  gtk_window_set_wmclass (GTK_WINDOW (main_window), "XARCHON", "XARCHON");

  vbox1 = gtk_vbox_new (FALSE, 0);
  gtk_widget_ref (vbox1);
  gtk_object_set_data_full (GTK_OBJECT (main_window), "vbox1", vbox1,
                            (GtkDestroyNotify) gtk_widget_unref);
  gtk_widget_show (vbox1);
  gtk_container_add (GTK_CONTAINER (main_window), vbox1);

  menubar = gtk_menu_bar_new ();
  gtk_widget_ref (menubar);
  gtk_object_set_data_full (GTK_OBJECT (main_window), "menubar", menubar,
                            (GtkDestroyNotify) gtk_widget_unref);
  gtk_widget_show (menubar);
  gtk_box_pack_start (GTK_BOX (vbox1), menubar, FALSE, FALSE, 0);

  item1 = gtk_menu_item_new_with_label ("Game");
  gtk_widget_ref (item1);
  gtk_object_set_data_full (GTK_OBJECT (main_window), "item1", item1,
                            (GtkDestroyNotify) gtk_widget_unref);
  gtk_widget_show (item1);
  gtk_container_add (GTK_CONTAINER (menubar), item1);

  item1_menu = gtk_menu_new ();
  gtk_widget_ref (item1_menu);
  gtk_object_set_data_full (GTK_OBJECT (main_window), "item1_menu", item1_menu,
                            (GtkDestroyNotify) gtk_widget_unref);
  gtk_menu_item_set_submenu (GTK_MENU_ITEM (item1), item1_menu);
  item1_menu_accels = gtk_menu_ensure_uline_accel_group (GTK_MENU (item1_menu));

  mnu_game_new_archon = gtk_menu_item_new_with_label ("New Game of Archon");
  gtk_widget_ref (mnu_game_new_archon);
  gtk_object_set_data_full (GTK_OBJECT (main_window), "mnu_game_new_archon", mnu_game_new_archon,
                            (GtkDestroyNotify) gtk_widget_unref);
  gtk_widget_show (mnu_game_new_archon);
  gtk_container_add (GTK_CONTAINER (item1_menu), mnu_game_new_archon);

  mnu_game_new_adept = gtk_menu_item_new_with_label ("New Game of Adept");
  gtk_widget_ref (mnu_game_new_adept);
  gtk_object_set_data_full (GTK_OBJECT (main_window), "mnu_game_new_adept", mnu_game_new_adept,
                            (GtkDestroyNotify) gtk_widget_unref);
  gtk_widget_show (mnu_game_new_adept);
  gtk_container_add (GTK_CONTAINER (item1_menu), mnu_game_new_adept);

  mnu_game_unpause = gtk_menu_item_new_with_label ("Unpause");
  gtk_widget_ref (mnu_game_unpause);
  gtk_object_set_data_full (GTK_OBJECT (main_window), "mnu_game_unpause", mnu_game_unpause,
                            (GtkDestroyNotify) gtk_widget_unref);
  gtk_widget_show (mnu_game_unpause);
  gtk_container_add (GTK_CONTAINER (item1_menu), mnu_game_unpause);
  gtk_widget_add_accelerator (mnu_game_unpause, "activate", accel_group,
                              GDK_Escape, 0,
                              GTK_ACCEL_VISIBLE);

  mnu_game_stop = gtk_menu_item_new_with_label ("Stop");
  gtk_widget_ref (mnu_game_stop);
  gtk_object_set_data_full (GTK_OBJECT (main_window), "mnu_game_stop", mnu_game_stop,
                            (GtkDestroyNotify) gtk_widget_unref);
  gtk_widget_show (mnu_game_stop);
  gtk_container_add (GTK_CONTAINER (item1_menu), mnu_game_stop);
  gtk_widget_add_accelerator (mnu_game_stop, "activate", accel_group,
                              GDK_F12, 0,
                              GTK_ACCEL_VISIBLE);

  separator4 = gtk_menu_item_new ();
  gtk_widget_ref (separator4);
  gtk_object_set_data_full (GTK_OBJECT (main_window), "separator4", separator4,
                            (GtkDestroyNotify) gtk_widget_unref);
  gtk_widget_show (separator4);
  gtk_container_add (GTK_CONTAINER (item1_menu), separator4);
  gtk_widget_set_sensitive (separator4, FALSE);

  mnu_game_exit = gtk_menu_item_new_with_label ("Exit");
  gtk_widget_ref (mnu_game_exit);
  gtk_object_set_data_full (GTK_OBJECT (main_window), "mnu_game_exit", mnu_game_exit,
                            (GtkDestroyNotify) gtk_widget_unref);
  gtk_widget_show (mnu_game_exit);
  gtk_container_add (GTK_CONTAINER (item1_menu), mnu_game_exit);
  gtk_widget_add_accelerator (mnu_game_exit, "activate", accel_group,
                              GDK_Q, GDK_CONTROL_MASK,
                              GTK_ACCEL_VISIBLE);

  mnu_settings = gtk_menu_item_new_with_label ("Settings");
  gtk_widget_ref (mnu_settings);
  gtk_object_set_data_full (GTK_OBJECT (main_window), "mnu_settings", mnu_settings,
                            (GtkDestroyNotify) gtk_widget_unref);
  gtk_widget_show (mnu_settings);
  gtk_container_add (GTK_CONTAINER (menubar), mnu_settings);

  mnu_settings_menu = gtk_menu_new ();
  gtk_widget_ref (mnu_settings_menu);
  gtk_object_set_data_full (GTK_OBJECT (main_window), "mnu_settings_menu", mnu_settings_menu,
                            (GtkDestroyNotify) gtk_widget_unref);
  gtk_menu_item_set_submenu (GTK_MENU_ITEM (mnu_settings), mnu_settings_menu);
  mnu_settings_menu_accels = gtk_menu_ensure_uline_accel_group (GTK_MENU (mnu_settings_menu));

  mnu_settings_define = gtk_menu_item_new_with_label ("Define Players");
  gtk_widget_ref (mnu_settings_define);
  gtk_object_set_data_full (GTK_OBJECT (main_window), "mnu_settings_define", mnu_settings_define,
                            (GtkDestroyNotify) gtk_widget_unref);
  gtk_widget_show (mnu_settings_define);
  gtk_container_add (GTK_CONTAINER (mnu_settings_menu), mnu_settings_define);

  mnu_settings_select = gtk_menu_item_new_with_label ("Select Players");
  gtk_widget_ref (mnu_settings_select);
  gtk_object_set_data_full (GTK_OBJECT (main_window), "mnu_settings_select", mnu_settings_select,
                            (GtkDestroyNotify) gtk_widget_unref);
  gtk_widget_show (mnu_settings_select);
  gtk_container_add (GTK_CONTAINER (mnu_settings_menu), mnu_settings_select);

  separator2 = gtk_menu_item_new ();
  gtk_widget_ref (separator2);
  gtk_object_set_data_full (GTK_OBJECT (main_window), "separator2", separator2,
                            (GtkDestroyNotify) gtk_widget_unref);
  gtk_widget_show (separator2);
  gtk_container_add (GTK_CONTAINER (mnu_settings_menu), separator2);
  gtk_widget_set_sensitive (separator2, FALSE);

  mnu_settings_theme = gtk_menu_item_new_with_label ("Select Theme");
  gtk_widget_ref (mnu_settings_theme);
  gtk_object_set_data_full (GTK_OBJECT (main_window), "mnu_settings_theme", mnu_settings_theme,
                            (GtkDestroyNotify) gtk_widget_unref);
  gtk_widget_show (mnu_settings_theme);
  gtk_container_add (GTK_CONTAINER (mnu_settings_menu), mnu_settings_theme);

  separator3 = gtk_menu_item_new ();
  gtk_widget_ref (separator3);
  gtk_object_set_data_full (GTK_OBJECT (main_window), "separator3", separator3,
                            (GtkDestroyNotify) gtk_widget_unref);
  gtk_widget_show (separator3);
  gtk_container_add (GTK_CONTAINER (mnu_settings_menu), separator3);
  gtk_widget_set_sensitive (separator3, FALSE);

  mnu_settings_sound = gtk_menu_item_new_with_label ("Toggle Sound");
  gtk_widget_ref (mnu_settings_sound);
  gtk_object_set_data_full (GTK_OBJECT (main_window), "mnu_settings_sound", mnu_settings_sound,
                            (GtkDestroyNotify) gtk_widget_unref);
  gtk_widget_show (mnu_settings_sound);
  gtk_container_add (GTK_CONTAINER (mnu_settings_menu), mnu_settings_sound);
  gtk_widget_add_accelerator (mnu_settings_sound, "activate", accel_group,
                              GDK_F11, 0,
                              GTK_ACCEL_VISIBLE);

  item3 = gtk_menu_item_new_with_label ("Help");
  gtk_widget_ref (item3);
  gtk_object_set_data_full (GTK_OBJECT (main_window), "item3", item3,
                            (GtkDestroyNotify) gtk_widget_unref);
  gtk_widget_show (item3);
  gtk_container_add (GTK_CONTAINER (menubar), item3);

  item3_menu = gtk_menu_new ();
  gtk_widget_ref (item3_menu);
  gtk_object_set_data_full (GTK_OBJECT (main_window), "item3_menu", item3_menu,
                            (GtkDestroyNotify) gtk_widget_unref);
  gtk_menu_item_set_submenu (GTK_MENU_ITEM (item3), item3_menu);
  item3_menu_accels = gtk_menu_ensure_uline_accel_group (GTK_MENU (item3_menu));

  mnu_help_tips = gtk_menu_item_new_with_label ("Getting Started Tips");
  gtk_widget_ref (mnu_help_tips);
  gtk_object_set_data_full (GTK_OBJECT (main_window), "mnu_help_tips", mnu_help_tips,
                            (GtkDestroyNotify) gtk_widget_unref);
  gtk_widget_show (mnu_help_tips);
  gtk_container_add (GTK_CONTAINER (item3_menu), mnu_help_tips);

  separator1 = gtk_menu_item_new ();
  gtk_widget_ref (separator1);
  gtk_object_set_data_full (GTK_OBJECT (main_window), "separator1", separator1,
                            (GtkDestroyNotify) gtk_widget_unref);
  gtk_widget_show (separator1);
  gtk_container_add (GTK_CONTAINER (item3_menu), separator1);
  gtk_widget_set_sensitive (separator1, FALSE);

  mnu_help_about = gtk_menu_item_new_with_label ("About...");
  gtk_widget_ref (mnu_help_about);
  gtk_object_set_data_full (GTK_OBJECT (main_window), "mnu_help_about", mnu_help_about,
                            (GtkDestroyNotify) gtk_widget_unref);
  gtk_widget_show (mnu_help_about);
  gtk_container_add (GTK_CONTAINER (item3_menu), mnu_help_about);
  gtk_widget_add_accelerator (mnu_help_about, "activate", accel_group,
                              GDK_A, 0,
                              GTK_ACCEL_VISIBLE);

  logo = create_pixmap (main_window, "logo.xpm");
  gtk_widget_ref (logo);
  gtk_object_set_data_full (GTK_OBJECT (main_window), "logo", logo,
                            (GtkDestroyNotify) gtk_widget_unref);
  gtk_widget_show (logo);
  gtk_box_pack_start (GTK_BOX (vbox1), logo, TRUE, TRUE, 0);

  progressbar = gtk_progress_bar_new ();
  gtk_widget_ref (progressbar);
  gtk_object_set_data_full (GTK_OBJECT (main_window), "progressbar", progressbar,
                            (GtkDestroyNotify) gtk_widget_unref);
  gtk_widget_show (progressbar);
  gtk_box_pack_end (GTK_BOX (vbox1), progressbar, FALSE, FALSE, 0);
  gtk_progress_set_show_text (GTK_PROGRESS (progressbar), TRUE);
  gtk_progress_set_format_string (GTK_PROGRESS (progressbar), "");

  gtk_signal_connect (GTK_OBJECT (main_window), "expose_event",
                      GTK_SIGNAL_FUNC (main_window_expose_event),
                      NULL);
  gtk_signal_connect (GTK_OBJECT (main_window), "destroy",
                      GTK_SIGNAL_FUNC (main_window_destroy_event),
                      NULL);
  gtk_signal_connect (GTK_OBJECT (mnu_game_new_archon), "activate",
                      GTK_SIGNAL_FUNC (main_game_new_archon),
                      NULL);
  gtk_signal_connect (GTK_OBJECT (mnu_game_new_adept), "activate",
                      GTK_SIGNAL_FUNC (main_game_new_adept),
                      NULL);
  gtk_signal_connect (GTK_OBJECT (mnu_game_unpause), "activate",
                      GTK_SIGNAL_FUNC (main_game_unpause),
                      NULL);
  gtk_signal_connect (GTK_OBJECT (mnu_game_stop), "activate",
                      GTK_SIGNAL_FUNC (main_game_stop),
                      NULL);
  gtk_signal_connect (GTK_OBJECT (mnu_game_exit), "activate",
                      GTK_SIGNAL_FUNC (main_game_exit),
                      NULL);
  gtk_signal_connect (GTK_OBJECT (mnu_settings_define), "activate",
                      GTK_SIGNAL_FUNC (iface_define_players),
                      NULL);
  gtk_signal_connect (GTK_OBJECT (mnu_settings_select), "activate",
                      GTK_SIGNAL_FUNC (iface_select_players),
                      NULL);
  gtk_signal_connect (GTK_OBJECT (mnu_settings_theme), "activate",
                      GTK_SIGNAL_FUNC (theme_select_theme),
                      NULL);
  gtk_signal_connect (GTK_OBJECT (mnu_settings_sound), "activate",
                      GTK_SIGNAL_FUNC (main_toggle_sound),
                      NULL);
  gtk_signal_connect (GTK_OBJECT (mnu_help_tips), "activate",
                      GTK_SIGNAL_FUNC (main_help_tips),
                      NULL);
  gtk_signal_connect (GTK_OBJECT (mnu_help_about), "activate",
                      GTK_SIGNAL_FUNC (main_help_about),
                      NULL);

  gtk_window_add_accel_group (GTK_WINDOW (main_window), accel_group);

  return main_window;
}

GtkWidget*
create_define_window (void)
{
  GtkWidget *define_window;
  GtkWidget *vbox5;
  GtkWidget *hbox3;
  GtkWidget *list;
  GtkWidget *vbox6;
  GtkWidget *config_box;
  GtkWidget *name;
  GSList *config_box_group = NULL;
  GtkWidget *human;
  GtkWidget *computer;
  GtkWidget *network;
  GtkWidget *configure;
  GtkWidget *delete;
  GtkWidget *insert;
  GtkWidget *frame2;
  GtkWidget *hbuttonbox1;
  GtkWidget *ok;
  GtkWidget *cancel;

  define_window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
  gtk_object_set_data (GTK_OBJECT (define_window), "define_window", define_window);
  gtk_widget_set_usize (define_window, 400, 300);
  gtk_window_set_title (GTK_WINDOW (define_window), "Define Players");
  gtk_window_set_position (GTK_WINDOW (define_window), GTK_WIN_POS_CENTER);
  gtk_window_set_modal (GTK_WINDOW (define_window), TRUE);
  gtk_window_set_policy (GTK_WINDOW (define_window), TRUE, TRUE, FALSE);

  vbox5 = gtk_vbox_new (FALSE, 0);
  gtk_widget_ref (vbox5);
  gtk_object_set_data_full (GTK_OBJECT (define_window), "vbox5", vbox5,
                            (GtkDestroyNotify) gtk_widget_unref);
  gtk_widget_show (vbox5);
  gtk_container_add (GTK_CONTAINER (define_window), vbox5);

  hbox3 = gtk_hbox_new (FALSE, 0);
  gtk_widget_ref (hbox3);
  gtk_object_set_data_full (GTK_OBJECT (define_window), "hbox3", hbox3,
                            (GtkDestroyNotify) gtk_widget_unref);
  gtk_widget_show (hbox3);
  gtk_box_pack_start (GTK_BOX (vbox5), hbox3, TRUE, TRUE, 0);

  list = gtk_list_new ();
  gtk_widget_ref (list);
  gtk_object_set_data_full (GTK_OBJECT (define_window), "list", list,
                            (GtkDestroyNotify) gtk_widget_unref);
  gtk_widget_show (list);
  gtk_box_pack_start (GTK_BOX (hbox3), list, FALSE, TRUE, 0);
  gtk_widget_set_usize (list, 180, -2);

  vbox6 = gtk_vbox_new (FALSE, 0);
  gtk_widget_ref (vbox6);
  gtk_object_set_data_full (GTK_OBJECT (define_window), "vbox6", vbox6,
                            (GtkDestroyNotify) gtk_widget_unref);
  gtk_widget_show (vbox6);
  gtk_box_pack_start (GTK_BOX (hbox3), vbox6, TRUE, TRUE, 0);

  config_box = gtk_vbox_new (FALSE, 0);
  gtk_widget_ref (config_box);
  gtk_object_set_data_full (GTK_OBJECT (define_window), "config_box", config_box,
                            (GtkDestroyNotify) gtk_widget_unref);
  gtk_widget_show (config_box);
  gtk_box_pack_start (GTK_BOX (vbox6), config_box, FALSE, FALSE, 0);

  name = gtk_entry_new_with_max_length (32);
  gtk_widget_ref (name);
  gtk_object_set_data_full (GTK_OBJECT (define_window), "name", name,
                            (GtkDestroyNotify) gtk_widget_unref);
  gtk_widget_show (name);
  gtk_box_pack_start (GTK_BOX (config_box), name, FALSE, FALSE, 0);

  human = gtk_radio_button_new_with_label (config_box_group, "Player is Human");
  config_box_group = gtk_radio_button_group (GTK_RADIO_BUTTON (human));
  gtk_widget_ref (human);
  gtk_object_set_data_full (GTK_OBJECT (define_window), "human", human,
                            (GtkDestroyNotify) gtk_widget_unref);
  gtk_widget_show (human);
  gtk_box_pack_start (GTK_BOX (config_box), human, FALSE, FALSE, 0);

  computer = gtk_radio_button_new_with_label (config_box_group, "Player is Computer");
  config_box_group = gtk_radio_button_group (GTK_RADIO_BUTTON (computer));
  gtk_widget_ref (computer);
  gtk_object_set_data_full (GTK_OBJECT (define_window), "computer", computer,
                            (GtkDestroyNotify) gtk_widget_unref);
  gtk_widget_show (computer);
  gtk_box_pack_start (GTK_BOX (config_box), computer, FALSE, FALSE, 0);

  network = gtk_radio_button_new_with_label (config_box_group, "Player uses Network");
  config_box_group = gtk_radio_button_group (GTK_RADIO_BUTTON (network));
  gtk_widget_ref (network);
  gtk_object_set_data_full (GTK_OBJECT (define_window), "network", network,
                            (GtkDestroyNotify) gtk_widget_unref);
  gtk_widget_show (network);
  gtk_box_pack_start (GTK_BOX (config_box), network, FALSE, FALSE, 0);

  configure = gtk_button_new_with_label ("Configure Player");
  gtk_widget_ref (configure);
  gtk_object_set_data_full (GTK_OBJECT (define_window), "configure", configure,
                            (GtkDestroyNotify) gtk_widget_unref);
  gtk_widget_show (configure);
  gtk_box_pack_start (GTK_BOX (config_box), configure, FALSE, FALSE, 0);
  GTK_WIDGET_SET_FLAGS (configure, GTK_CAN_DEFAULT);

  delete = gtk_button_new_with_label ("Delete This Player");
  gtk_widget_ref (delete);
  gtk_object_set_data_full (GTK_OBJECT (define_window), "delete", delete,
                            (GtkDestroyNotify) gtk_widget_unref);
  gtk_widget_show (delete);
  gtk_box_pack_start (GTK_BOX (config_box), delete, FALSE, FALSE, 0);
  GTK_WIDGET_SET_FLAGS (delete, GTK_CAN_DEFAULT);

  insert = gtk_button_new_with_label ("Insert a New Player");
  gtk_widget_ref (insert);
  gtk_object_set_data_full (GTK_OBJECT (define_window), "insert", insert,
                            (GtkDestroyNotify) gtk_widget_unref);
  gtk_widget_show (insert);
  gtk_box_pack_end (GTK_BOX (vbox6), insert, FALSE, FALSE, 0);
  GTK_WIDGET_SET_FLAGS (insert, GTK_CAN_DEFAULT);

  frame2 = gtk_frame_new (NULL);
  gtk_widget_ref (frame2);
  gtk_object_set_data_full (GTK_OBJECT (define_window), "frame2", frame2,
                            (GtkDestroyNotify) gtk_widget_unref);
  gtk_widget_show (frame2);
  gtk_box_pack_end (GTK_BOX (vbox5), frame2, FALSE, TRUE, 0);

  hbuttonbox1 = gtk_hbutton_box_new ();
  gtk_widget_ref (hbuttonbox1);
  gtk_object_set_data_full (GTK_OBJECT (define_window), "hbuttonbox1", hbuttonbox1,
                            (GtkDestroyNotify) gtk_widget_unref);
  gtk_widget_show (hbuttonbox1);
  gtk_container_add (GTK_CONTAINER (frame2), hbuttonbox1);
  gtk_button_box_set_layout (GTK_BUTTON_BOX (hbuttonbox1), GTK_BUTTONBOX_SPREAD);

  ok = gtk_button_new_with_label ("OK");
  gtk_widget_ref (ok);
  gtk_object_set_data_full (GTK_OBJECT (define_window), "ok", ok,
                            (GtkDestroyNotify) gtk_widget_unref);
  gtk_widget_show (ok);
  gtk_container_add (GTK_CONTAINER (hbuttonbox1), ok);
  GTK_WIDGET_SET_FLAGS (ok, GTK_CAN_DEFAULT);

  cancel = gtk_button_new_with_label ("Cancel");
  gtk_widget_ref (cancel);
  gtk_object_set_data_full (GTK_OBJECT (define_window), "cancel", cancel,
                            (GtkDestroyNotify) gtk_widget_unref);
  gtk_widget_show (cancel);
  gtk_container_add (GTK_CONTAINER (hbuttonbox1), cancel);
  GTK_WIDGET_SET_FLAGS (cancel, GTK_CAN_DEFAULT);

  gtk_signal_connect (GTK_OBJECT (define_window), "destroy",
                      GTK_SIGNAL_FUNC (iface_cancel_clicked),
                      NULL);
  gtk_signal_connect (GTK_OBJECT (list), "selection_changed",
                      GTK_SIGNAL_FUNC (iface_list_selection_changed),
                      NULL);
  gtk_signal_connect (GTK_OBJECT (name), "changed",
                      GTK_SIGNAL_FUNC (iface_name_changed),
                      NULL);
  gtk_signal_connect (GTK_OBJECT (human), "toggled",
                      GTK_SIGNAL_FUNC (iface_type_toggled),
                      "human");
  gtk_signal_connect (GTK_OBJECT (computer), "toggled",
                      GTK_SIGNAL_FUNC (iface_type_toggled),
                      "computer");
  gtk_signal_connect (GTK_OBJECT (network), "toggled",
                      GTK_SIGNAL_FUNC (iface_type_toggled),
                      "network");
  gtk_signal_connect (GTK_OBJECT (configure), "clicked",
                      GTK_SIGNAL_FUNC (iface_configure_clicked),
                      NULL);
  gtk_signal_connect (GTK_OBJECT (delete), "clicked",
                      GTK_SIGNAL_FUNC (iface_delete_clicked),
                      NULL);
  gtk_signal_connect (GTK_OBJECT (insert), "clicked",
                      GTK_SIGNAL_FUNC (iface_insert_clicked),
                      NULL);
  gtk_signal_connect (GTK_OBJECT (ok), "clicked",
                      GTK_SIGNAL_FUNC (iface_ok_clicked),
                      NULL);
  gtk_signal_connect (GTK_OBJECT (cancel), "clicked",
                      GTK_SIGNAL_FUNC (iface_cancel_clicked),
                      NULL);

  gtk_widget_grab_focus (list);
  gtk_widget_grab_default (ok);
  return define_window;
}

GtkWidget*
create_theme_window (void)
{
  GtkWidget *theme_window;
  GtkWidget *vbox9;
  GtkWidget *hbox5;
  GtkWidget *drawingarea1;
  GtkWidget *list;
  GtkWidget *drawingarea2;
  GtkWidget *frame7;
  GtkWidget *table1;
  GtkWidget *label2;
  GtkWidget *label1;
  GtkWidget *descr;
  GtkWidget *author;
  GtkWidget *hbuttonbox4;
  GtkWidget *ok;
  GtkWidget *button4;

  theme_window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
  gtk_object_set_data (GTK_OBJECT (theme_window), "theme_window", theme_window);
  gtk_window_set_title (GTK_WINDOW (theme_window), "Select a Theme");
  gtk_window_set_position (GTK_WINDOW (theme_window), GTK_WIN_POS_CENTER);
  gtk_window_set_modal (GTK_WINDOW (theme_window), TRUE);
  gtk_window_set_default_size (GTK_WINDOW (theme_window), 450, 300);
  gtk_window_set_policy (GTK_WINDOW (theme_window), TRUE, TRUE, FALSE);

  vbox9 = gtk_vbox_new (FALSE, 0);
  gtk_widget_ref (vbox9);
  gtk_object_set_data_full (GTK_OBJECT (theme_window), "vbox9", vbox9,
                            (GtkDestroyNotify) gtk_widget_unref);
  gtk_widget_show (vbox9);
  gtk_container_add (GTK_CONTAINER (theme_window), vbox9);

  hbox5 = gtk_hbox_new (FALSE, 0);
  gtk_widget_ref (hbox5);
  gtk_object_set_data_full (GTK_OBJECT (theme_window), "hbox5", hbox5,
                            (GtkDestroyNotify) gtk_widget_unref);
  gtk_widget_show (hbox5);
  gtk_box_pack_start (GTK_BOX (vbox9), hbox5, FALSE, FALSE, 0);

  drawingarea1 = gtk_drawing_area_new ();
  gtk_widget_ref (drawingarea1);
  gtk_object_set_data_full (GTK_OBJECT (theme_window), "drawingarea1", drawingarea1,
                            (GtkDestroyNotify) gtk_widget_unref);
  gtk_widget_show (drawingarea1);
  gtk_box_pack_start (GTK_BOX (hbox5), drawingarea1, TRUE, FALSE, 0);
  gtk_widget_set_sensitive (drawingarea1, FALSE);

  list = gtk_list_new ();
  gtk_widget_ref (list);
  gtk_object_set_data_full (GTK_OBJECT (theme_window), "list", list,
                            (GtkDestroyNotify) gtk_widget_unref);
  gtk_widget_show (list);
  gtk_box_pack_start (GTK_BOX (hbox5), list, TRUE, TRUE, 0);
  gtk_widget_set_usize (list, 50, 215);

  drawingarea2 = gtk_drawing_area_new ();
  gtk_widget_ref (drawingarea2);
  gtk_object_set_data_full (GTK_OBJECT (theme_window), "drawingarea2", drawingarea2,
                            (GtkDestroyNotify) gtk_widget_unref);
  gtk_widget_show (drawingarea2);
  gtk_box_pack_start (GTK_BOX (hbox5), drawingarea2, TRUE, FALSE, 0);
  gtk_widget_set_sensitive (drawingarea2, FALSE);

  frame7 = gtk_frame_new (NULL);
  gtk_widget_ref (frame7);
  gtk_object_set_data_full (GTK_OBJECT (theme_window), "frame7", frame7,
                            (GtkDestroyNotify) gtk_widget_unref);
  gtk_widget_show (frame7);
  gtk_box_pack_start (GTK_BOX (vbox9), frame7, TRUE, TRUE, 0);
  gtk_widget_set_usize (frame7, -2, 1);

  table1 = gtk_table_new (2, 2, FALSE);
  gtk_widget_ref (table1);
  gtk_object_set_data_full (GTK_OBJECT (theme_window), "table1", table1,
                            (GtkDestroyNotify) gtk_widget_unref);
  gtk_widget_show (table1);
  gtk_container_add (GTK_CONTAINER (frame7), table1);
  gtk_widget_set_usize (table1, -2, 1);

  label2 = gtk_label_new ("Author");
  gtk_widget_ref (label2);
  gtk_object_set_data_full (GTK_OBJECT (theme_window), "label2", label2,
                            (GtkDestroyNotify) gtk_widget_unref);
  gtk_widget_show (label2);
  gtk_table_attach (GTK_TABLE (table1), label2, 0, 1, 1, 2,
                    (GtkAttachOptions) (GTK_FILL),
                    (GtkAttachOptions) (0), 0, 0);
  gtk_label_set_justify (GTK_LABEL (label2), GTK_JUSTIFY_LEFT);
  gtk_misc_set_alignment (GTK_MISC (label2), 0, 0.5);

  label1 = gtk_label_new ("Description");
  gtk_widget_ref (label1);
  gtk_object_set_data_full (GTK_OBJECT (theme_window), "label1", label1,
                            (GtkDestroyNotify) gtk_widget_unref);
  gtk_widget_show (label1);
  gtk_table_attach (GTK_TABLE (table1), label1, 0, 1, 0, 1,
                    (GtkAttachOptions) (GTK_FILL),
                    (GtkAttachOptions) (0), 0, 0);
  gtk_label_set_justify (GTK_LABEL (label1), GTK_JUSTIFY_LEFT);
  gtk_misc_set_alignment (GTK_MISC (label1), 0, 0.5);

  descr = gtk_entry_new ();
  gtk_widget_ref (descr);
  gtk_object_set_data_full (GTK_OBJECT (theme_window), "descr", descr,
                            (GtkDestroyNotify) gtk_widget_unref);
  gtk_widget_show (descr);
  gtk_table_attach (GTK_TABLE (table1), descr, 1, 2, 0, 1,
                    (GtkAttachOptions) (GTK_EXPAND | GTK_FILL),
                    (GtkAttachOptions) (0), 0, 0);
  gtk_entry_set_editable (GTK_ENTRY (descr), FALSE);

  author = gtk_entry_new ();
  gtk_widget_ref (author);
  gtk_object_set_data_full (GTK_OBJECT (theme_window), "author", author,
                            (GtkDestroyNotify) gtk_widget_unref);
  gtk_widget_show (author);
  gtk_table_attach (GTK_TABLE (table1), author, 1, 2, 1, 2,
                    (GtkAttachOptions) (GTK_EXPAND | GTK_FILL),
                    (GtkAttachOptions) (0), 0, 0);
  gtk_entry_set_editable (GTK_ENTRY (author), FALSE);

  hbuttonbox4 = gtk_hbutton_box_new ();
  gtk_widget_ref (hbuttonbox4);
  gtk_object_set_data_full (GTK_OBJECT (theme_window), "hbuttonbox4", hbuttonbox4,
                            (GtkDestroyNotify) gtk_widget_unref);
  gtk_widget_show (hbuttonbox4);
  gtk_box_pack_end (GTK_BOX (vbox9), hbuttonbox4, FALSE, FALSE, 0);
  gtk_button_box_set_layout (GTK_BUTTON_BOX (hbuttonbox4), GTK_BUTTONBOX_SPREAD);

  ok = gtk_button_new_with_label ("OK");
  gtk_widget_ref (ok);
  gtk_object_set_data_full (GTK_OBJECT (theme_window), "ok", ok,
                            (GtkDestroyNotify) gtk_widget_unref);
  gtk_widget_show (ok);
  gtk_container_add (GTK_CONTAINER (hbuttonbox4), ok);
  GTK_WIDGET_SET_FLAGS (ok, GTK_CAN_DEFAULT);

  button4 = gtk_button_new_with_label ("Cancel");
  gtk_widget_ref (button4);
  gtk_object_set_data_full (GTK_OBJECT (theme_window), "button4", button4,
                            (GtkDestroyNotify) gtk_widget_unref);
  gtk_widget_show (button4);
  gtk_container_add (GTK_CONTAINER (hbuttonbox4), button4);
  GTK_WIDGET_SET_FLAGS (button4, GTK_CAN_DEFAULT);

  gtk_signal_connect (GTK_OBJECT (theme_window), "destroy",
                      GTK_SIGNAL_FUNC (theme_cancel_clicked),
                      NULL);
  gtk_signal_connect (GTK_OBJECT (list), "selection_changed",
                      GTK_SIGNAL_FUNC (theme_list_selection_changed),
                      NULL);
  gtk_signal_connect (GTK_OBJECT (ok), "clicked",
                      GTK_SIGNAL_FUNC (theme_ok_clicked),
                      NULL);
  gtk_signal_connect (GTK_OBJECT (button4), "clicked",
                      GTK_SIGNAL_FUNC (theme_cancel_clicked),
                      NULL);

  gtk_widget_grab_default (ok);
  return theme_window;
}

GtkWidget*
create_computer_window (void)
{
  GtkWidget *computer_window;
  GtkWidget *vbox10;
  GtkWidget *frame8;
  GtkWidget *vbox11;
  GSList *vbox11_group = NULL;
  GtkWidget *easy;
  GtkWidget *medium;
  GtkWidget *hard;
  GtkWidget *hseparator2;
  GtkWidget *old_board_mode;
  GtkWidget *hbuttonbox5;
  GtkWidget *ok;
  GtkWidget *button6;

  computer_window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
  gtk_object_set_data (GTK_OBJECT (computer_window), "computer_window", computer_window);
  gtk_widget_set_usize (computer_window, 270, 150);
  gtk_window_set_title (GTK_WINDOW (computer_window), "Configure Computer Player");
  gtk_window_set_position (GTK_WINDOW (computer_window), GTK_WIN_POS_CENTER);
  gtk_window_set_modal (GTK_WINDOW (computer_window), TRUE);
  gtk_window_set_policy (GTK_WINDOW (computer_window), TRUE, TRUE, FALSE);

  vbox10 = gtk_vbox_new (FALSE, 0);
  gtk_widget_ref (vbox10);
  gtk_object_set_data_full (GTK_OBJECT (computer_window), "vbox10", vbox10,
                            (GtkDestroyNotify) gtk_widget_unref);
  gtk_widget_show (vbox10);
  gtk_container_add (GTK_CONTAINER (computer_window), vbox10);

  frame8 = gtk_frame_new (NULL);
  gtk_widget_ref (frame8);
  gtk_object_set_data_full (GTK_OBJECT (computer_window), "frame8", frame8,
                            (GtkDestroyNotify) gtk_widget_unref);
  gtk_widget_show (frame8);
  gtk_box_pack_start (GTK_BOX (vbox10), frame8, FALSE, TRUE, 0);

  vbox11 = gtk_vbox_new (FALSE, 0);
  gtk_widget_ref (vbox11);
  gtk_object_set_data_full (GTK_OBJECT (computer_window), "vbox11", vbox11,
                            (GtkDestroyNotify) gtk_widget_unref);
  gtk_widget_show (vbox11);
  gtk_container_add (GTK_CONTAINER (frame8), vbox11);

  easy = gtk_radio_button_new_with_label (vbox11_group, "Easy");
  vbox11_group = gtk_radio_button_group (GTK_RADIO_BUTTON (easy));
  gtk_widget_ref (easy);
  gtk_object_set_data_full (GTK_OBJECT (computer_window), "easy", easy,
                            (GtkDestroyNotify) gtk_widget_unref);
  gtk_widget_show (easy);
  gtk_box_pack_start (GTK_BOX (vbox11), easy, FALSE, FALSE, 0);

  medium = gtk_radio_button_new_with_label (vbox11_group, "Medium");
  vbox11_group = gtk_radio_button_group (GTK_RADIO_BUTTON (medium));
  gtk_widget_ref (medium);
  gtk_object_set_data_full (GTK_OBJECT (computer_window), "medium", medium,
                            (GtkDestroyNotify) gtk_widget_unref);
  gtk_widget_show (medium);
  gtk_box_pack_start (GTK_BOX (vbox11), medium, FALSE, FALSE, 0);

  hard = gtk_radio_button_new_with_label (vbox11_group, "Hard");
  vbox11_group = gtk_radio_button_group (GTK_RADIO_BUTTON (hard));
  gtk_widget_ref (hard);
  gtk_object_set_data_full (GTK_OBJECT (computer_window), "hard", hard,
                            (GtkDestroyNotify) gtk_widget_unref);
  gtk_widget_show (hard);
  gtk_box_pack_start (GTK_BOX (vbox11), hard, FALSE, FALSE, 0);

  hseparator2 = gtk_hseparator_new ();
  gtk_widget_ref (hseparator2);
  gtk_object_set_data_full (GTK_OBJECT (computer_window), "hseparator2", hseparator2,
                            (GtkDestroyNotify) gtk_widget_unref);
  gtk_widget_show (hseparator2);
  gtk_box_pack_start (GTK_BOX (vbox11), hseparator2, TRUE, TRUE, 0);

  old_board_mode = gtk_check_button_new_with_label ("Use old (rule-based) board logic\n(not recommended)");
  gtk_widget_ref (old_board_mode);
  gtk_object_set_data_full (GTK_OBJECT (computer_window), "old_board_mode", old_board_mode,
                            (GtkDestroyNotify) gtk_widget_unref);
  gtk_widget_show (old_board_mode);
  gtk_box_pack_start (GTK_BOX (vbox11), old_board_mode, FALSE, FALSE, 0);

  hbuttonbox5 = gtk_hbutton_box_new ();
  gtk_widget_ref (hbuttonbox5);
  gtk_object_set_data_full (GTK_OBJECT (computer_window), "hbuttonbox5", hbuttonbox5,
                            (GtkDestroyNotify) gtk_widget_unref);
  gtk_widget_show (hbuttonbox5);
  gtk_box_pack_end (GTK_BOX (vbox10), hbuttonbox5, FALSE, FALSE, 0);
  gtk_button_box_set_layout (GTK_BUTTON_BOX (hbuttonbox5), GTK_BUTTONBOX_SPREAD);

  ok = gtk_button_new_with_label ("OK");
  gtk_widget_ref (ok);
  gtk_object_set_data_full (GTK_OBJECT (computer_window), "ok", ok,
                            (GtkDestroyNotify) gtk_widget_unref);
  gtk_widget_show (ok);
  gtk_container_add (GTK_CONTAINER (hbuttonbox5), ok);
  GTK_WIDGET_SET_FLAGS (ok, GTK_CAN_DEFAULT);

  button6 = gtk_button_new_with_label ("Cancel");
  gtk_widget_ref (button6);
  gtk_object_set_data_full (GTK_OBJECT (computer_window), "button6", button6,
                            (GtkDestroyNotify) gtk_widget_unref);
  gtk_widget_show (button6);
  gtk_container_add (GTK_CONTAINER (hbuttonbox5), button6);
  GTK_WIDGET_SET_FLAGS (button6, GTK_CAN_DEFAULT);

  gtk_signal_connect (GTK_OBJECT (computer_window), "destroy",
                      GTK_SIGNAL_FUNC (computer_cancel_clicked),
                      NULL);
  gtk_signal_connect (GTK_OBJECT (easy), "toggled",
                      GTK_SIGNAL_FUNC (computer_skill_toggled),
                      "easy");
  gtk_signal_connect (GTK_OBJECT (medium), "toggled",
                      GTK_SIGNAL_FUNC (computer_skill_toggled),
                      "medium");
  gtk_signal_connect (GTK_OBJECT (hard), "toggled",
                      GTK_SIGNAL_FUNC (computer_skill_toggled),
                      "hard");
  gtk_signal_connect (GTK_OBJECT (ok), "clicked",
                      GTK_SIGNAL_FUNC (computer_ok_clicked),
                      NULL);
  gtk_signal_connect (GTK_OBJECT (button6), "clicked",
                      GTK_SIGNAL_FUNC (computer_cancel_clicked),
                      NULL);

  gtk_widget_grab_default (ok);
  return computer_window;
}

GtkWidget*
create_select_window (void)
{
  GtkWidget *select_window;
  GtkWidget *vbox12;
  GtkWidget *hbox7;
  GtkWidget *label3;
  GtkWidget *label4;
  GtkWidget *hbox6;
  GtkWidget *light_list;
  GtkWidget *vseparator1;
  GtkWidget *dark_list;
  GtkWidget *hbox8;
  GSList *hbox8_group = NULL;
  GtkWidget *light_first;
  GtkWidget *dark_first;
  GtkWidget *hseparator1;
  GtkWidget *hbuttonbox6;
  GtkWidget *ok;
  GtkWidget *button8;

  select_window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
  gtk_object_set_data (GTK_OBJECT (select_window), "select_window", select_window);
  gtk_window_set_title (GTK_WINDOW (select_window), "Select Players for Sides");
  gtk_window_set_position (GTK_WINDOW (select_window), GTK_WIN_POS_CENTER);
  gtk_window_set_modal (GTK_WINDOW (select_window), TRUE);
  gtk_window_set_default_size (GTK_WINDOW (select_window), 300, 350);
  gtk_window_set_policy (GTK_WINDOW (select_window), TRUE, TRUE, FALSE);

  vbox12 = gtk_vbox_new (FALSE, 0);
  gtk_widget_ref (vbox12);
  gtk_object_set_data_full (GTK_OBJECT (select_window), "vbox12", vbox12,
                            (GtkDestroyNotify) gtk_widget_unref);
  gtk_widget_show (vbox12);
  gtk_container_add (GTK_CONTAINER (select_window), vbox12);

  hbox7 = gtk_hbox_new (TRUE, 0);
  gtk_widget_ref (hbox7);
  gtk_object_set_data_full (GTK_OBJECT (select_window), "hbox7", hbox7,
                            (GtkDestroyNotify) gtk_widget_unref);
  gtk_widget_show (hbox7);
  gtk_box_pack_start (GTK_BOX (vbox12), hbox7, TRUE, TRUE, 0);

  label3 = gtk_label_new ("The Light Side");
  gtk_widget_ref (label3);
  gtk_object_set_data_full (GTK_OBJECT (select_window), "label3", label3,
                            (GtkDestroyNotify) gtk_widget_unref);
  gtk_widget_show (label3);
  gtk_box_pack_start (GTK_BOX (hbox7), label3, FALSE, FALSE, 0);
  gtk_widget_set_usize (label3, -2, 1);
  gtk_label_set_justify (GTK_LABEL (label3), GTK_JUSTIFY_LEFT);

  label4 = gtk_label_new ("The Dark Side");
  gtk_widget_ref (label4);
  gtk_object_set_data_full (GTK_OBJECT (select_window), "label4", label4,
                            (GtkDestroyNotify) gtk_widget_unref);
  gtk_widget_show (label4);
  gtk_box_pack_end (GTK_BOX (hbox7), label4, FALSE, FALSE, 0);
  gtk_label_set_justify (GTK_LABEL (label4), GTK_JUSTIFY_RIGHT);

  hbox6 = gtk_hbox_new (FALSE, 0);
  gtk_widget_ref (hbox6);
  gtk_object_set_data_full (GTK_OBJECT (select_window), "hbox6", hbox6,
                            (GtkDestroyNotify) gtk_widget_unref);
  gtk_widget_show (hbox6);
  gtk_box_pack_start (GTK_BOX (vbox12), hbox6, TRUE, TRUE, 0);
  gtk_widget_set_usize (hbox6, -2, 230);

  light_list = gtk_list_new ();
  gtk_widget_ref (light_list);
  gtk_object_set_data_full (GTK_OBJECT (select_window), "light_list", light_list,
                            (GtkDestroyNotify) gtk_widget_unref);
  gtk_widget_show (light_list);
  gtk_box_pack_start (GTK_BOX (hbox6), light_list, TRUE, TRUE, 0);

  vseparator1 = gtk_vseparator_new ();
  gtk_widget_ref (vseparator1);
  gtk_object_set_data_full (GTK_OBJECT (select_window), "vseparator1", vseparator1,
                            (GtkDestroyNotify) gtk_widget_unref);
  gtk_widget_show (vseparator1);
  gtk_box_pack_start (GTK_BOX (hbox6), vseparator1, FALSE, FALSE, 0);

  dark_list = gtk_list_new ();
  gtk_widget_ref (dark_list);
  gtk_object_set_data_full (GTK_OBJECT (select_window), "dark_list", dark_list,
                            (GtkDestroyNotify) gtk_widget_unref);
  gtk_widget_show (dark_list);
  gtk_box_pack_start (GTK_BOX (hbox6), dark_list, TRUE, TRUE, 0);

  hbox8 = gtk_hbox_new (FALSE, 0);
  gtk_widget_ref (hbox8);
  gtk_object_set_data_full (GTK_OBJECT (select_window), "hbox8", hbox8,
                            (GtkDestroyNotify) gtk_widget_unref);
  gtk_widget_show (hbox8);
  gtk_box_pack_start (GTK_BOX (vbox12), hbox8, TRUE, TRUE, 0);

  light_first = gtk_radio_button_new_with_label (hbox8_group, "Light Moves First");
  hbox8_group = gtk_radio_button_group (GTK_RADIO_BUTTON (light_first));
  gtk_widget_ref (light_first);
  gtk_object_set_data_full (GTK_OBJECT (select_window), "light_first", light_first,
                            (GtkDestroyNotify) gtk_widget_unref);
  gtk_widget_show (light_first);
  gtk_box_pack_start (GTK_BOX (hbox8), light_first, FALSE, FALSE, 0);

  dark_first = gtk_radio_button_new_with_label (hbox8_group, "Dark Moves First");
  hbox8_group = gtk_radio_button_group (GTK_RADIO_BUTTON (dark_first));
  gtk_widget_ref (dark_first);
  gtk_object_set_data_full (GTK_OBJECT (select_window), "dark_first", dark_first,
                            (GtkDestroyNotify) gtk_widget_unref);
  gtk_widget_show (dark_first);
  gtk_box_pack_end (GTK_BOX (hbox8), dark_first, FALSE, FALSE, 0);

  hseparator1 = gtk_hseparator_new ();
  gtk_widget_ref (hseparator1);
  gtk_object_set_data_full (GTK_OBJECT (select_window), "hseparator1", hseparator1,
                            (GtkDestroyNotify) gtk_widget_unref);
  gtk_widget_show (hseparator1);
  gtk_box_pack_start (GTK_BOX (vbox12), hseparator1, TRUE, TRUE, 0);

  hbuttonbox6 = gtk_hbutton_box_new ();
  gtk_widget_ref (hbuttonbox6);
  gtk_object_set_data_full (GTK_OBJECT (select_window), "hbuttonbox6", hbuttonbox6,
                            (GtkDestroyNotify) gtk_widget_unref);
  gtk_widget_show (hbuttonbox6);
  gtk_box_pack_start (GTK_BOX (vbox12), hbuttonbox6, FALSE, FALSE, 0);
  gtk_button_box_set_layout (GTK_BUTTON_BOX (hbuttonbox6), GTK_BUTTONBOX_SPREAD);

  ok = gtk_button_new_with_label ("OK");
  gtk_widget_ref (ok);
  gtk_object_set_data_full (GTK_OBJECT (select_window), "ok", ok,
                            (GtkDestroyNotify) gtk_widget_unref);
  gtk_widget_show (ok);
  gtk_container_add (GTK_CONTAINER (hbuttonbox6), ok);
  GTK_WIDGET_SET_FLAGS (ok, GTK_CAN_DEFAULT);

  button8 = gtk_button_new_with_label ("Cancel");
  gtk_widget_ref (button8);
  gtk_object_set_data_full (GTK_OBJECT (select_window), "button8", button8,
                            (GtkDestroyNotify) gtk_widget_unref);
  gtk_widget_show (button8);
  gtk_container_add (GTK_CONTAINER (hbuttonbox6), button8);
  GTK_WIDGET_SET_FLAGS (button8, GTK_CAN_DEFAULT);

  gtk_signal_connect (GTK_OBJECT (select_window), "destroy",
                      GTK_SIGNAL_FUNC (iface_cancel_clicked),
                      NULL);
  gtk_signal_connect (GTK_OBJECT (light_list), "selection_changed",
                      GTK_SIGNAL_FUNC (iface_side_list_selection_changed),
                      "light");
  gtk_signal_connect (GTK_OBJECT (dark_list), "selection_changed",
                      GTK_SIGNAL_FUNC (iface_side_list_selection_changed),
                      "dark");
  gtk_signal_connect (GTK_OBJECT (light_first), "toggled",
                      GTK_SIGNAL_FUNC (iface_first_toggled),
                      "light");
  gtk_signal_connect (GTK_OBJECT (dark_first), "toggled",
                      GTK_SIGNAL_FUNC (iface_first_toggled),
                      "dark");
  gtk_signal_connect (GTK_OBJECT (ok), "clicked",
                      GTK_SIGNAL_FUNC (iface_ok_clicked),
                      NULL);
  gtk_signal_connect (GTK_OBJECT (button8), "clicked",
                      GTK_SIGNAL_FUNC (iface_cancel_clicked),
                      NULL);

  gtk_widget_grab_default (ok);
  return select_window;
}

GtkWidget*
create_network_window (void)
{
  GtkWidget *network_window;
  GtkWidget *vbox13;
  GtkWidget *frame9;
  GtkWidget *vbox15;
  GtkWidget *address;
  GtkWidget *label5;
  GtkWidget *frame10;
  GtkWidget *vbox16;
  GtkWidget *port;
  GtkWidget *label6;
  GtkWidget *hbuttonbox7;
  GtkWidget *button9;
  GtkWidget *button10;

  network_window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
  gtk_object_set_data (GTK_OBJECT (network_window), "network_window", network_window);
  gtk_widget_set_usize (network_window, 300, 220);
  gtk_window_set_title (GTK_WINDOW (network_window), "Configure Network Player");
  gtk_window_set_position (GTK_WINDOW (network_window), GTK_WIN_POS_CENTER);
  gtk_window_set_modal (GTK_WINDOW (network_window), TRUE);
  gtk_window_set_policy (GTK_WINDOW (network_window), TRUE, TRUE, FALSE);

  vbox13 = gtk_vbox_new (TRUE, 0);
  gtk_widget_ref (vbox13);
  gtk_object_set_data_full (GTK_OBJECT (network_window), "vbox13", vbox13,
                            (GtkDestroyNotify) gtk_widget_unref);
  gtk_widget_show (vbox13);
  gtk_container_add (GTK_CONTAINER (network_window), vbox13);

  frame9 = gtk_frame_new ("Host IP Address");
  gtk_widget_ref (frame9);
  gtk_object_set_data_full (GTK_OBJECT (network_window), "frame9", frame9,
                            (GtkDestroyNotify) gtk_widget_unref);
  gtk_widget_show (frame9);
  gtk_box_pack_start (GTK_BOX (vbox13), frame9, FALSE, FALSE, 0);

  vbox15 = gtk_vbox_new (FALSE, 0);
  gtk_widget_ref (vbox15);
  gtk_object_set_data_full (GTK_OBJECT (network_window), "vbox15", vbox15,
                            (GtkDestroyNotify) gtk_widget_unref);
  gtk_widget_show (vbox15);
  gtk_container_add (GTK_CONTAINER (frame9), vbox15);

  address = gtk_entry_new ();
  gtk_widget_ref (address);
  gtk_object_set_data_full (GTK_OBJECT (network_window), "address", address,
                            (GtkDestroyNotify) gtk_widget_unref);
  gtk_widget_show (address);
  gtk_box_pack_start (GTK_BOX (vbox15), address, FALSE, FALSE, 0);

  label5 = gtk_label_new ("Note:  the Light Side player hosts the game");
  gtk_widget_ref (label5);
  gtk_object_set_data_full (GTK_OBJECT (network_window), "label5", label5,
                            (GtkDestroyNotify) gtk_widget_unref);
  gtk_widget_show (label5);
  gtk_box_pack_start (GTK_BOX (vbox15), label5, FALSE, FALSE, 0);
  gtk_label_set_justify (GTK_LABEL (label5), GTK_JUSTIFY_LEFT);
  gtk_misc_set_alignment (GTK_MISC (label5), 0.02, 0.5);

  frame10 = gtk_frame_new ("Port Number");
  gtk_widget_ref (frame10);
  gtk_object_set_data_full (GTK_OBJECT (network_window), "frame10", frame10,
                            (GtkDestroyNotify) gtk_widget_unref);
  gtk_widget_show (frame10);
  gtk_box_pack_start (GTK_BOX (vbox13), frame10, FALSE, FALSE, 0);

  vbox16 = gtk_vbox_new (FALSE, 0);
  gtk_widget_ref (vbox16);
  gtk_object_set_data_full (GTK_OBJECT (network_window), "vbox16", vbox16,
                            (GtkDestroyNotify) gtk_widget_unref);
  gtk_widget_show (vbox16);
  gtk_container_add (GTK_CONTAINER (frame10), vbox16);

  port = gtk_entry_new ();
  gtk_widget_ref (port);
  gtk_object_set_data_full (GTK_OBJECT (network_window), "port", port,
                            (GtkDestroyNotify) gtk_widget_unref);
  gtk_widget_show (port);
  gtk_box_pack_start (GTK_BOX (vbox16), port, FALSE, FALSE, 0);

  label6 = gtk_label_new ("Note: this field is required for both machines");
  gtk_widget_ref (label6);
  gtk_object_set_data_full (GTK_OBJECT (network_window), "label6", label6,
                            (GtkDestroyNotify) gtk_widget_unref);
  gtk_widget_show (label6);
  gtk_box_pack_start (GTK_BOX (vbox16), label6, FALSE, FALSE, 0);
  gtk_label_set_justify (GTK_LABEL (label6), GTK_JUSTIFY_LEFT);
  gtk_misc_set_alignment (GTK_MISC (label6), 0.02, 0.5);

  hbuttonbox7 = gtk_hbutton_box_new ();
  gtk_widget_ref (hbuttonbox7);
  gtk_object_set_data_full (GTK_OBJECT (network_window), "hbuttonbox7", hbuttonbox7,
                            (GtkDestroyNotify) gtk_widget_unref);
  gtk_widget_show (hbuttonbox7);
  gtk_box_pack_end (GTK_BOX (vbox13), hbuttonbox7, FALSE, FALSE, 0);
  gtk_button_box_set_layout (GTK_BUTTON_BOX (hbuttonbox7), GTK_BUTTONBOX_SPREAD);

  button9 = gtk_button_new_with_label ("OK");
  gtk_widget_ref (button9);
  gtk_object_set_data_full (GTK_OBJECT (network_window), "button9", button9,
                            (GtkDestroyNotify) gtk_widget_unref);
  gtk_widget_show (button9);
  gtk_container_add (GTK_CONTAINER (hbuttonbox7), button9);
  GTK_WIDGET_SET_FLAGS (button9, GTK_CAN_DEFAULT);

  button10 = gtk_button_new_with_label ("Cancel");
  gtk_widget_ref (button10);
  gtk_object_set_data_full (GTK_OBJECT (network_window), "button10", button10,
                            (GtkDestroyNotify) gtk_widget_unref);
  gtk_widget_show (button10);
  gtk_container_add (GTK_CONTAINER (hbuttonbox7), button10);
  GTK_WIDGET_SET_FLAGS (button10, GTK_CAN_DEFAULT);

  gtk_signal_connect (GTK_OBJECT (network_window), "destroy",
                      GTK_SIGNAL_FUNC (network_cancel_clicked),
                      NULL);
  gtk_signal_connect (GTK_OBJECT (button9), "clicked",
                      GTK_SIGNAL_FUNC (network_ok_clicked),
                      NULL);
  gtk_signal_connect (GTK_OBJECT (button10), "clicked",
                      GTK_SIGNAL_FUNC (network_cancel_clicked),
                      NULL);

  gtk_widget_grab_default (button9);
  return network_window;
}

GtkWidget*
create_about_window (void)
{
  GtkWidget *about_window;
  GtkWidget *vbox17;
  GtkWidget *text1;
  GtkWidget *ok;

  about_window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
  gtk_object_set_data (GTK_OBJECT (about_window), "about_window", about_window);
  gtk_window_set_title (GTK_WINDOW (about_window), "The Obligatory About Box");
  gtk_window_set_position (GTK_WINDOW (about_window), GTK_WIN_POS_CENTER);
  gtk_window_set_modal (GTK_WINDOW (about_window), TRUE);
  gtk_window_set_default_size (GTK_WINDOW (about_window), 320, 420);
  gtk_window_set_policy (GTK_WINDOW (about_window), TRUE, TRUE, FALSE);

  vbox17 = gtk_vbox_new (FALSE, 0);
  gtk_widget_ref (vbox17);
  gtk_object_set_data_full (GTK_OBJECT (about_window), "vbox17", vbox17,
                            (GtkDestroyNotify) gtk_widget_unref);
  gtk_widget_show (vbox17);
  gtk_container_add (GTK_CONTAINER (about_window), vbox17);

  text1 = gtk_text_new (NULL, NULL);
  gtk_widget_ref (text1);
  gtk_object_set_data_full (GTK_OBJECT (about_window), "text1", text1,
                            (GtkDestroyNotify) gtk_widget_unref);
  gtk_widget_show (text1);
  gtk_box_pack_start (GTK_BOX (vbox17), text1, TRUE, TRUE, 0);
  gtk_widget_realize (text1);
  gtk_text_insert (GTK_TEXT (text1), NULL, NULL, NULL,
                   "\t\t\t\tX ARCHON\n\nBy Ronen Tzur <rtzur@shani.net>\n\nBased on an original game by Anne Westfall,\nJon Freeman and Paul Reiche, III\n\nGraphics by:\nDan LaPine <d-lapine@cecer.army.mil>\nMatt Kimball <mkimball@xmission.com>\nMark Shoulson <mark@kli.org>\nJoerg Osarek <joerg@osarek.de>\n\nSound support:\nDan Hursh <hursh@sparc.isl.net>\n\nComputer board player enhanced by:\nShai Roitman <shairoi@ibm.net>\n\nThe X ARCHON homepage:\nhttp://xarchon.seul.org\n\nX ARCHON is a member of the SEUL project.\nCheck out http://www.seul.org for more info.\n", 523);

  ok = gtk_button_new_with_label ("OK");
  gtk_widget_ref (ok);
  gtk_object_set_data_full (GTK_OBJECT (about_window), "ok", ok,
                            (GtkDestroyNotify) gtk_widget_unref);
  gtk_widget_show (ok);
  gtk_box_pack_start (GTK_BOX (vbox17), ok, FALSE, FALSE, 0);

  gtk_signal_connect (GTK_OBJECT (about_window), "destroy",
                      GTK_SIGNAL_FUNC (main_help_about),
                      NULL);
  gtk_signal_connect (GTK_OBJECT (ok), "clicked",
                      GTK_SIGNAL_FUNC (main_help_about),
                      NULL);

  return about_window;
}

GtkWidget*
create_tips_window (void)
{
  GtkWidget *tips_window;
  GtkWidget *vbox18;
  GtkWidget *text2;
  GtkWidget *button11;

  tips_window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
  gtk_object_set_data (GTK_OBJECT (tips_window), "tips_window", tips_window);
  gtk_window_set_title (GTK_WINDOW (tips_window), "Getting Started Tips");
  gtk_window_set_position (GTK_WINDOW (tips_window), GTK_WIN_POS_CENTER);
  gtk_window_set_modal (GTK_WINDOW (tips_window), TRUE);
  gtk_window_set_default_size (GTK_WINDOW (tips_window), 400, 320);
  gtk_window_set_policy (GTK_WINDOW (tips_window), TRUE, TRUE, FALSE);

  vbox18 = gtk_vbox_new (FALSE, 0);
  gtk_widget_ref (vbox18);
  gtk_object_set_data_full (GTK_OBJECT (tips_window), "vbox18", vbox18,
                            (GtkDestroyNotify) gtk_widget_unref);
  gtk_widget_show (vbox18);
  gtk_container_add (GTK_CONTAINER (tips_window), vbox18);

  text2 = gtk_text_new (NULL, NULL);
  gtk_widget_ref (text2);
  gtk_object_set_data_full (GTK_OBJECT (tips_window), "text2", text2,
                            (GtkDestroyNotify) gtk_widget_unref);
  gtk_widget_show (text2);
  gtk_box_pack_start (GTK_BOX (vbox18), text2, TRUE, TRUE, 0);
  gtk_widget_realize (text2);
  gtk_text_insert (GTK_TEXT (text2), NULL, NULL, NULL,
                   "Getting Started with X ARCHON\n\no  Use Settings|Select Players to select a player for each side,\nand to say who goes first.\n\no  Don't be surprised that easy computer players don't fire in\ndiagonal directions--it's supposed to be this way.\n\no  Use Settings|Define Players to define/configure players.  It is\npossible to configure controls (keyboard/joystick for human\nplayers), difficulty level (for computer players), and network\naddresses (for network players).\n\no  When playing over the network, use Settings|Select Players\nto select a network player for the side _the_other_guy_ is playing.\n(From the game's point of view, it makes sense:  you are the\nhuman player, and the other guy is the network player.)\n\no  Read the manpage for more information.\n", 753);

  button11 = gtk_button_new_with_label ("OK");
  gtk_widget_ref (button11);
  gtk_object_set_data_full (GTK_OBJECT (tips_window), "button11", button11,
                            (GtkDestroyNotify) gtk_widget_unref);
  gtk_widget_show (button11);
  gtk_box_pack_start (GTK_BOX (vbox18), button11, FALSE, FALSE, 0);

  gtk_signal_connect (GTK_OBJECT (button11), "clicked",
                      GTK_SIGNAL_FUNC (main_help_tips),
                      NULL);

  return tips_window;
}

GtkWidget*
create_human_window (void)
{
  GtkWidget *human_window;
  GtkWidget *vbox19;
  GtkWidget *hbox10;
  GtkWidget *frame14;
  GtkWidget *side;
  GtkWidget *side_menu;
  GtkWidget *glade_menuitem;
  GtkWidget *frame15;
  GtkWidget *table3;
  GtkWidget *up_left_key_button;
  GtkWidget *left_key_button;
  GtkWidget *down_left_key_button;
  GtkWidget *up_key_button;
  GtkWidget *fire_key_button;
  GtkWidget *down_key_button;
  GtkWidget *up_right_key_button;
  GtkWidget *right_key_button;
  GtkWidget *down_right_key_button;
  GtkWidget *frame13;
  GtkWidget *non_keyboard;
  GtkWidget *non_keyboard_menu;
  GtkWidget *hbuttonbox9;
  GtkWidget *button23;
  GtkWidget *button24;
  GtkTooltips *tooltips;

  tooltips = gtk_tooltips_new ();

  human_window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
  gtk_object_set_data (GTK_OBJECT (human_window), "human_window", human_window);
  gtk_window_set_title (GTK_WINDOW (human_window), "Configure Human Player");
  gtk_window_set_position (GTK_WINDOW (human_window), GTK_WIN_POS_CENTER);
  gtk_window_set_modal (GTK_WINDOW (human_window), TRUE);

  vbox19 = gtk_vbox_new (FALSE, 0);
  gtk_widget_ref (vbox19);
  gtk_object_set_data_full (GTK_OBJECT (human_window), "vbox19", vbox19,
                            (GtkDestroyNotify) gtk_widget_unref);
  gtk_widget_show (vbox19);
  gtk_container_add (GTK_CONTAINER (human_window), vbox19);
  gtk_container_set_border_width (GTK_CONTAINER (vbox19), 5);

  hbox10 = gtk_hbox_new (FALSE, 0);
  gtk_widget_ref (hbox10);
  gtk_object_set_data_full (GTK_OBJECT (human_window), "hbox10", hbox10,
                            (GtkDestroyNotify) gtk_widget_unref);
  gtk_widget_show (hbox10);
  gtk_box_pack_start (GTK_BOX (vbox19), hbox10, TRUE, TRUE, 0);

  frame14 = gtk_frame_new ("Side");
  gtk_widget_ref (frame14);
  gtk_object_set_data_full (GTK_OBJECT (human_window), "frame14", frame14,
                            (GtkDestroyNotify) gtk_widget_unref);
  gtk_widget_show (frame14);
  gtk_box_pack_start (GTK_BOX (hbox10), frame14, TRUE, TRUE, 0);

  side = gtk_option_menu_new ();
  gtk_widget_ref (side);
  gtk_object_set_data_full (GTK_OBJECT (human_window), "side", side,
                            (GtkDestroyNotify) gtk_widget_unref);
  gtk_widget_show (side);
  gtk_container_add (GTK_CONTAINER (frame14), side);
  gtk_tooltips_set_tip (tooltips, side, "Configure keys for either the light side, the dark side, or for both sides at once", NULL);
  side_menu = gtk_menu_new ();
  glade_menuitem = gtk_menu_item_new_with_label ("Light Side");
  gtk_widget_show (glade_menuitem);
  gtk_menu_append (GTK_MENU (side_menu), glade_menuitem);
  glade_menuitem = gtk_menu_item_new_with_label ("Dark Side");
  gtk_widget_show (glade_menuitem);
  gtk_menu_append (GTK_MENU (side_menu), glade_menuitem);
  glade_menuitem = gtk_menu_item_new_with_label ("Both Sides");
  gtk_widget_show (glade_menuitem);
  gtk_menu_append (GTK_MENU (side_menu), glade_menuitem);
  gtk_option_menu_set_menu (GTK_OPTION_MENU (side), side_menu);

  frame15 = gtk_frame_new ("Keys");
  gtk_widget_ref (frame15);
  gtk_object_set_data_full (GTK_OBJECT (human_window), "frame15", frame15,
                            (GtkDestroyNotify) gtk_widget_unref);
  gtk_widget_show (frame15);
  gtk_box_pack_start (GTK_BOX (hbox10), frame15, TRUE, TRUE, 0);

  table3 = gtk_table_new (3, 3, TRUE);
  gtk_widget_ref (table3);
  gtk_object_set_data_full (GTK_OBJECT (human_window), "table3", table3,
                            (GtkDestroyNotify) gtk_widget_unref);
  gtk_widget_show (table3);
  gtk_container_add (GTK_CONTAINER (frame15), table3);
  gtk_table_set_row_spacings (GTK_TABLE (table3), 3);
  gtk_table_set_col_spacings (GTK_TABLE (table3), 6);

  up_left_key_button = gtk_button_new_with_label ("Up Left:");
  gtk_widget_ref (up_left_key_button);
  gtk_object_set_data_full (GTK_OBJECT (human_window), "up_left_key_button", up_left_key_button,
                            (GtkDestroyNotify) gtk_widget_unref);
  gtk_widget_show (up_left_key_button);
  gtk_table_attach (GTK_TABLE (table3), up_left_key_button, 0, 1, 0, 1,
                    (GtkAttachOptions) (GTK_EXPAND | GTK_FILL),
                    (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), 0, 0);
  gtk_widget_set_usize (up_left_key_button, 150, -2);

  left_key_button = gtk_button_new_with_label ("Left:");
  gtk_widget_ref (left_key_button);
  gtk_object_set_data_full (GTK_OBJECT (human_window), "left_key_button", left_key_button,
                            (GtkDestroyNotify) gtk_widget_unref);
  gtk_widget_show (left_key_button);
  gtk_table_attach (GTK_TABLE (table3), left_key_button, 0, 1, 1, 2,
                    (GtkAttachOptions) (GTK_EXPAND | GTK_FILL),
                    (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), 0, 0);
  gtk_widget_set_usize (left_key_button, 150, -2);

  down_left_key_button = gtk_button_new_with_label ("Down Left:");
  gtk_widget_ref (down_left_key_button);
  gtk_object_set_data_full (GTK_OBJECT (human_window), "down_left_key_button", down_left_key_button,
                            (GtkDestroyNotify) gtk_widget_unref);
  gtk_widget_show (down_left_key_button);
  gtk_table_attach (GTK_TABLE (table3), down_left_key_button, 0, 1, 2, 3,
                    (GtkAttachOptions) (GTK_EXPAND | GTK_FILL),
                    (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), 0, 0);
  gtk_widget_set_usize (down_left_key_button, 150, -2);

  up_key_button = gtk_button_new_with_label ("Up:");
  gtk_widget_ref (up_key_button);
  gtk_object_set_data_full (GTK_OBJECT (human_window), "up_key_button", up_key_button,
                            (GtkDestroyNotify) gtk_widget_unref);
  gtk_widget_show (up_key_button);
  gtk_table_attach (GTK_TABLE (table3), up_key_button, 1, 2, 0, 1,
                    (GtkAttachOptions) (GTK_EXPAND | GTK_FILL),
                    (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), 0, 0);
  gtk_widget_set_usize (up_key_button, 150, -2);

  fire_key_button = gtk_button_new_with_label ("Fire:");
  gtk_widget_ref (fire_key_button);
  gtk_object_set_data_full (GTK_OBJECT (human_window), "fire_key_button", fire_key_button,
                            (GtkDestroyNotify) gtk_widget_unref);
  gtk_widget_show (fire_key_button);
  gtk_table_attach (GTK_TABLE (table3), fire_key_button, 1, 2, 1, 2,
                    (GtkAttachOptions) (GTK_EXPAND | GTK_FILL),
                    (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), 0, 0);
  gtk_widget_set_usize (fire_key_button, 150, -2);

  down_key_button = gtk_button_new_with_label ("Down:");
  gtk_widget_ref (down_key_button);
  gtk_object_set_data_full (GTK_OBJECT (human_window), "down_key_button", down_key_button,
                            (GtkDestroyNotify) gtk_widget_unref);
  gtk_widget_show (down_key_button);
  gtk_table_attach (GTK_TABLE (table3), down_key_button, 1, 2, 2, 3,
                    (GtkAttachOptions) (GTK_EXPAND | GTK_FILL),
                    (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), 0, 0);
  gtk_widget_set_usize (down_key_button, 150, -2);

  up_right_key_button = gtk_button_new_with_label ("Up Right:");
  gtk_widget_ref (up_right_key_button);
  gtk_object_set_data_full (GTK_OBJECT (human_window), "up_right_key_button", up_right_key_button,
                            (GtkDestroyNotify) gtk_widget_unref);
  gtk_widget_show (up_right_key_button);
  gtk_table_attach (GTK_TABLE (table3), up_right_key_button, 2, 3, 0, 1,
                    (GtkAttachOptions) (GTK_EXPAND | GTK_FILL),
                    (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), 0, 0);
  gtk_widget_set_usize (up_right_key_button, 150, -2);

  right_key_button = gtk_button_new_with_label ("Right:");
  gtk_widget_ref (right_key_button);
  gtk_object_set_data_full (GTK_OBJECT (human_window), "right_key_button", right_key_button,
                            (GtkDestroyNotify) gtk_widget_unref);
  gtk_widget_show (right_key_button);
  gtk_table_attach (GTK_TABLE (table3), right_key_button, 2, 3, 1, 2,
                    (GtkAttachOptions) (GTK_EXPAND | GTK_FILL),
                    (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), 0, 0);
  gtk_widget_set_usize (right_key_button, 150, -2);

  down_right_key_button = gtk_button_new_with_label ("Down Right:");
  gtk_widget_ref (down_right_key_button);
  gtk_object_set_data_full (GTK_OBJECT (human_window), "down_right_key_button", down_right_key_button,
                            (GtkDestroyNotify) gtk_widget_unref);
  gtk_widget_show (down_right_key_button);
  gtk_table_attach (GTK_TABLE (table3), down_right_key_button, 2, 3, 2, 3,
                    (GtkAttachOptions) (GTK_EXPAND | GTK_FILL),
                    (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), 0, 0);
  gtk_widget_set_usize (down_right_key_button, 150, -2);

  frame13 = gtk_frame_new ("Joystick and mouse support (in addition to keyboard)");
  gtk_widget_ref (frame13);
  gtk_object_set_data_full (GTK_OBJECT (human_window), "frame13", frame13,
                            (GtkDestroyNotify) gtk_widget_unref);
  gtk_widget_show (frame13);
  gtk_box_pack_start (GTK_BOX (vbox19), frame13, TRUE, TRUE, 0);

  non_keyboard = gtk_option_menu_new ();
  gtk_widget_ref (non_keyboard);
  gtk_object_set_data_full (GTK_OBJECT (human_window), "non_keyboard", non_keyboard,
                            (GtkDestroyNotify) gtk_widget_unref);
  gtk_widget_show (non_keyboard);
  gtk_container_add (GTK_CONTAINER (frame13), non_keyboard);
  gtk_widget_set_usize (non_keyboard, 50, -2);
  non_keyboard_menu = gtk_menu_new ();
  glade_menuitem = gtk_menu_item_new_with_label ("Don't use a joystick or mouse");
  gtk_widget_show (glade_menuitem);
  gtk_menu_append (GTK_MENU (non_keyboard_menu), glade_menuitem);
  glade_menuitem = gtk_menu_item_new_with_label ("Use the first joystick");
  gtk_widget_show (glade_menuitem);
  gtk_menu_append (GTK_MENU (non_keyboard_menu), glade_menuitem);
  glade_menuitem = gtk_menu_item_new_with_label ("Use the second joystick");
  gtk_widget_show (glade_menuitem);
  gtk_menu_append (GTK_MENU (non_keyboard_menu), glade_menuitem);
  glade_menuitem = gtk_menu_item_new_with_label ("Use the third joystick");
  gtk_widget_show (glade_menuitem);
  gtk_menu_append (GTK_MENU (non_keyboard_menu), glade_menuitem);
  glade_menuitem = gtk_menu_item_new_with_label ("Use the fourth joystick");
  gtk_widget_show (glade_menuitem);
  gtk_menu_append (GTK_MENU (non_keyboard_menu), glade_menuitem);
  glade_menuitem = gtk_menu_item_new_with_label ("Use mouse, motion is relative");
  gtk_widget_show (glade_menuitem);
  gtk_menu_append (GTK_MENU (non_keyboard_menu), glade_menuitem);
  glade_menuitem = gtk_menu_item_new_with_label ("Use mouse, motion is absolute");
  gtk_widget_show (glade_menuitem);
  gtk_menu_append (GTK_MENU (non_keyboard_menu), glade_menuitem);
  gtk_option_menu_set_menu (GTK_OPTION_MENU (non_keyboard), non_keyboard_menu);

  hbuttonbox9 = gtk_hbutton_box_new ();
  gtk_widget_ref (hbuttonbox9);
  gtk_object_set_data_full (GTK_OBJECT (human_window), "hbuttonbox9", hbuttonbox9,
                            (GtkDestroyNotify) gtk_widget_unref);
  gtk_widget_show (hbuttonbox9);
  gtk_box_pack_start (GTK_BOX (vbox19), hbuttonbox9, TRUE, TRUE, 0);
  gtk_button_box_set_layout (GTK_BUTTON_BOX (hbuttonbox9), GTK_BUTTONBOX_SPREAD);

  button23 = gtk_button_new_with_label ("Ok");
  gtk_widget_ref (button23);
  gtk_object_set_data_full (GTK_OBJECT (human_window), "button23", button23,
                            (GtkDestroyNotify) gtk_widget_unref);
  gtk_widget_show (button23);
  gtk_container_add (GTK_CONTAINER (hbuttonbox9), button23);
  GTK_WIDGET_SET_FLAGS (button23, GTK_CAN_DEFAULT);

  button24 = gtk_button_new_with_label ("Cancel");
  gtk_widget_ref (button24);
  gtk_object_set_data_full (GTK_OBJECT (human_window), "button24", button24,
                            (GtkDestroyNotify) gtk_widget_unref);
  gtk_widget_show (button24);
  gtk_container_add (GTK_CONTAINER (hbuttonbox9), button24);
  GTK_WIDGET_SET_FLAGS (button24, GTK_CAN_DEFAULT);

  gtk_signal_connect (GTK_OBJECT (human_window), "destroy",
                      GTK_SIGNAL_FUNC (human_cancel_clicked),
                      NULL);
  gtk_signal_connect (GTK_OBJECT (up_left_key_button), "clicked",
                      GTK_SIGNAL_FUNC (human_keysym_clicked),
                      "ul");
  gtk_signal_connect (GTK_OBJECT (left_key_button), "clicked",
                      GTK_SIGNAL_FUNC (human_keysym_clicked),
                      "l");
  gtk_signal_connect (GTK_OBJECT (down_left_key_button), "clicked",
                      GTK_SIGNAL_FUNC (human_keysym_clicked),
                      "dl");
  gtk_signal_connect (GTK_OBJECT (up_key_button), "clicked",
                      GTK_SIGNAL_FUNC (human_keysym_clicked),
                      "u");
  gtk_signal_connect (GTK_OBJECT (fire_key_button), "clicked",
                      GTK_SIGNAL_FUNC (human_keysym_clicked),
                      "f");
  gtk_signal_connect (GTK_OBJECT (down_key_button), "clicked",
                      GTK_SIGNAL_FUNC (human_keysym_clicked),
                      "d");
  gtk_signal_connect (GTK_OBJECT (up_right_key_button), "clicked",
                      GTK_SIGNAL_FUNC (human_keysym_clicked),
                      "ur");
  gtk_signal_connect (GTK_OBJECT (right_key_button), "clicked",
                      GTK_SIGNAL_FUNC (human_keysym_clicked),
                      "r");
  gtk_signal_connect (GTK_OBJECT (down_right_key_button), "clicked",
                      GTK_SIGNAL_FUNC (human_keysym_clicked),
                      "dr");
  gtk_signal_connect (GTK_OBJECT (button23), "clicked",
                      GTK_SIGNAL_FUNC (human_ok_clicked),
                      NULL);
  gtk_signal_connect (GTK_OBJECT (button24), "clicked",
                      GTK_SIGNAL_FUNC (human_cancel_clicked),
                      NULL);

  gtk_object_set_data (GTK_OBJECT (human_window), "tooltips", tooltips);

  return human_window;
}

