X-Git-Url: http://winboard.nl/cgi-bin?a=blobdiff_plain;f=gtk%2Fxoptions.c;h=2c48446d96324c902ce232837a100e5225a9287e;hb=36c7e09704a7ef2229f316e8e70e423d4f0fa93b;hp=6eea01c5c5fcd1e204d249cce56803f2dc05bc5b;hpb=92a2f96e6d5eb2ef50a0a60c64e2bd55e0855ce6;p=xboard.git diff --git a/gtk/xoptions.c b/gtk/xoptions.c index 6eea01c..2c48446 100644 --- a/gtk/xoptions.c +++ b/gtk/xoptions.c @@ -428,6 +428,14 @@ CreateMenuPopup (Option *opt, int n, int def) } else entry = gtk_menu_item_new_with_label(msg); gtk_signal_connect_object (GTK_OBJECT (entry), "activate", GTK_SIGNAL_FUNC(MenuSelect), (gpointer) (intptr_t) ((n<<16)+i)); + if(mb[i].accel) { + guint accelerator_key; + GdkModifierType accelerator_mods; + + gtk_accelerator_parse(mb[i].accel, &accelerator_key, &accelerator_mods); + gtk_widget_add_accelerator (GTK_WIDGET(entry), "activate",GtkAccelerators, + accelerator_key, accelerator_mods, GTK_ACCEL_VISIBLE); + }; gtk_widget_show(entry); } else entry = gtk_separator_menu_item_new(); gtk_menu_append(GTK_MENU (menu), entry); @@ -1124,16 +1132,26 @@ printf("n=%d, h=%d, w=%d\n",n,height,width); XtCreatePopupShell(title, !top || !appData.topLevel ? transientShellWidgetClass : topLevelShellWidgetClass, shells[parent], args, i); #endif - dialog = gtk_dialog_new_with_buttons( title, - GTK_WINDOW(shells[parent]), - GTK_DIALOG_DESTROY_WITH_PARENT | GTK_DIALOG_NO_SEPARATOR | - (modal ? GTK_DIALOG_MODAL : 0), - GTK_STOCK_OK, GTK_RESPONSE_ACCEPT, - GTK_STOCK_CANCEL, GTK_RESPONSE_REJECT, - NULL ); + + if(topLevel) + { + dialog = gtk_window_new(GTK_WINDOW_TOPLEVEL); + box = gtk_vbox_new(FALSE,0); + gtk_container_add (GTK_CONTAINER (dialog), box); + } + else + { + dialog = gtk_dialog_new_with_buttons( title, + GTK_WINDOW(shells[parent]), + GTK_DIALOG_DESTROY_WITH_PARENT | GTK_DIALOG_NO_SEPARATOR | + (modal ? GTK_DIALOG_MODAL : 0), + GTK_STOCK_OK, GTK_RESPONSE_ACCEPT, + GTK_STOCK_CANCEL, GTK_RESPONSE_REJECT, + NULL ); + box = gtk_dialog_get_content_area( GTK_DIALOG( dialog ) ); + } shells[dlgNr] = dialog; - box = gtk_dialog_get_content_area( GTK_DIALOG( dialog ) ); // gtk_box_set_spacing(GTK_BOX(box), 5); arraysize = 0; @@ -1481,17 +1499,19 @@ printf("n=%d, h=%d, w=%d\n",n,height,width); option[i].handle = (void *) table; // remember last table in EndMark handle (for hiding Engine-Output pane). gtk_window_set_position(GTK_WINDOW(dialog), GTK_WIN_POS_NONE); + /* Show dialog */ gtk_widget_show_all( dialog ); /* hide OK/cancel buttons */ - if((option[i].min & NO_OK)) { + if(!topLevel) + if((option[i].min & NO_OK)) { actionarea = gtk_dialog_get_action_area(GTK_DIALOG(dialog)); gtk_widget_hide(actionarea); - } else if((option[i].min & NO_CANCEL)) { + } else if((option[i].min & NO_CANCEL)) { button = gtk_dialog_get_widget_for_response(GTK_DIALOG(dialog), GTK_RESPONSE_REJECT); gtk_widget_hide(button); - } + } g_signal_connect (dialog, "response", G_CALLBACK (GenericPopDown),