void _HYConsoleWindow::_SetMenuBar(void) { if (menu_items && !gtk_item_factory_get_item(menu_items,"<HY_WINDOW>/Analysis")) { gtk_item_factory_delete_item (menu_items, "<HY_WINDOW>/File/Open"); gtk_item_factory_delete_item (menu_items, "<HY_WINDOW>/File/Close"); gtk_item_factory_delete_item (menu_items, "<HY_WINDOW>/File/Switch to console"); gtk_item_factory_create_items (menu_items, sizeof (hyphy_console_window_menu_file) / sizeof (hyphy_console_window_menu_file[0]), hyphy_console_window_menu_file, this); GtkMenu * fileMenu = GTK_MENU (gtk_item_factory_get_widget (menu_items, "<HY_WINDOW>/File")); gtk_menu_reorder_child (fileMenu, gtk_item_factory_get_item (menu_items, "<HY_WINDOW>/File/New"), 0); gtk_menu_reorder_child (fileMenu, gtk_item_factory_get_item (menu_items, "<HY_WINDOW>/File/Open"), 1); gtk_menu_reorder_child (fileMenu, gtk_item_factory_get_item (menu_items, "<HY_WINDOW>/File/sep1"), 2); gtk_widget_set_sensitive(gtk_item_factory_get_widget (menu_items,"<HY_WINDOW>/Edit/Clear"), true); gtk_widget_set_sensitive(gtk_item_factory_get_widget (menu_items,"<HY_WINDOW>/Edit/Select All"), true); gtk_widget_set_sensitive(gtk_item_factory_get_widget_by_action(menu_items,21), false); gtk_widget_set_sensitive(gtk_item_factory_get_widget_by_action(menu_items,22), false); gtk_widget_set_sensitive(gtk_item_factory_get_item (menu_items,"<HY_WINDOW>/Analysis/Results"), false); gtk_widget_set_sensitive(gtk_item_factory_get_widget_by_action(menu_items,30), false); for (long counter=0; counter<availablePostProcessors.countitems(); counter++) { _String * postItem = (_String*)(*(_List*)availablePostProcessors(counter))(0); if (!postItem->Equal (&menuSeparator)) { postItem = (_String*)(*(_List*)availablePostProcessors(counter))(1); _String tryFileName (*postItem); FILE * tryFile = doFileOpen (tryFileName.getStr(), "r"); if (tryFile) { fclose(tryFile); } else { availablePostProcessors.Delete(counter); counter--; } } } if (availablePostProcessors.lLength) { long sepCount = 0; for (long counter=0; counter<availablePostProcessors.countitems(); counter++) { _String * postItem = (_String*)(*(_List*)availablePostProcessors(counter))(0), chopped = _String("/Analysis/Results/")&*postItem; if (postItem->Equal (&menuSeparator)) { GtkItemFactoryEntry aProcEntry = {NULL,NULL,NULL,0,"<Separator>"}; chopped = chopped & sepCount++; aProcEntry.path = chopped.sData; gtk_item_factory_create_items (menu_items, 1, &aProcEntry, this); } else { GtkItemFactoryEntry aProcEntry = {NULL,NULL,hyphy_menu_item_callback,1000+counter,"<Item>"}; aProcEntry.path = chopped.sData; gtk_item_factory_create_items (menu_items, 1, &aProcEntry, this); } } } } }
void _HYModelWindow::_SetMenuBar(void) { if (menu_items && !gtk_item_factory_get_item(menu_items,"<HY_WINDOW>/Model")) { gtk_item_factory_delete_item (menu_items, "<HY_WINDOW>/File/Save"); gtk_item_factory_create_items (menu_items, sizeof (hyphy_parameter_model_window_menu) / sizeof (hyphy_parameter_model_window_menu[0]), hyphy_parameter_model_window_menu, this); GtkMenu * fileMenu = GTK_MENU (gtk_item_factory_get_widget (menu_items, "<HY_WINDOW>/File")); gtk_menu_reorder_child (fileMenu, gtk_item_factory_get_item (menu_items, "<HY_WINDOW>/File/Save"), 0); for (long k=0; k<rateOptions.lLength; k++) { _String *thisItem = (_String*)rateOptions (k), chopped, type = "<CheckItem>"; GtkItemFactoryEntry aProcEntry = {NULL,NULL,(GtkItemFactoryCallback)hyphy_menu_item_callback,HY_MDL_WIN32_MENU_BASE+100+k,type.sData}; chopped = _String("/Model/Rate variation/")&*thisItem; aProcEntry.path = chopped.sData; gtk_item_factory_create_items (menu_items, 1, &aProcEntry, this); } gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(gtk_item_factory_get_widget_by_action(menu_items,HY_MDL_WIN32_MENU_BASE+100+rateChoice)), true); gtk_widget_set_sensitive(gtk_item_factory_get_widget (menu_items,"<HY_WINDOW>/Edit/Copy"), true); gtk_widget_set_sensitive(gtk_item_factory_get_widget (menu_items,"<HY_WINDOW>/Edit/Select All"), true); } }
/****************************************************************************** * gtk_ItemFactoryDeleteItem( itemFactory, spath ) --> NIL ******************************************************************************/ int clip_GTK_ITEMFACTORYDELETEITEM(ClipMachine * cm) { C_object *citem = _fetch_co_arg(cm); const gchar *path = _clip_parc(cm, 2); CHECKARG(1, MAP_t); CHECKCOBJ(citem, GTK_IS_ITEM_FACTORY(citem->object)); CHECKARG(2, CHARACTER_t); gtk_item_factory_delete_item(GTK_ITEM_FACTORY(citem->object), path ); return 0; err: return 1; }
bool _HYConsoleWindow::_ProcessMenuSelection (long msel) { switch (msel) { case HY_WINDOW_MENU_ID_FILE+1: SaveConsole (); return true; case 14: _DoPrint (); return true; case 16: ((_HYTextBox*)GetObject(0))->_DoUndo(true); return true; case 17: ((_HYTextBox*)GetObject(0))->_DoCut(true); return true; case 18: ((_HYTextBox*)GetObject(0))->_DoCopy(true); return true; case HY_WINDOW_MENU_ID_EDIT+5: ((_HYTextBox*)GetObject(0))->_DoSelectAll(true); return true; case 21: SetStatusLine ("Canceling"); terminateExecution = true; return true; case 22: { GtkWidget * suspendItem = gtk_item_factory_get_widget_by_action(menu_items,22); if (!isSuspended) { isSuspended = true; SetStatusLine (empty,empty,empty,-1,HY_SL_SUSPEND); gtk_label_set_text (GTK_LABEL (gtk_bin_get_child(GTK_BIN(suspendItem))), "Resume"); updateTimer = false; while (isSuspended) { gtk_main_iteration_do(true); } } else { isSuspended = false; SetStatusLine (empty,empty,empty,-1,HY_SL_RESUME); gtk_label_set_text (GTK_LABEL (gtk_bin_get_child(GTK_BIN(suspendItem))), "Suspend execution"); timerStart += clock()-lastTimer; updateTimer = true; } return true; } case 23: ShowMessagesLog(); return true; case 24: RunStandardAnalyses(); return true; case 25: displayAbout(false); return true; case HY_WINDOW_MENU_ID_EDIT+4: ((_HYTextBox*)GetObject(0))->_DoClear (true,true); return true; case 27: HandlePreferences (globalPreferencesList,"HYPHY Preferences"); return true; case 29: //WinExec ("hh HYPHY HELP.chm",SW_SHOWNORMAL); return true; case 30: if (OpenBatchFile (false)) { ExecuteBatchFile(); PopFilePath(); } return true; case 31: ((_HYTextBox*)GetObject(0))->_DoRedo(true); return true; case 15: postWindowCloseEvent (GetID()); gtk_main_quit (); return true; case 60: // expression calculator if (calculatorMode) { _HYTextBox *ib = (_HYTextBox*)hyphyConsoleWindow->GetObject(1); ib->SetText ("exit"); hyphyConsoleWindow->ProcessEvent (generateTextEditChangeEvent(ib->GetID(),2)); calculatorMode = false; //ib->SetText (empty); } else { calculatorMode = true; while(calculatorMode&&ExpressionCalculator()) {} calculatorMode = false; } return true; case 61: { // execute selection ExecuteSelection(); return true; } case 70: // New Tree NewTreeWindow(-1); return true; case 71: // New Model NewModel(nil); return true; case 72: // New Chart NewChartWindow(); return true; case 73: // New Genetic Code NewGeneticCodeTable(0); return true; case 74: // New Database NewDatabaseFile(0); return true; case 80: // Open Batch File if (OpenBatchFile()) { ExecuteBatchFile (); } return true; case 81: // Open Data File OpenDataFile(); return true; case 82: // Open Tree OpenTreeFile(); return true; case 83: // Open Text OpenTextFile(); return true; case 84: // Open Table OpenTable (); return true; case 85: // Open SQLite database OpenDatabaseFile (nil); return true; case HY_WINDOW_MENU_ID_FILE-2: ShowObjectInspector (); return true; default: { msel -= 1000; if (msel<availablePostProcessors.lLength) { ExecuteAPostProcessor (*(_String*)(*(_List*)availablePostProcessors(msel))(1)); return 0; } msel-=1000; if (msel<(long)recentPaths.lLength) { if (msel == -1) { for (long mi=0; mi<recentFiles.lLength; mi++) { GtkWidget * recFile = gtk_item_factory_get_widget_by_action(hyphyConsoleWindow->menu_items,2000+mi); if (recFile) { gtk_item_factory_delete_item(hyphyConsoleWindow->menu_items,gtk_item_factory_path_from_widget(recFile)); } } recentPaths.Clear(); recentFiles.Clear(); } else { if (argFileName) { *argFileName = *(_String*)recentPaths(msel); } else { argFileName = new _String (*(_String*)recentPaths(msel)); } if (OpenBatchFile(false)) { ExecuteBatchFile (); } } return true; } return true; } } return _HYTWindow::_ProcessMenuSelection(msel); }
static VALUE ifact_delete_item(VALUE self, VALUE path) { gtk_item_factory_delete_item(_SELF(self), RVAL2CSTR(path)); return self; }
void gui_init () { GtkWidget *hbox = NULL, *vbox = NULL, *vbox1 = NULL, *frame = NULL; GtkWidget *separator; GtkAccelGroup *ag; GtkItemFactoryEntry game_items [num_games+1]; GtkItemFactoryEntry items[] = { #if GTK_MAJOR_VERSION == 1 /* { "/_File", NULL, NULL, 0, "<Branch>" }, { "/File/_Load game", "<control>L", menu_load_file_dialog, 0, "" }, { "/File/_Save game", NULL, NULL, 0, "" }, { "/File/_Quit", "<control>Q", (GtkSignalFunc) ui_cleanup, 0, "" }, */ { "/_Game", NULL, NULL, 0, "<Branch>" }, { "/Game/Select _Game", NULL, NULL, 0, "<LastBranch>" }, { "/Game/_Levels", NULL, NULL, 0, "<Branch>"}, { "/Game/Sep1", NULL, NULL, 0, "<Separator>" }, { "/Game/_New", "<control>N", menu_start_stop_game, MENU_RESET_GAME, "" }, { "/Game/_Start", "<control>G", menu_start_stop_game, MENU_START_GAME, "" }, { "/Game/_Pause", "<control>P", menu_start_stop_game, MENU_STOP_GAME, "" }, { "/Game/Sep2", NULL, NULL, 0, "<Separator>" }, { "/Game/_Highscores", NULL, prefs_show_scores, 0, ""}, { "/Game/_Zap Highscores", NULL, prefs_zap_highscores, 0, ""}, { "/Game/Sep3", NULL, NULL, 0, "<Separator>" }, { "/Game/_Quit", "<control>Q", (GtkSignalFunc) ui_cleanup, 0, "" }, { "/_Move", NULL, NULL, 0, "<Branch>" }, { "/Move/_Back", "<control>B", menu_back_forw, MENU_BACK, "" }, { "/Move/_Forward", "<control>F", menu_back_forw, MENU_FORW, "" }, { "/Move/Sep1", NULL, NULL, 0, "<Separator>" }, { "/Move/_Move Now", "<control>M", (GtkItemFactoryCallback) ui_move_now_cb, 0, "" }, #else /* { "/_File", NULL, NULL, 0, "<Branch>" }, { "/File/_Load game", "<control>L", menu_load_file_dialog, 0, "<StockItem>", GTK_STOCK_OPEN }, { "/File/_Save game", NULL, menu_save_file_dialog, 0, "<StockItem>", GTK_STOCK_SAVE }, { "/File/_Quit", "<control>Q", (GtkSignalFunc) ui_cleanup, 0, "<StockItem>", GTK_STOCK_QUIT }, */ { "/_Game", NULL, NULL, 0, "<Branch>" }, { "/Game/Select _Game", NULL, NULL, 0, "<LastBranch>" }, { "/Game/Levels", NULL, NULL, 0, "<Branch>"}, { "/Game/Sep1", NULL, NULL, 0, "<Separator>" }, { "/Game/_New", "<control>N", menu_start_stop_game, MENU_RESET_GAME, "<StockItem>", GTK_STOCK_NEW }, { "/Game/_Start", "<control>G", menu_start_stop_game, MENU_START_GAME, "<StockItem>", GTK_STOCK_YES }, { "/Game/_Pause", "<control>P", menu_start_stop_game, MENU_STOP_GAME, "<StockItem>", GTK_STOCK_STOP }, { "/Game/Sep2", NULL, NULL, 0, "<Separator>" }, //FIXME: there's a scores stock item but I can't seem to find it { "/Game/_Highscores", NULL, prefs_show_scores, 0, ""}, { "/Game/_Zap Highscores", NULL, prefs_zap_highscores, 0, ""}, { "/Game/Sep3", NULL, NULL, 0, "<Separator>" }, { "/Game/_Quit", "<control>Q", (GtkSignalFunc) ui_cleanup, 0, "<StockItem>", GTK_STOCK_QUIT }, { "/_Move", NULL, NULL, 0, "<Branch>" }, { "/Move/_Back", "<control>B", menu_back_forw, 1, "<StockItem>", GTK_STOCK_GO_BACK }, { "/Move/_Forward", "<control>F", menu_back_forw, 2, "<StockItem>", GTK_STOCK_GO_FORWARD }, { "/Move/Sep1", NULL, NULL, 0, "<Separator>" }, { "/Move/_Move Now", "<control>M", (GtkItemFactoryCallback) ui_move_now_cb, 0, "" }, #endif { "/_Settings", NULL, NULL, 0, "<Branch>" }, { "/Settings/_Player", NULL, NULL, 0, "<Branch>" }, { "/Settings/Player/File", NULL, NULL, 0, "<RadioItem>" }, { "/Settings/Player/Human-Human", NULL, menu_set_player, 1, "/Settings/Player/File" }, { "/Settings/Player/Human-Machine", NULL, menu_set_player, 2, "/Settings/Player/File" }, { "/Settings/Player/Machine-Human", NULL, menu_set_player, 3, "/Settings/Player/File" }, { "/Settings/Player/Machine-Machine", NULL, menu_set_player, 4, "/Settings/Player/File" }, // { "/Settings/_Eval function", NULL, NULL, 0, "<Branch>" }, // { "/Settings/_Eval function/_White", NULL, NULL, 0, "<Branch>" }, // { "/Settings/_Eval function/_Black", NULL, NULL, 0, "<Branch>" }, { "/Settings/_Flip Board", "<control>T", menu_board_flip_cb, 0, "" }, { "/Settings/_Enable Sound", NULL, menu_enable_sound_cb, 1, ""}, { "/Settings/_Disable Sound", NULL, menu_enable_sound_cb, 0, ""}, { "/Settings/_Time per move", NULL, NULL, 0, "<Branch>" }, { "/Settings/_Time per move/Default", NULL, menu_set_delay_cb, DEF_TIME_PER_MOVE, "<RadioItem>" }, { "/Settings/_Time per move/100 milliseconds", NULL, menu_set_delay_cb, 100, "/Settings/Time per move/Default" }, { "/Settings/Time per move/200 milliseconds", NULL, menu_set_delay_cb, 200, "/Settings/Time per move/Default" }, { "/Settings/Time per move/500 milliseconds", NULL, menu_set_delay_cb, 500, "/Settings/Time per move/Default" }, { "/Settings/Time per move/1 second", NULL, menu_set_delay_cb, 1000, "/Settings/Time per move/Default" }, { "/Settings/Time per move/2 seconds", NULL, menu_set_delay_cb, 2000, "/Settings/Time per move/Default" }, { "/Settings/Time per move/5 seconds", NULL, menu_set_delay_cb, 5000, "/Settings/Time per move/Default" }, { "/Settings/Time per move/10 seconds", NULL, menu_set_delay_cb, 10000, "/Settings/Time per move/Default" }, { "/Settings/Time per move/30 seconds", NULL, menu_set_delay_cb, 30000, "/Settings/Time per move/Default" }, { "/Settings/Time per move/1 minute", NULL, menu_set_delay_cb, 600000, "/Settings/Time per move/Default" }, { "/_Help", NULL, NULL, 0, "<Branch>" }, { "/Help/_About", NULL, menu_show_about_dialog, 0, ""}, #ifdef HAVE_GNOME { "/Help/_Home Page", NULL, menu_help_home_page, 0, "<StockItem>", GTK_STOCK_HOME}, #endif // TODO: implement context help // { "/Help/_Context help", NULL, ui_set_context_help, 0, ""}, }; int i; gdk_rgb_init (); main_window = gtk_window_new (GTK_WINDOW_TOPLEVEL); gtk_window_set_policy (GTK_WINDOW (main_window), FALSE, FALSE, TRUE); gtk_signal_connect (GTK_OBJECT (main_window), "delete_event", GTK_SIGNAL_FUNC(ui_cleanup), NULL); gtk_window_set_title (GTK_WINDOW (main_window), "Gtkboard"); ag = gtk_accel_group_new(); menu_factory = gtk_item_factory_new (GTK_TYPE_MENU_BAR, "<main>", ag); gtk_window_add_accel_group (GTK_WINDOW (main_window), ag); gtk_item_factory_create_items (menu_factory, sizeof (items) / sizeof (items[0]), items, NULL); for (i=0; i<=num_games; i++) { if (i==0) game_items[i].path = "/Game/Select Game/none"; else { if (games[i-1]->group) { GtkItemFactoryEntry group_item = {NULL, NULL, NULL, 0, "<Branch>"}; group_item.path = g_strdup_printf ("/Game/Select Game/%s", games[i-1]->group); // FIXME: this is O(N^2) where N is the number of games if (gtk_item_factory_get_widget (menu_factory, group_item.path) == NULL) gtk_item_factory_create_item (menu_factory, &group_item, NULL, 1); game_items[i].path = g_strdup_printf ("/Game/Select Game/%s/%s", games[i-1]->group ? games[i-1]->group : "", games[i-1]->name); } else game_items[i].path = g_strdup_printf ("/Game/Select Game/%s", games[i-1]->name); } game_items[i].accelerator = NULL; game_items[i].callback = menu_set_game; game_items[i].callback_action = i-1; game_items[i].item_type = (i == 0 ? "<RadioItem>": "/Game/Select Game/none"); } gtk_item_factory_create_items (menu_factory, num_games+1, game_items, NULL); // ugly hack to create a group of radio button with no button selected by default gtk_item_factory_delete_item (menu_factory, "/Game/Select Game/none"); menu_main = gtk_item_factory_get_widget (menu_factory, "<main>"); gtk_widget_set_state (gtk_item_factory_get_widget (menu_factory, "/Settings/Player/File"), GTK_STATE_INSENSITIVE); for (i=1; i<=NUM_RECENT_GAMES; i++) { gchar *tmp; gchar *gamename; gamename = prefs_get_config_val (tmp = g_strdup_printf ("recent_game_%d", i)); g_free (tmp); if (gamename && gamename[0] != '\0') menu_insert_game_item (gamename, i); } menu_set_eval_function (); vbox = gtk_vbox_new (FALSE, 0); gtk_box_pack_start (GTK_BOX(vbox), menu_main, FALSE, FALSE, 0); frame = gtk_frame_new (NULL); gtk_frame_set_shadow_type (GTK_FRAME (frame), GTK_SHADOW_NONE); { GtkWidget *innerframe; board_colbox = gtk_vbox_new (FALSE, 0); board_area = gtk_drawing_area_new (); hbox = gtk_hbox_new (FALSE, 0); gtk_box_pack_start (GTK_BOX (hbox), board_colbox, FALSE, FALSE, 0); vbox1 = gtk_vbox_new (FALSE, 0); board_rowbox = gtk_hbox_new (FALSE, 0); innerframe = gtk_frame_new (NULL); gtk_frame_set_shadow_type (GTK_FRAME (innerframe), GTK_SHADOW_IN); gtk_container_add (GTK_CONTAINER (vbox1), innerframe); gtk_container_add (GTK_CONTAINER (innerframe), board_area); gtk_container_add (GTK_CONTAINER (vbox1), board_rowbox); gtk_box_pack_start (GTK_BOX (hbox), vbox1, TRUE, FALSE, 0); gtk_container_add (GTK_CONTAINER (frame), hbox); gtk_signal_connect (GTK_OBJECT (board_area), "expose_event", GTK_SIGNAL_FUNC (board_redraw), NULL); gtk_widget_set_events(board_area, gtk_widget_get_events (board_area) | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK | GDK_POINTER_MOTION_MASK | GDK_KEY_PRESS_MASK | GDK_KEY_RELEASE_MASK | GDK_LEAVE_NOTIFY_MASK ); gtk_signal_connect (GTK_OBJECT (board_area), "leave_notify_event", GTK_SIGNAL_FUNC (board_signal_handler), NULL); gtk_signal_connect (GTK_OBJECT (board_area), "motion_notify_event", GTK_SIGNAL_FUNC (board_signal_handler), NULL); gtk_signal_connect (GTK_OBJECT (board_area), "button_release_event", GTK_SIGNAL_FUNC (board_signal_handler), NULL); gtk_signal_connect (GTK_OBJECT (board_area), "button_press_event", GTK_SIGNAL_FUNC (board_signal_handler), NULL); gtk_signal_connect (GTK_OBJECT (main_window), "key_press_event", GTK_SIGNAL_FUNC (board_signal_handler), NULL); gtk_signal_connect (GTK_OBJECT (main_window), "key_release_event", GTK_SIGNAL_FUNC (board_signal_handler), NULL); menu_info_bar = hbox = gtk_hbox_new (FALSE, 0); sb_game_label = gtk_label_new (opt_game ? opt_game->name : NULL); gtk_box_pack_start (GTK_BOX (hbox), sb_game_label, FALSE, FALSE, 3); sb_game_separator = gtk_vseparator_new (); gtk_box_pack_start (GTK_BOX (hbox), sb_game_separator, FALSE, FALSE, 0); sb_player_label = gtk_label_new (NULL); gtk_box_pack_start (GTK_BOX (hbox), sb_player_label, FALSE, FALSE, 3); sb_player_separator = gtk_vseparator_new (); gtk_box_pack_start (GTK_BOX (hbox), sb_player_separator, FALSE, FALSE, 0); sb_who_label = gtk_label_new (NULL); gtk_box_pack_start (GTK_BOX (hbox), sb_who_label, FALSE, FALSE, 3); sb_who_separator = gtk_vseparator_new (); gtk_box_pack_start (GTK_BOX (hbox), sb_who_separator, FALSE, FALSE, 0); sb_score_label = gtk_label_new (NULL); gtk_box_pack_start (GTK_BOX (hbox), sb_score_label, FALSE, FALSE, 3); sb_score_separator = gtk_vseparator_new (); gtk_box_pack_start (GTK_BOX (hbox), sb_score_separator, FALSE, FALSE, 0); #if GTK_MAJOR_VERSION == 2 sb_turn_image = gtk_image_new_from_stock (GTK_STOCK_YES, GTK_ICON_SIZE_MENU); gtk_box_pack_end (GTK_BOX (hbox), sb_turn_image, FALSE, FALSE, 0); sb_turn_separator = gtk_vseparator_new (); gtk_box_pack_end (GTK_BOX (hbox), sb_turn_separator, FALSE, FALSE, 0); #endif sb_time_label = gtk_label_new (NULL); gtk_box_pack_end (GTK_BOX (hbox), sb_time_label, FALSE, FALSE, 0); sb_time_separator = gtk_vseparator_new (); gtk_box_pack_end (GTK_BOX (hbox), sb_time_separator, FALSE, FALSE, 0); } menu_info_separator = separator = gtk_hseparator_new (); gtk_box_pack_start (GTK_BOX (vbox), separator, FALSE, FALSE, 0); gtk_box_pack_start (GTK_BOX (vbox), hbox, FALSE, FALSE, 0); separator = gtk_hseparator_new (); gtk_box_pack_start (GTK_BOX (vbox), separator, FALSE, FALSE, 0); menu_warning_bar = gtk_label_new ("Warning: this game has not yet been completely implemented."); gtk_box_pack_start (GTK_BOX (vbox), menu_warning_bar, FALSE, FALSE, 0); sb_warning_separator = separator = gtk_hseparator_new (); gtk_box_pack_start (GTK_BOX (vbox), separator, FALSE, FALSE, 0); gtk_box_pack_start (GTK_BOX (vbox), frame, FALSE, FALSE, 0); separator = gtk_hseparator_new (); gtk_box_pack_start (GTK_BOX (vbox), separator, FALSE, FALSE, 0); sb_message_label = gtk_label_new (NULL); gtk_misc_set_alignment (GTK_MISC (sb_message_label), 0, 0.5); hbox = gtk_hbox_new (TRUE, 0); gtk_box_pack_start (GTK_BOX (hbox), sb_message_label, TRUE, TRUE, 3); gtk_box_pack_start (GTK_BOX (vbox), hbox, FALSE, FALSE, 0); gtk_container_add (GTK_CONTAINER (main_window), vbox); // FIXME: board_init() needs show() to be called to get a gc, but // leads to the whole window not popping up at once gtk_widget_show_all (main_window); if (!opt_game) board_init (); gtk_timeout_add (100, sb_update_periodic, NULL); // this should be called before setting state_gui_active = TRUE if (opt_game) menu_put_game (); state_gui_active = TRUE; if (opt_game) menu_start_game (); menu_put_player (TRUE); // if (!opt_game) sb_message ("Select a game from the Game menu", FALSE); sb_update (); }