/* * DO NOT EDIT THIS FILE - it is generated by Glade. */ #ifdef HAVE_CONFIG_H # include #endif #include #include #include #include #include #include #include #include "misc_callbacks.h" #include "misc_interface.h" #include "support.h" #define GLADE_HOOKUP_OBJECT(component,widget,name) \ g_object_set_data_full (G_OBJECT (component), name, \ gtk_widget_ref (widget), (GDestroyNotify) gtk_widget_unref) #define GLADE_HOOKUP_OBJECT_NO_REF(component,widget,name) \ g_object_set_data (G_OBJECT (component), name, widget) GtkWidget* create_window_startup (void) { GtkWidget *window_startup; GtkWidget *vbox2; GtkWidget *scrolledwindow1; GtkWidget *treeview_startup; GtkWidget *hseparator10; GtkWidget *vbox34; GtkWidget *label69; GtkWidget *hbox44; GtkWidget *combo_country; GtkWidget *combo_country_entry; GtkWidget *vseparator17; GtkWidget *button_select_country_file; GtkWidget *alignment14; GtkWidget *hbox45; GtkWidget *image45; GtkWidget *label70; GtkWidget *hseparator11; GtkWidget *label4; GtkWidget *eventbox1; GtkWidget *hbox2; GtkWidget *team_selection_radio1; GSList *team_selection_radio1_group = NULL; GtkWidget *team_selection_radio2; GtkWidget *team_selection_radio3; GtkWidget *hseparator12; GtkWidget *hbox54; GtkWidget *label75; GtkWidget *entry_player_name; GtkWidget *button_add_player; GtkWidget *alignment19; GtkWidget *hbox55; GtkWidget *image59; GtkWidget *label76; GtkWidget *hseparator13; GtkWidget *hbox3; GtkWidget *team_selection_ok; GtkWidget *alignment18; GtkWidget *hbox53; GtkWidget *image58; GtkWidget *label74; GtkWidget *team_selection_cancel; GtkWidget *alignment2; GtkWidget *hbox5; GtkWidget *image3; GtkWidget *label2; GtkWidget *team_selection_load; GtkWidget *alignment3; GtkWidget *hbox6; GtkWidget *image4; GtkWidget *label5; GtkAccelGroup *accel_group; GtkTooltips *tooltips; tooltips = gtk_tooltips_new (); accel_group = gtk_accel_group_new (); window_startup = gtk_window_new (GTK_WINDOW_TOPLEVEL); gtk_container_set_border_width (GTK_CONTAINER (window_startup), 6); gtk_window_set_title (GTK_WINDOW (window_startup), _("Select team and country")); gtk_window_set_position (GTK_WINDOW (window_startup), GTK_WIN_POS_CENTER); gtk_window_set_default_size (GTK_WINDOW (window_startup), 500, 600); vbox2 = gtk_vbox_new (FALSE, 0); gtk_widget_show (vbox2); gtk_container_add (GTK_CONTAINER (window_startup), vbox2); scrolledwindow1 = gtk_scrolled_window_new (NULL, NULL); gtk_widget_show (scrolledwindow1); gtk_box_pack_start (GTK_BOX (vbox2), scrolledwindow1, TRUE, TRUE, 0); gtk_container_set_border_width (GTK_CONTAINER (scrolledwindow1), 6); gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (scrolledwindow1), GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC); treeview_startup = gtk_tree_view_new (); gtk_widget_show (treeview_startup); gtk_container_add (GTK_CONTAINER (scrolledwindow1), treeview_startup); gtk_container_set_border_width (GTK_CONTAINER (treeview_startup), 2); gtk_tree_view_set_rules_hint (GTK_TREE_VIEW (treeview_startup), TRUE); gtk_tree_view_set_reorderable (GTK_TREE_VIEW (treeview_startup), TRUE); hseparator10 = gtk_hseparator_new (); gtk_widget_show (hseparator10); gtk_box_pack_start (GTK_BOX (vbox2), hseparator10, FALSE, FALSE, 0); gtk_widget_set_size_request (hseparator10, 1, 10); vbox34 = gtk_vbox_new (FALSE, 0); gtk_widget_show (vbox34); gtk_box_pack_start (GTK_BOX (vbox2), vbox34, FALSE, TRUE, 5); label69 = gtk_label_new (_("Choose country")); gtk_widget_show (label69); gtk_box_pack_start (GTK_BOX (vbox34), label69, FALSE, FALSE, 0); gtk_misc_set_alignment (GTK_MISC (label69), 0.05, 0.5); gtk_misc_set_padding (GTK_MISC (label69), 0, 5); hbox44 = gtk_hbox_new (FALSE, 0); gtk_widget_show (hbox44); gtk_box_pack_start (GTK_BOX (vbox34), hbox44, TRUE, TRUE, 0); combo_country = gtk_combo_new (); g_object_set_data (G_OBJECT (GTK_COMBO (combo_country)->popwin), "GladeParentKey", combo_country); gtk_widget_show (combo_country); gtk_box_pack_start (GTK_BOX (hbox44), combo_country, FALSE, TRUE, 0); combo_country_entry = GTK_COMBO (combo_country)->entry; gtk_widget_show (combo_country_entry); vseparator17 = gtk_vseparator_new (); gtk_widget_show (vseparator17); gtk_box_pack_start (GTK_BOX (hbox44), vseparator17, FALSE, FALSE, 0); gtk_widget_set_size_request (vseparator17, 15, 1); button_select_country_file = gtk_button_new (); gtk_widget_show (button_select_country_file); gtk_box_pack_start (GTK_BOX (hbox44), button_select_country_file, TRUE, TRUE, 2); gtk_tooltips_set_tip (tooltips, button_select_country_file, _("Choose a custom country file (see Help)"), NULL); alignment14 = gtk_alignment_new (0.5, 0.5, 0, 0); gtk_widget_show (alignment14); gtk_container_add (GTK_CONTAINER (button_select_country_file), alignment14); hbox45 = gtk_hbox_new (FALSE, 2); gtk_widget_show (hbox45); gtk_container_add (GTK_CONTAINER (alignment14), hbox45); image45 = gtk_image_new_from_stock ("gtk-open", GTK_ICON_SIZE_BUTTON); gtk_widget_show (image45); gtk_box_pack_start (GTK_BOX (hbox45), image45, FALSE, FALSE, 0); label70 = gtk_label_new_with_mnemonic (_("Select a country file")); gtk_widget_show (label70); gtk_box_pack_start (GTK_BOX (hbox45), label70, FALSE, FALSE, 0); hseparator11 = gtk_hseparator_new (); gtk_widget_show (hseparator11); gtk_box_pack_start (GTK_BOX (vbox2), hseparator11, FALSE, FALSE, 0); gtk_widget_set_size_request (hseparator11, 1, 10); label4 = gtk_label_new (_("Start in")); gtk_widget_show (label4); gtk_box_pack_start (GTK_BOX (vbox2), label4, FALSE, FALSE, 0); gtk_misc_set_alignment (GTK_MISC (label4), 0.05, 0.5); eventbox1 = gtk_event_box_new (); gtk_widget_show (eventbox1); gtk_box_pack_start (GTK_BOX (vbox2), eventbox1, FALSE, TRUE, 5); gtk_tooltips_set_tip (tooltips, eventbox1, _("Play normal league games and cups"), NULL); hbox2 = gtk_hbox_new (FALSE, 0); gtk_widget_show (hbox2); gtk_container_add (GTK_CONTAINER (eventbox1), hbox2); team_selection_radio1 = gtk_radio_button_new_with_mnemonic (NULL, _("Top league")); gtk_widget_show (team_selection_radio1); gtk_box_pack_start (GTK_BOX (hbox2), team_selection_radio1, FALSE, FALSE, 0); gtk_container_set_border_width (GTK_CONTAINER (team_selection_radio1), 3); gtk_radio_button_set_group (GTK_RADIO_BUTTON (team_selection_radio1), team_selection_radio1_group); team_selection_radio1_group = gtk_radio_button_get_group (GTK_RADIO_BUTTON (team_selection_radio1)); team_selection_radio2 = gtk_radio_button_new_with_mnemonic (NULL, _("Current league")); gtk_widget_show (team_selection_radio2); gtk_box_pack_start (GTK_BOX (hbox2), team_selection_radio2, FALSE, FALSE, 0); gtk_container_set_border_width (GTK_CONTAINER (team_selection_radio2), 3); gtk_radio_button_set_group (GTK_RADIO_BUTTON (team_selection_radio2), team_selection_radio1_group); team_selection_radio1_group = gtk_radio_button_get_group (GTK_RADIO_BUTTON (team_selection_radio2)); gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (team_selection_radio2), TRUE); team_selection_radio3 = gtk_radio_button_new_with_mnemonic (NULL, _("Bottom league")); gtk_widget_show (team_selection_radio3); gtk_box_pack_start (GTK_BOX (hbox2), team_selection_radio3, FALSE, FALSE, 0); gtk_container_set_border_width (GTK_CONTAINER (team_selection_radio3), 3); gtk_radio_button_set_group (GTK_RADIO_BUTTON (team_selection_radio3), team_selection_radio1_group); team_selection_radio1_group = gtk_radio_button_get_group (GTK_RADIO_BUTTON (team_selection_radio3)); hseparator12 = gtk_hseparator_new (); gtk_widget_show (hseparator12); gtk_box_pack_start (GTK_BOX (vbox2), hseparator12, FALSE, FALSE, 0); gtk_widget_set_size_request (hseparator12, 1, 10); hbox54 = gtk_hbox_new (FALSE, 5); gtk_widget_show (hbox54); gtk_box_pack_start (GTK_BOX (vbox2), hbox54, FALSE, TRUE, 0); label75 = gtk_label_new (_("Player name")); gtk_widget_show (label75); gtk_box_pack_start (GTK_BOX (hbox54), label75, FALSE, FALSE, 0); entry_player_name = gtk_entry_new (); gtk_widget_show (entry_player_name); gtk_box_pack_start (GTK_BOX (hbox54), entry_player_name, TRUE, TRUE, 0); gtk_entry_set_max_length (GTK_ENTRY (entry_player_name), 12); gtk_entry_set_width_chars (GTK_ENTRY (entry_player_name), 12); button_add_player = gtk_button_new (); gtk_widget_show (button_add_player); gtk_box_pack_start (GTK_BOX (hbox54), button_add_player, FALSE, FALSE, 0); alignment19 = gtk_alignment_new (0.5, 0.5, 0, 0); gtk_widget_show (alignment19); gtk_container_add (GTK_CONTAINER (button_add_player), alignment19); hbox55 = gtk_hbox_new (FALSE, 2); gtk_widget_show (hbox55); gtk_container_add (GTK_CONTAINER (alignment19), hbox55); image59 = gtk_image_new_from_stock ("gtk-add", GTK_ICON_SIZE_BUTTON); gtk_widget_show (image59); gtk_box_pack_start (GTK_BOX (hbox55), image59, FALSE, FALSE, 0); label76 = gtk_label_new_with_mnemonic (_("Add player")); gtk_widget_show (label76); gtk_box_pack_start (GTK_BOX (hbox55), label76, FALSE, FALSE, 0); hseparator13 = gtk_hseparator_new (); gtk_widget_show (hseparator13); gtk_box_pack_start (GTK_BOX (vbox2), hseparator13, FALSE, TRUE, 0); gtk_widget_set_size_request (hseparator13, 1, 10); hbox3 = gtk_hbox_new (FALSE, 0); gtk_widget_show (hbox3); gtk_box_pack_start (GTK_BOX (vbox2), hbox3, FALSE, TRUE, 0); team_selection_ok = gtk_button_new (); gtk_widget_show (team_selection_ok); gtk_box_pack_start (GTK_BOX (hbox3), team_selection_ok, TRUE, TRUE, 0); gtk_container_set_border_width (GTK_CONTAINER (team_selection_ok), 2); gtk_widget_set_sensitive (team_selection_ok, FALSE); gtk_tooltips_set_tip (tooltips, team_selection_ok, _("Space"), NULL); gtk_widget_add_accelerator (team_selection_ok, "clicked", accel_group, GDK_space, 0, GTK_ACCEL_VISIBLE); alignment18 = gtk_alignment_new (0.5, 0.5, 0, 0); gtk_widget_show (alignment18); gtk_container_add (GTK_CONTAINER (team_selection_ok), alignment18); hbox53 = gtk_hbox_new (FALSE, 2); gtk_widget_show (hbox53); gtk_container_add (GTK_CONTAINER (alignment18), hbox53); image58 = gtk_image_new_from_stock ("gtk-apply", GTK_ICON_SIZE_BUTTON); gtk_widget_show (image58); gtk_box_pack_start (GTK_BOX (hbox53), image58, FALSE, FALSE, 0); label74 = gtk_label_new_with_mnemonic (_("Start")); gtk_widget_show (label74); gtk_box_pack_start (GTK_BOX (hbox53), label74, FALSE, FALSE, 0); team_selection_cancel = gtk_button_new (); gtk_widget_show (team_selection_cancel); gtk_box_pack_start (GTK_BOX (hbox3), team_selection_cancel, TRUE, TRUE, 0); gtk_container_set_border_width (GTK_CONTAINER (team_selection_cancel), 2); gtk_tooltips_set_tip (tooltips, team_selection_cancel, _("Esc"), NULL); gtk_widget_add_accelerator (team_selection_cancel, "clicked", accel_group, GDK_Escape, 0, GTK_ACCEL_VISIBLE); alignment2 = gtk_alignment_new (0.5, 0.5, 0, 0); gtk_widget_show (alignment2); gtk_container_add (GTK_CONTAINER (team_selection_cancel), alignment2); hbox5 = gtk_hbox_new (FALSE, 2); gtk_widget_show (hbox5); gtk_container_add (GTK_CONTAINER (alignment2), hbox5); image3 = gtk_image_new_from_stock ("gtk-cancel", GTK_ICON_SIZE_BUTTON); gtk_widget_show (image3); gtk_box_pack_start (GTK_BOX (hbox5), image3, FALSE, FALSE, 0); label2 = gtk_label_new_with_mnemonic (_("Cancel")); gtk_widget_show (label2); gtk_box_pack_start (GTK_BOX (hbox5), label2, FALSE, FALSE, 0); team_selection_load = gtk_button_new (); gtk_widget_show (team_selection_load); gtk_box_pack_start (GTK_BOX (hbox3), team_selection_load, TRUE, TRUE, 0); gtk_container_set_border_width (GTK_CONTAINER (team_selection_load), 2); gtk_tooltips_set_tip (tooltips, team_selection_load, _("L"), NULL); gtk_widget_add_accelerator (team_selection_load, "clicked", accel_group, GDK_l, 0, GTK_ACCEL_VISIBLE); alignment3 = gtk_alignment_new (0.5, 0.5, 0, 0); gtk_widget_show (alignment3); gtk_container_add (GTK_CONTAINER (team_selection_load), alignment3); hbox6 = gtk_hbox_new (FALSE, 2); gtk_widget_show (hbox6); gtk_container_add (GTK_CONTAINER (alignment3), hbox6); image4 = gtk_image_new_from_stock ("gtk-open", GTK_ICON_SIZE_BUTTON); gtk_widget_show (image4); gtk_box_pack_start (GTK_BOX (hbox6), image4, FALSE, FALSE, 0); label5 = gtk_label_new_with_mnemonic (_("Load game")); gtk_widget_show (label5); gtk_box_pack_start (GTK_BOX (hbox6), label5, FALSE, FALSE, 0); g_signal_connect ((gpointer) window_startup, "delete_event", G_CALLBACK (on_team_selection_cancel_clicked), NULL); g_signal_connect ((gpointer) treeview_startup, "row_activated", G_CALLBACK (on_team_selection_tv_row_activated), NULL); g_signal_connect ((gpointer) combo_country_entry, "changed", G_CALLBACK (on_combo_country_entry_changed), NULL); g_signal_connect ((gpointer) button_select_country_file, "clicked", G_CALLBACK (on_button_select_country_file_clicked), NULL); g_signal_connect ((gpointer) entry_player_name, "activate", G_CALLBACK (on_entry_player_name_activate), NULL); g_signal_connect ((gpointer) button_add_player, "clicked", G_CALLBACK (on_button_add_player_clicked), NULL); g_signal_connect ((gpointer) team_selection_ok, "clicked", G_CALLBACK (on_team_selection_ok_clicked), NULL); g_signal_connect ((gpointer) team_selection_cancel, "clicked", G_CALLBACK (on_team_selection_cancel_clicked), NULL); g_signal_connect ((gpointer) team_selection_load, "clicked", G_CALLBACK (on_team_selection_load_clicked), NULL); /* Store pointers to all widgets, for use by lookup_widget(). */ GLADE_HOOKUP_OBJECT_NO_REF (window_startup, window_startup, "window_startup"); GLADE_HOOKUP_OBJECT (window_startup, vbox2, "vbox2"); GLADE_HOOKUP_OBJECT (window_startup, scrolledwindow1, "scrolledwindow1"); GLADE_HOOKUP_OBJECT (window_startup, treeview_startup, "treeview_startup"); GLADE_HOOKUP_OBJECT (window_startup, hseparator10, "hseparator10"); GLADE_HOOKUP_OBJECT (window_startup, vbox34, "vbox34"); GLADE_HOOKUP_OBJECT (window_startup, label69, "label69"); GLADE_HOOKUP_OBJECT (window_startup, hbox44, "hbox44"); GLADE_HOOKUP_OBJECT (window_startup, combo_country, "combo_country"); GLADE_HOOKUP_OBJECT (window_startup, combo_country_entry, "combo_country_entry"); GLADE_HOOKUP_OBJECT (window_startup, vseparator17, "vseparator17"); GLADE_HOOKUP_OBJECT (window_startup, button_select_country_file, "button_select_country_file"); GLADE_HOOKUP_OBJECT (window_startup, alignment14, "alignment14"); GLADE_HOOKUP_OBJECT (window_startup, hbox45, "hbox45"); GLADE_HOOKUP_OBJECT (window_startup, image45, "image45"); GLADE_HOOKUP_OBJECT (window_startup, label70, "label70"); GLADE_HOOKUP_OBJECT (window_startup, hseparator11, "hseparator11"); GLADE_HOOKUP_OBJECT (window_startup, label4, "label4"); GLADE_HOOKUP_OBJECT (window_startup, eventbox1, "eventbox1"); GLADE_HOOKUP_OBJECT (window_startup, hbox2, "hbox2"); GLADE_HOOKUP_OBJECT (window_startup, team_selection_radio1, "team_selection_radio1"); GLADE_HOOKUP_OBJECT (window_startup, team_selection_radio2, "team_selection_radio2"); GLADE_HOOKUP_OBJECT (window_startup, team_selection_radio3, "team_selection_radio3"); GLADE_HOOKUP_OBJECT (window_startup, hseparator12, "hseparator12"); GLADE_HOOKUP_OBJECT (window_startup, hbox54, "hbox54"); GLADE_HOOKUP_OBJECT (window_startup, label75, "label75"); GLADE_HOOKUP_OBJECT (window_startup, entry_player_name, "entry_player_name"); GLADE_HOOKUP_OBJECT (window_startup, button_add_player, "button_add_player"); GLADE_HOOKUP_OBJECT (window_startup, alignment19, "alignment19"); GLADE_HOOKUP_OBJECT (window_startup, hbox55, "hbox55"); GLADE_HOOKUP_OBJECT (window_startup, image59, "image59"); GLADE_HOOKUP_OBJECT (window_startup, label76, "label76"); GLADE_HOOKUP_OBJECT (window_startup, hseparator13, "hseparator13"); GLADE_HOOKUP_OBJECT (window_startup, hbox3, "hbox3"); GLADE_HOOKUP_OBJECT (window_startup, team_selection_ok, "team_selection_ok"); GLADE_HOOKUP_OBJECT (window_startup, alignment18, "alignment18"); GLADE_HOOKUP_OBJECT (window_startup, hbox53, "hbox53"); GLADE_HOOKUP_OBJECT (window_startup, image58, "image58"); GLADE_HOOKUP_OBJECT (window_startup, label74, "label74"); GLADE_HOOKUP_OBJECT (window_startup, team_selection_cancel, "team_selection_cancel"); GLADE_HOOKUP_OBJECT (window_startup, alignment2, "alignment2"); GLADE_HOOKUP_OBJECT (window_startup, hbox5, "hbox5"); GLADE_HOOKUP_OBJECT (window_startup, image3, "image3"); GLADE_HOOKUP_OBJECT (window_startup, label2, "label2"); GLADE_HOOKUP_OBJECT (window_startup, team_selection_load, "team_selection_load"); GLADE_HOOKUP_OBJECT (window_startup, alignment3, "alignment3"); GLADE_HOOKUP_OBJECT (window_startup, hbox6, "hbox6"); GLADE_HOOKUP_OBJECT (window_startup, image4, "image4"); GLADE_HOOKUP_OBJECT (window_startup, label5, "label5"); GLADE_HOOKUP_OBJECT_NO_REF (window_startup, tooltips, "tooltips"); gtk_widget_grab_focus (treeview_startup); gtk_window_add_accel_group (GTK_WINDOW (window_startup), accel_group); return window_startup; } GtkWidget* create_fsel_window (void) { GtkWidget *fsel_window; GtkWidget *button_fsel_ok; GtkWidget *button_fsel_cancel; GtkAccelGroup *accel_group; GtkTooltips *tooltips; tooltips = gtk_tooltips_new (); accel_group = gtk_accel_group_new (); fsel_window = gtk_file_selection_new (_("Choose file")); gtk_container_set_border_width (GTK_CONTAINER (fsel_window), 10); gtk_window_set_position (GTK_WINDOW (fsel_window), GTK_WIN_POS_CENTER); gtk_window_set_type_hint (GTK_WINDOW (fsel_window), GDK_WINDOW_TYPE_HINT_DIALOG); button_fsel_ok = GTK_FILE_SELECTION (fsel_window)->ok_button; gtk_widget_show (button_fsel_ok); GTK_WIDGET_SET_FLAGS (button_fsel_ok, GTK_CAN_DEFAULT); gtk_tooltips_set_tip (tooltips, button_fsel_ok, _("Return"), NULL); gtk_widget_add_accelerator (button_fsel_ok, "clicked", accel_group, GDK_Return, 0, GTK_ACCEL_VISIBLE); button_fsel_cancel = GTK_FILE_SELECTION (fsel_window)->cancel_button; gtk_widget_show (button_fsel_cancel); GTK_WIDGET_SET_FLAGS (button_fsel_cancel, GTK_CAN_DEFAULT); gtk_tooltips_set_tip (tooltips, button_fsel_cancel, _("Esc"), NULL); gtk_widget_add_accelerator (button_fsel_cancel, "clicked", accel_group, GDK_Escape, 0, GTK_ACCEL_VISIBLE); g_signal_connect ((gpointer) fsel_window, "delete_event", G_CALLBACK (on_fsel_window_delete_event), NULL); g_signal_connect ((gpointer) button_fsel_ok, "clicked", G_CALLBACK (on_button_fsel_ok_clicked), NULL); g_signal_connect ((gpointer) button_fsel_cancel, "clicked", G_CALLBACK (on_button_fsel_cancel_clicked), NULL); /* Store pointers to all widgets, for use by lookup_widget(). */ GLADE_HOOKUP_OBJECT_NO_REF (fsel_window, fsel_window, "fsel_window"); GLADE_HOOKUP_OBJECT_NO_REF (fsel_window, button_fsel_ok, "button_fsel_ok"); GLADE_HOOKUP_OBJECT_NO_REF (fsel_window, button_fsel_cancel, "button_fsel_cancel"); GLADE_HOOKUP_OBJECT_NO_REF (fsel_window, tooltips, "tooltips"); gtk_window_add_accel_group (GTK_WINDOW (fsel_window), accel_group); return fsel_window; } GtkWidget* create_font_sel_window (void) { GtkWidget *font_sel_window; GtkWidget *button_font_sel_ok; GtkWidget *button_font_sel_cancel; GtkWidget *button_font_sel_apply; GtkWidget *font_sel; font_sel_window = gtk_font_selection_dialog_new (_("Select font")); gtk_container_set_border_width (GTK_CONTAINER (font_sel_window), 6); gtk_window_set_position (GTK_WINDOW (font_sel_window), GTK_WIN_POS_CENTER); gtk_window_set_type_hint (GTK_WINDOW (font_sel_window), GDK_WINDOW_TYPE_HINT_DIALOG); button_font_sel_ok = GTK_FONT_SELECTION_DIALOG (font_sel_window)->ok_button; gtk_widget_show (button_font_sel_ok); GTK_WIDGET_SET_FLAGS (button_font_sel_ok, GTK_CAN_DEFAULT); button_font_sel_cancel = GTK_FONT_SELECTION_DIALOG (font_sel_window)->cancel_button; gtk_widget_show (button_font_sel_cancel); GTK_WIDGET_SET_FLAGS (button_font_sel_cancel, GTK_CAN_DEFAULT); button_font_sel_apply = GTK_FONT_SELECTION_DIALOG (font_sel_window)->apply_button; gtk_widget_show (button_font_sel_apply); GTK_WIDGET_SET_FLAGS (button_font_sel_apply, GTK_CAN_DEFAULT); font_sel = GTK_FONT_SELECTION_DIALOG (font_sel_window)->fontsel; gtk_widget_show (font_sel); gtk_container_set_border_width (GTK_CONTAINER (font_sel), 4); g_signal_connect ((gpointer) font_sel_window, "delete_event", G_CALLBACK (on_button_font_sel_cancel_clicked), NULL); g_signal_connect ((gpointer) button_font_sel_ok, "clicked", G_CALLBACK (on_button_font_sel_ok_clicked), NULL); g_signal_connect ((gpointer) button_font_sel_cancel, "clicked", G_CALLBACK (on_button_font_sel_cancel_clicked), NULL); g_signal_connect ((gpointer) button_font_sel_apply, "clicked", G_CALLBACK (on_button_font_sel_apply_clicked), NULL); /* Store pointers to all widgets, for use by lookup_widget(). */ GLADE_HOOKUP_OBJECT_NO_REF (font_sel_window, font_sel_window, "font_sel_window"); GLADE_HOOKUP_OBJECT_NO_REF (font_sel_window, button_font_sel_ok, "button_font_sel_ok"); GLADE_HOOKUP_OBJECT_NO_REF (font_sel_window, button_font_sel_cancel, "button_font_sel_cancel"); GLADE_HOOKUP_OBJECT_NO_REF (font_sel_window, button_font_sel_apply, "button_font_sel_apply"); GLADE_HOOKUP_OBJECT_NO_REF (font_sel_window, font_sel, "font_sel"); return font_sel_window; } GtkWidget* create_window_live (void) { GtkWidget *window_live; GtkWidget *vbox36; GtkWidget *progressbar_live; GtkWidget *hbox50; GtkWidget *vbox38; GtkWidget *hbox57; GtkWidget *eventbox_poss0; GtkWidget *label78; GtkWidget *scrolledwindow8; GtkWidget *treeview_result; GtkWidget *eventbox_poss1; GtkWidget *label79; GtkWidget *hscale_area; GtkWidget *notebook1; GtkWidget *scrolledwindow9; GtkWidget *treeview_commentary; GtkWidget *label80; GtkWidget *scrolledwindow11; GtkWidget *treeview_stats; GtkWidget *label81; GtkWidget *hbox48; GtkWidget *button_pause; GtkWidget *alignment16; GtkWidget *hbox51; GtkWidget *image56; GtkWidget *label72; GtkWidget *button_resume; GtkWidget *alignment17; GtkWidget *hbox52; GtkWidget *image57; GtkWidget *label73; GtkWidget *button_live_close; GtkObject *spinbutton_speed_adj; GtkWidget *spinbutton_speed; GtkAccelGroup *accel_group; accel_group = gtk_accel_group_new (); window_live = gtk_window_new (GTK_WINDOW_TOPLEVEL); gtk_container_set_border_width (GTK_CONTAINER (window_live), 6); gtk_window_set_title (GTK_WINDOW (window_live), _("Live game")); gtk_window_set_position (GTK_WINDOW (window_live), GTK_WIN_POS_CENTER); gtk_window_set_default_size (GTK_WINDOW (window_live), 450, 550); vbox36 = gtk_vbox_new (FALSE, 0); gtk_widget_show (vbox36); gtk_container_add (GTK_CONTAINER (window_live), vbox36); progressbar_live = gtk_progress_bar_new (); gtk_widget_show (progressbar_live); gtk_box_pack_start (GTK_BOX (vbox36), progressbar_live, FALSE, FALSE, 0); hbox50 = gtk_hbox_new (FALSE, 3); gtk_widget_show (hbox50); gtk_box_pack_start (GTK_BOX (vbox36), hbox50, TRUE, TRUE, 0); vbox38 = gtk_vbox_new (FALSE, 3); gtk_widget_show (vbox38); gtk_box_pack_start (GTK_BOX (hbox50), vbox38, TRUE, TRUE, 0); hbox57 = gtk_hbox_new (FALSE, 0); gtk_widget_show (hbox57); gtk_box_pack_start (GTK_BOX (vbox38), hbox57, FALSE, FALSE, 0); eventbox_poss0 = gtk_event_box_new (); gtk_widget_show (eventbox_poss0); gtk_box_pack_start (GTK_BOX (hbox57), eventbox_poss0, FALSE, TRUE, 0); label78 = gtk_label_new (_(" ")); gtk_widget_show (label78); gtk_container_add (GTK_CONTAINER (eventbox_poss0), label78); scrolledwindow8 = gtk_scrolled_window_new (NULL, NULL); gtk_widget_show (scrolledwindow8); gtk_box_pack_start (GTK_BOX (hbox57), scrolledwindow8, TRUE, TRUE, 0); gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (scrolledwindow8), GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC); gtk_scrolled_window_set_shadow_type (GTK_SCROLLED_WINDOW (scrolledwindow8), GTK_SHADOW_ETCHED_IN); treeview_result = gtk_tree_view_new (); gtk_widget_show (treeview_result); gtk_container_add (GTK_CONTAINER (scrolledwindow8), treeview_result); gtk_tree_view_set_headers_visible (GTK_TREE_VIEW (treeview_result), FALSE); eventbox_poss1 = gtk_event_box_new (); gtk_widget_show (eventbox_poss1); gtk_box_pack_start (GTK_BOX (hbox57), eventbox_poss1, FALSE, TRUE, 0); label79 = gtk_label_new (_(" ")); gtk_widget_show (label79); gtk_container_add (GTK_CONTAINER (eventbox_poss1), label79); hscale_area = gtk_hscale_new (GTK_ADJUSTMENT (gtk_adjustment_new (5, 0, 10, 0, 0, 0))); gtk_widget_show (hscale_area); gtk_box_pack_start (GTK_BOX (vbox38), hscale_area, FALSE, TRUE, 0); gtk_scale_set_draw_value (GTK_SCALE (hscale_area), FALSE); notebook1 = gtk_notebook_new (); gtk_widget_show (notebook1); gtk_box_pack_start (GTK_BOX (vbox38), notebook1, TRUE, TRUE, 0); scrolledwindow9 = gtk_scrolled_window_new (NULL, NULL); gtk_widget_show (scrolledwindow9); gtk_container_add (GTK_CONTAINER (notebook1), scrolledwindow9); gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (scrolledwindow9), GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC); gtk_scrolled_window_set_shadow_type (GTK_SCROLLED_WINDOW (scrolledwindow9), GTK_SHADOW_ETCHED_IN); treeview_commentary = gtk_tree_view_new (); gtk_widget_show (treeview_commentary); gtk_container_add (GTK_CONTAINER (scrolledwindow9), treeview_commentary); label80 = gtk_label_new (_("Commentary")); gtk_widget_show (label80); gtk_notebook_set_tab_label (GTK_NOTEBOOK (notebook1), gtk_notebook_get_nth_page (GTK_NOTEBOOK (notebook1), 0), label80); scrolledwindow11 = gtk_scrolled_window_new (NULL, NULL); gtk_widget_show (scrolledwindow11); gtk_container_add (GTK_CONTAINER (notebook1), scrolledwindow11); gtk_scrolled_window_set_shadow_type (GTK_SCROLLED_WINDOW (scrolledwindow11), GTK_SHADOW_IN); treeview_stats = gtk_tree_view_new (); gtk_widget_show (treeview_stats); gtk_container_add (GTK_CONTAINER (scrolledwindow11), treeview_stats); gtk_tree_view_set_headers_visible (GTK_TREE_VIEW (treeview_stats), FALSE); label81 = gtk_label_new (_("Statistics")); gtk_widget_show (label81); gtk_notebook_set_tab_label (GTK_NOTEBOOK (notebook1), gtk_notebook_get_nth_page (GTK_NOTEBOOK (notebook1), 1), label81); hbox48 = gtk_hbox_new (FALSE, 4); gtk_widget_show (hbox48); gtk_box_pack_start (GTK_BOX (vbox36), hbox48, FALSE, TRUE, 5); button_pause = gtk_button_new (); gtk_widget_show (button_pause); gtk_box_pack_start (GTK_BOX (hbox48), button_pause, FALSE, FALSE, 0); gtk_widget_add_accelerator (button_pause, "clicked", accel_group, GDK_Escape, 0, GTK_ACCEL_VISIBLE); alignment16 = gtk_alignment_new (0.5, 0.5, 0, 0); gtk_widget_show (alignment16); gtk_container_add (GTK_CONTAINER (button_pause), alignment16); hbox51 = gtk_hbox_new (FALSE, 2); gtk_widget_show (hbox51); gtk_container_add (GTK_CONTAINER (alignment16), hbox51); image56 = gtk_image_new_from_stock ("gtk-no", GTK_ICON_SIZE_BUTTON); gtk_widget_show (image56); gtk_box_pack_start (GTK_BOX (hbox51), image56, FALSE, FALSE, 0); label72 = gtk_label_new_with_mnemonic (_("_Pause")); gtk_widget_show (label72); gtk_box_pack_start (GTK_BOX (hbox51), label72, FALSE, FALSE, 0); button_resume = gtk_button_new (); gtk_box_pack_start (GTK_BOX (hbox48), button_resume, FALSE, FALSE, 0); gtk_widget_add_accelerator (button_resume, "clicked", accel_group, GDK_Return, 0, GTK_ACCEL_VISIBLE); alignment17 = gtk_alignment_new (0.5, 0.5, 0, 0); gtk_widget_show (alignment17); gtk_container_add (GTK_CONTAINER (button_resume), alignment17); hbox52 = gtk_hbox_new (FALSE, 2); gtk_widget_show (hbox52); gtk_container_add (GTK_CONTAINER (alignment17), hbox52); image57 = gtk_image_new_from_stock ("gtk-yes", GTK_ICON_SIZE_BUTTON); gtk_widget_show (image57); gtk_box_pack_start (GTK_BOX (hbox52), image57, FALSE, FALSE, 0); label73 = gtk_label_new_with_mnemonic (_("_Resume")); gtk_widget_show (label73); gtk_box_pack_start (GTK_BOX (hbox52), label73, FALSE, FALSE, 0); button_live_close = gtk_button_new_from_stock ("gtk-close"); gtk_widget_show (button_live_close); gtk_box_pack_start (GTK_BOX (hbox48), button_live_close, FALSE, FALSE, 0); gtk_widget_set_sensitive (button_live_close, FALSE); spinbutton_speed_adj = gtk_adjustment_new (0, -10, 20, 1, 10, 10); spinbutton_speed = gtk_spin_button_new (GTK_ADJUSTMENT (spinbutton_speed_adj), 1, 0); gtk_widget_show (spinbutton_speed); gtk_box_pack_end (GTK_BOX (hbox48), spinbutton_speed, FALSE, TRUE, 0); gtk_spin_button_set_numeric (GTK_SPIN_BUTTON (spinbutton_speed), TRUE); g_signal_connect ((gpointer) window_live, "delete_event", G_CALLBACK (on_live_window_delete_event), NULL); g_signal_connect ((gpointer) button_pause, "clicked", G_CALLBACK (on_button_pause_clicked), NULL); g_signal_connect ((gpointer) button_resume, "clicked", G_CALLBACK (on_button_resume_clicked), NULL); g_signal_connect ((gpointer) button_live_close, "clicked", G_CALLBACK (on_button_live_close_clicked), NULL); g_signal_connect ((gpointer) spinbutton_speed, "value_changed", G_CALLBACK (on_spinbutton_speed_value_changed), NULL); /* Store pointers to all widgets, for use by lookup_widget(). */ GLADE_HOOKUP_OBJECT_NO_REF (window_live, window_live, "window_live"); GLADE_HOOKUP_OBJECT (window_live, vbox36, "vbox36"); GLADE_HOOKUP_OBJECT (window_live, progressbar_live, "progressbar_live"); GLADE_HOOKUP_OBJECT (window_live, hbox50, "hbox50"); GLADE_HOOKUP_OBJECT (window_live, vbox38, "vbox38"); GLADE_HOOKUP_OBJECT (window_live, hbox57, "hbox57"); GLADE_HOOKUP_OBJECT (window_live, eventbox_poss0, "eventbox_poss0"); GLADE_HOOKUP_OBJECT (window_live, label78, "label78"); GLADE_HOOKUP_OBJECT (window_live, scrolledwindow8, "scrolledwindow8"); GLADE_HOOKUP_OBJECT (window_live, treeview_result, "treeview_result"); GLADE_HOOKUP_OBJECT (window_live, eventbox_poss1, "eventbox_poss1"); GLADE_HOOKUP_OBJECT (window_live, label79, "label79"); GLADE_HOOKUP_OBJECT (window_live, hscale_area, "hscale_area"); GLADE_HOOKUP_OBJECT (window_live, notebook1, "notebook1"); GLADE_HOOKUP_OBJECT (window_live, scrolledwindow9, "scrolledwindow9"); GLADE_HOOKUP_OBJECT (window_live, treeview_commentary, "treeview_commentary"); GLADE_HOOKUP_OBJECT (window_live, label80, "label80"); GLADE_HOOKUP_OBJECT (window_live, scrolledwindow11, "scrolledwindow11"); GLADE_HOOKUP_OBJECT (window_live, treeview_stats, "treeview_stats"); GLADE_HOOKUP_OBJECT (window_live, label81, "label81"); GLADE_HOOKUP_OBJECT (window_live, hbox48, "hbox48"); GLADE_HOOKUP_OBJECT (window_live, button_pause, "button_pause"); GLADE_HOOKUP_OBJECT (window_live, alignment16, "alignment16"); GLADE_HOOKUP_OBJECT (window_live, hbox51, "hbox51"); GLADE_HOOKUP_OBJECT (window_live, image56, "image56"); GLADE_HOOKUP_OBJECT (window_live, label72, "label72"); GLADE_HOOKUP_OBJECT (window_live, button_resume, "button_resume"); GLADE_HOOKUP_OBJECT (window_live, alignment17, "alignment17"); GLADE_HOOKUP_OBJECT (window_live, hbox52, "hbox52"); GLADE_HOOKUP_OBJECT (window_live, image57, "image57"); GLADE_HOOKUP_OBJECT (window_live, label73, "label73"); GLADE_HOOKUP_OBJECT (window_live, button_live_close, "button_live_close"); GLADE_HOOKUP_OBJECT (window_live, spinbutton_speed, "spinbutton_speed"); gtk_window_add_accel_group (GTK_WINDOW (window_live), accel_group); return window_live; } GtkWidget* create_help_window (void) { GtkWidget *help_window; GtkWidget *vbox27; GtkWidget *scrolledwindow5; GtkWidget *text_view_help; GtkWidget *button_help_close; GtkWidget *alignment11; GtkWidget *hbox40; GtkWidget *image40; GtkWidget *label59; GtkAccelGroup *accel_group; GtkTooltips *tooltips; tooltips = gtk_tooltips_new (); accel_group = gtk_accel_group_new (); help_window = gtk_window_new (GTK_WINDOW_TOPLEVEL); gtk_container_set_border_width (GTK_CONTAINER (help_window), 6); gtk_window_set_title (GTK_WINDOW (help_window), _("Bygfoot help")); gtk_window_set_position (GTK_WINDOW (help_window), GTK_WIN_POS_CENTER); gtk_window_set_default_size (GTK_WINDOW (help_window), 550, 650); vbox27 = gtk_vbox_new (FALSE, 0); gtk_widget_show (vbox27); gtk_container_add (GTK_CONTAINER (help_window), vbox27); scrolledwindow5 = gtk_scrolled_window_new (NULL, NULL); gtk_widget_show (scrolledwindow5); gtk_box_pack_start (GTK_BOX (vbox27), scrolledwindow5, TRUE, TRUE, 0); gtk_scrolled_window_set_shadow_type (GTK_SCROLLED_WINDOW (scrolledwindow5), GTK_SHADOW_IN); text_view_help = gtk_text_view_new (); gtk_widget_show (text_view_help); gtk_container_add (GTK_CONTAINER (scrolledwindow5), text_view_help); gtk_text_view_set_editable (GTK_TEXT_VIEW (text_view_help), FALSE); gtk_text_view_set_wrap_mode (GTK_TEXT_VIEW (text_view_help), GTK_WRAP_WORD); gtk_text_view_set_indent (GTK_TEXT_VIEW (text_view_help), 5); button_help_close = gtk_button_new (); gtk_widget_show (button_help_close); gtk_box_pack_start (GTK_BOX (vbox27), button_help_close, FALSE, FALSE, 0); gtk_container_set_border_width (GTK_CONTAINER (button_help_close), 2); gtk_tooltips_set_tip (tooltips, button_help_close, _("Esc / Return / Space"), NULL); gtk_widget_add_accelerator (button_help_close, "clicked", accel_group, GDK_Escape, 0, GTK_ACCEL_VISIBLE); gtk_widget_add_accelerator (button_help_close, "clicked", accel_group, GDK_Return, 0, GTK_ACCEL_VISIBLE); gtk_widget_add_accelerator (button_help_close, "clicked", accel_group, GDK_space, 0, GTK_ACCEL_VISIBLE); alignment11 = gtk_alignment_new (0.5, 0.5, 0, 0); gtk_widget_show (alignment11); gtk_container_add (GTK_CONTAINER (button_help_close), alignment11); hbox40 = gtk_hbox_new (FALSE, 2); gtk_widget_show (hbox40); gtk_container_add (GTK_CONTAINER (alignment11), hbox40); image40 = gtk_image_new_from_stock ("gtk-close", GTK_ICON_SIZE_BUTTON); gtk_widget_show (image40); gtk_box_pack_start (GTK_BOX (hbox40), image40, FALSE, FALSE, 0); label59 = gtk_label_new_with_mnemonic (_("Close")); gtk_widget_show (label59); gtk_box_pack_start (GTK_BOX (hbox40), label59, FALSE, FALSE, 0); g_signal_connect ((gpointer) button_help_close, "clicked", G_CALLBACK (on_button_help_close_clicked), NULL); /* Store pointers to all widgets, for use by lookup_widget(). */ GLADE_HOOKUP_OBJECT_NO_REF (help_window, help_window, "help_window"); GLADE_HOOKUP_OBJECT (help_window, vbox27, "vbox27"); GLADE_HOOKUP_OBJECT (help_window, scrolledwindow5, "scrolledwindow5"); GLADE_HOOKUP_OBJECT (help_window, text_view_help, "text_view_help"); GLADE_HOOKUP_OBJECT (help_window, button_help_close, "button_help_close"); GLADE_HOOKUP_OBJECT (help_window, alignment11, "alignment11"); GLADE_HOOKUP_OBJECT (help_window, hbox40, "hbox40"); GLADE_HOOKUP_OBJECT (help_window, image40, "image40"); GLADE_HOOKUP_OBJECT (help_window, label59, "label59"); GLADE_HOOKUP_OBJECT_NO_REF (help_window, tooltips, "tooltips"); gtk_window_add_accel_group (GTK_WINDOW (help_window), accel_group); return help_window; } GtkWidget* create_window_startup_users (void) { GtkWidget *window_startup_users; GtkWidget *scrolledwindow10; GtkWidget *treeview_users; GtkTooltips *tooltips; tooltips = gtk_tooltips_new (); window_startup_users = gtk_window_new (GTK_WINDOW_TOPLEVEL); gtk_window_set_title (GTK_WINDOW (window_startup_users), _("Players")); gtk_window_set_default_size (GTK_WINDOW (window_startup_users), 250, 200); gtk_window_set_gravity (GTK_WINDOW (window_startup_users), GDK_GRAVITY_NORTH_EAST); scrolledwindow10 = gtk_scrolled_window_new (NULL, NULL); gtk_widget_show (scrolledwindow10); gtk_container_add (GTK_CONTAINER (window_startup_users), scrolledwindow10); treeview_users = gtk_tree_view_new (); gtk_widget_show (treeview_users); gtk_container_add (GTK_CONTAINER (scrolledwindow10), treeview_users); gtk_tooltips_set_tip (tooltips, treeview_users, _("Click on a player to remove him"), NULL); g_signal_connect ((gpointer) treeview_users, "button_press_event", G_CALLBACK (on_treeview_users_button_press_event), NULL); /* Store pointers to all widgets, for use by lookup_widget(). */ GLADE_HOOKUP_OBJECT_NO_REF (window_startup_users, window_startup_users, "window_startup_users"); GLADE_HOOKUP_OBJECT (window_startup_users, scrolledwindow10, "scrolledwindow10"); GLADE_HOOKUP_OBJECT (window_startup_users, treeview_users, "treeview_users"); GLADE_HOOKUP_OBJECT_NO_REF (window_startup_users, tooltips, "tooltips"); return window_startup_users; }