本文整理汇总了C++中GTK_BUTTON_BOX函数的典型用法代码示例。如果您正苦于以下问题:C++ GTK_BUTTON_BOX函数的具体用法?C++ GTK_BUTTON_BOX怎么用?C++ GTK_BUTTON_BOX使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了GTK_BUTTON_BOX函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: xkb_layout_choose
void
xkb_layout_choose (GtkBuilder * dialog)
{
GtkBuilder *chooser_dialog;
chooser_dialog = gtk_builder_new ();
gtk_builder_add_from_file (chooser_dialog, MATECC_UI_DIR
"/mate-keyboard-properties-layout-chooser.ui",
NULL);
GtkWidget *chooser = CWID ("xkb_layout_chooser");
GtkWidget *lang_chooser = CWID ("xkb_languages_available");
GtkWidget *notebook = CWID ("choosers_nb");
GtkWidget *kbdraw = NULL;
GtkWidget *toplevel = NULL;
gtk_window_set_transient_for (GTK_WINDOW (chooser),
GTK_WINDOW (WID
("keyboard_dialog")));
xkb_layout_chooser_available_layouts_fill (chooser_dialog,
"xkb_countries_available",
"xkb_country_variants_available",
xkl_config_registry_foreach_country,
(ConfigItemProcessFunc)
xkb_layout_chooser_add_country_to_available_countries,
G_CALLBACK
(xkb_layout_chooser_available_country_changed));
xkb_layout_chooser_available_layouts_fill (chooser_dialog,
"xkb_languages_available",
"xkb_language_variants_available",
xkl_config_registry_foreach_language,
(ConfigItemProcessFunc)
xkb_layout_chooser_add_language_to_available_languages,
G_CALLBACK
(xkb_layout_chooser_available_language_changed));
g_signal_connect_after (G_OBJECT (notebook), "switch_page",
G_CALLBACK
(xkb_layout_chooser_page_changed),
chooser_dialog);
gtk_combo_box_set_active (GTK_COMBO_BOX
(CWID ("xkb_countries_available")),
FALSE);
if (gtk_tree_model_iter_n_children
(gtk_combo_box_get_model (GTK_COMBO_BOX (lang_chooser)),
NULL)) {
gtk_combo_box_set_active (GTK_COMBO_BOX
(CWID
("xkb_languages_available")),
FALSE);
} else {
/* If language info is not available - remove the corresponding tab,
pretend there is no notebook at all */
gtk_notebook_remove_page (GTK_NOTEBOOK (notebook), 1);
gtk_notebook_set_show_tabs (GTK_NOTEBOOK (notebook),
FALSE);
gtk_notebook_set_show_border (GTK_NOTEBOOK (notebook),
FALSE);
}
#ifdef HAVE_X11_EXTENSIONS_XKB_H
if (!strcmp (xkl_engine_get_backend_name (engine), "XKB")) {
kbdraw = xkb_layout_preview_create_widget (chooser_dialog);
g_object_set_data (G_OBJECT (chooser), "kbdraw", kbdraw);
gtk_container_add (GTK_CONTAINER
(CWID ("previewFrame")), kbdraw);
gtk_widget_show_all (kbdraw);
gtk_button_box_set_child_secondary (GTK_BUTTON_BOX
(CWID
("hbtnBox")),
CWID
("btnPrint"), TRUE);
} else
#endif
{
gtk_widget_hide_all (CWID ("vboxPreview"));
gtk_widget_hide (CWID ("btnPrint"));
}
g_signal_connect (G_OBJECT (chooser),
"response",
G_CALLBACK (xkb_layout_chooser_response),
chooser_dialog);
toplevel = gtk_widget_get_toplevel (chooser);
if (gtk_widget_is_toplevel (toplevel)) {
GdkRectangle *rect = matekbd_preview_load_position ();
if (rect != NULL) {
gtk_window_move (GTK_WINDOW (toplevel),
rect->x, rect->y);
gtk_window_resize (GTK_WINDOW (toplevel),
rect->width, rect->height);
g_free (rect);
}
}
xkb_layout_preview_update (chooser_dialog);
gtk_dialog_run (GTK_DIALOG (chooser));
//.........这里部分代码省略.........
示例2: create_FileSelect
//.........这里部分代码省略.........
gtk_widget_realize( fsFileSelect );
gtkAddIcon( fsFileSelect );
style=gtk_widget_get_style( fsFileSelect );
dpixmap=gdk_pixmap_colormap_create_from_xpm_d( fsFileSelect->window,fsColorMap,&dmask,&style->bg[GTK_STATE_NORMAL],(gchar **)dir_xpm );
fpixmap=gdk_pixmap_colormap_create_from_xpm_d( fsFileSelect->window,fsColorMap,&fmask,&style->bg[GTK_STATE_NORMAL],(gchar **)file_xpm );
vbox4=AddVBox( AddDialogFrame( fsFileSelect ),0 );
hbox4=AddHBox( vbox4,1 );
fsCombo4=gtk_combo_new();
gtk_widget_set_name( fsCombo4,"fsCombo4" );
gtk_widget_show( fsCombo4 );
gtk_box_pack_start( GTK_BOX( hbox4 ),fsCombo4,TRUE,TRUE,0 );
gtk_widget_set_usize( fsCombo4,-2,20 );
fsPathCombo=GTK_COMBO( fsCombo4 )->entry;
gtk_widget_set_name( fsPathCombo,"fsPathCombo" );
gtk_widget_show( fsPathCombo );
gtk_widget_set_usize( fsPathCombo,-2,20 );
vseparator1=gtk_vseparator_new();
gtk_widget_set_name( vseparator1,"vseparator1" );
gtk_widget_show( vseparator1 );
gtk_box_pack_start( GTK_BOX( hbox4 ),vseparator1,FALSE,TRUE,0 );
gtk_widget_set_usize( vseparator1,7,20 );
upstyle=gtk_widget_get_style( fsFileSelect );
uppixmap=gdk_pixmap_colormap_create_from_xpm_d( fsFileSelect->window,fsColorMap,&upmask,&upstyle->bg[GTK_STATE_NORMAL],(gchar **)up_xpm );
uppixmapwid=gtk_pixmap_new( uppixmap,upmask );
gtk_widget_show( uppixmapwid );
fsUp=gtk_button_new();
gtk_container_add( GTK_CONTAINER(fsUp ),uppixmapwid );
gtk_widget_show( fsUp );
gtk_box_pack_start( GTK_BOX( hbox4 ),fsUp,FALSE,FALSE,0 );
gtk_widget_set_usize( fsUp,65,15 );
AddHSeparator( vbox4 );
hbox6=AddHBox( NULL,0 );
gtk_box_pack_start( GTK_BOX( vbox4 ),hbox6,TRUE,TRUE,0 );
fsFNameListWindow=gtk_scrolled_window_new( NULL,NULL );
gtk_widget_set_name( fsFNameListWindow,"fsFNameListWindow" );
gtk_widget_show( fsFNameListWindow );
gtk_box_pack_start( GTK_BOX( hbox6 ),fsFNameListWindow,TRUE,TRUE,0 );
gtk_widget_set_usize( fsFNameListWindow,-2,145 );
gtk_scrolled_window_set_policy( GTK_SCROLLED_WINDOW( fsFNameListWindow ),GTK_POLICY_NEVER,GTK_POLICY_AUTOMATIC );
fsFNameList=gtk_clist_new( 2 );
gtk_widget_set_name( fsFNameList,"fsFNameList" );
gtk_container_add( GTK_CONTAINER( fsFNameListWindow ),fsFNameList );
gtk_clist_set_column_width( GTK_CLIST( fsFNameList ),0,80 );
gtk_clist_set_selection_mode( GTK_CLIST( fsFNameList ),GTK_SELECTION_BROWSE );
gtk_clist_column_titles_hide( GTK_CLIST( fsFNameList ) );
gtk_clist_set_shadow_type( GTK_CLIST( fsFNameList ),GTK_SHADOW_ETCHED_OUT );
AddHSeparator( vbox4 );
List=gtk_combo_new();
gtk_widget_set_name( List,"List" );
gtk_widget_ref( List );
gtk_object_set_data_full( GTK_OBJECT( fsFileSelect ),"List",List,(GtkDestroyNotify)gtk_widget_unref );
gtk_widget_show( List );
gtk_box_pack_start( GTK_BOX( vbox4 ),List,FALSE,FALSE,0 );
gtk_widget_set_usize( List,-2,20 );
fsFilterCombo=GTK_COMBO( List )->entry;
gtk_widget_set_name( fsFilterCombo,"fsFilterCombo" );
gtk_widget_show( fsFilterCombo );
gtk_entry_set_editable (GTK_ENTRY( fsFilterCombo ),FALSE );
AddHSeparator( vbox4 );
hbuttonbox3=AddHButtonBox( vbox4 );
gtk_button_box_set_layout( GTK_BUTTON_BOX( hbuttonbox3 ),GTK_BUTTONBOX_END );
gtk_button_box_set_spacing( GTK_BUTTON_BOX( hbuttonbox3 ),10 );
fsOk=AddButton( MSGTR_Ok,hbuttonbox3 );
fsCancel=AddButton( MSGTR_Cancel,hbuttonbox3 );
gtk_signal_connect( GTK_OBJECT( fsFileSelect ),"destroy",GTK_SIGNAL_FUNC( fs_Destroy ), NULL );
gtk_signal_connect( GTK_OBJECT( fsFileSelect ),"key_release_event",GTK_SIGNAL_FUNC( on_FileSelect_key_release_event ),NULL );
gtk_signal_connect( GTK_OBJECT( fsFilterCombo ),"changed",GTK_SIGNAL_FUNC( fs_fsFilterCombo_changed ),fsFilterCombo );
gtk_signal_connect( GTK_OBJECT( fsFilterCombo ),"activate",GTK_SIGNAL_FUNC( fs_fsFilterCombo_activate ),fsFilterCombo );
gtk_signal_connect( GTK_OBJECT( fsPathCombo ),"changed",GTK_SIGNAL_FUNC( fs_fsPathCombo_changed ),fsPathCombo );
gtk_signal_connect( GTK_OBJECT( fsPathCombo ),"activate",GTK_SIGNAL_FUNC( fs_fsPathCombo_activate ),fsPathCombo );
gtk_signal_connect( GTK_OBJECT( fsUp ),"released",GTK_SIGNAL_FUNC( fs_Up_released ),fsFNameList );
gtk_signal_connect( GTK_OBJECT( fsOk ),"released",GTK_SIGNAL_FUNC( fs_Ok_released ),fsCombo4 );
gtk_signal_connect( GTK_OBJECT( fsCancel ),"released",GTK_SIGNAL_FUNC( fs_Cancel_released ),NULL );
gtk_signal_connect( GTK_OBJECT( fsFNameList ),"select_row",(GtkSignalFunc)fs_fsFNameList_select_row,NULL );
gtk_signal_connect( GTK_OBJECT( fsFNameList ),"event", (GtkSignalFunc)fs_fsFNameList_event,NULL );
gtk_widget_grab_focus( fsFNameList );
return fsFileSelect;
}
示例3: exec_msg2clip_menu_cb
static void exec_msg2clip_menu_cb(void)
{
/* show modal dialog */
GtkWidget *window;
GtkWidget *vbox;
GtkWidget *confirm_area;
GtkWidget *ok_btn;
GtkWidget *cancel_btn;
GtkWidget *notebook;
window = gtk_window_new(GTK_WINDOW_TOPLEVEL);
gtk_container_set_border_width(GTK_CONTAINER(window), 8);
gtk_window_position(GTK_WINDOW(window), GTK_WIN_POS_CENTER);
gtk_window_set_modal(GTK_WINDOW(window), TRUE);
gtk_window_set_policy(GTK_WINDOW(window), FALSE, TRUE, FALSE);
gtk_window_set_default_size(GTK_WINDOW(window), 300, 100);
gtk_widget_realize(window);
vbox = gtk_vbox_new(FALSE, 6);
gtk_widget_show(vbox);
gtk_container_add(GTK_CONTAINER(window), vbox);
/* notebook */
notebook = gtk_notebook_new();
/* main tab */
create_config_main_page(notebook, g_opt.rcfile);
/* about, copyright tab */
sylpf_append_config_about_page(notebook,
g_opt.rcfile,
_("About"),
_(PLUGIN_NAME),
_(PLUGIN_DESC),
_(copyright));
gtk_widget_show(notebook);
gtk_box_pack_start(GTK_BOX(vbox), notebook, TRUE, TRUE, 0);
confirm_area = gtk_hbutton_box_new();
gtk_button_box_set_layout(GTK_BUTTON_BOX(confirm_area), GTK_BUTTONBOX_END);
gtk_box_set_spacing(GTK_BOX(confirm_area), 6);
ok_btn = gtk_button_new_from_stock(GTK_STOCK_OK);
GTK_WIDGET_SET_FLAGS(ok_btn, GTK_CAN_DEFAULT);
gtk_box_pack_start(GTK_BOX(confirm_area), ok_btn, FALSE, FALSE, 0);
gtk_widget_show(ok_btn);
cancel_btn = gtk_button_new_from_stock(GTK_STOCK_CANCEL);
GTK_WIDGET_SET_FLAGS(cancel_btn, GTK_CAN_DEFAULT);
gtk_box_pack_start(GTK_BOX(confirm_area), cancel_btn, FALSE, FALSE, 0);
gtk_widget_show(cancel_btn);
gtk_widget_show(confirm_area);
gtk_box_pack_end(GTK_BOX(vbox), confirm_area, FALSE, FALSE, 0);
gtk_widget_grab_default(ok_btn);
gtk_widget_show(vbox);
gtk_window_set_title(GTK_WINDOW(window), _("Msg2Clip Settings"));
g_signal_connect(G_OBJECT(ok_btn), "clicked",
G_CALLBACK(prefs_ok_cb), window);
g_signal_connect(G_OBJECT(cancel_btn), "clicked",
G_CALLBACK(prefs_cancel_cb), window);
gtk_widget_show_all(window);
}
示例4: shortcuts
PrintProjectDialog::PrintProjectDialog(int dummy)
{
extern Settings *settings;
Shortcuts shortcuts(0);
printprojectdialog = gtk_dialog_new();
gtk_window_set_title(GTK_WINDOW(printprojectdialog), _("Print project"));
gtk_window_set_position(GTK_WINDOW(printprojectdialog), GTK_WIN_POS_CENTER_ON_PARENT);
gtk_window_set_modal(GTK_WINDOW(printprojectdialog), TRUE);
gtk_window_set_destroy_with_parent(GTK_WINDOW(printprojectdialog), TRUE);
gtk_window_set_type_hint(GTK_WINDOW(printprojectdialog), GDK_WINDOW_TYPE_HINT_DIALOG);
dialog_vbox1 = gtk_dialog_get_content_area (GTK_DIALOG(printprojectdialog));
gtk_widget_show(dialog_vbox1);
vbox1 = gtk_vbox_new(FALSE, 2);
gtk_widget_show(vbox1);
gtk_box_pack_start(GTK_BOX(dialog_vbox1), vbox1, TRUE, TRUE, 0);
hbox1 = gtk_hbox_new(FALSE, 4);
gtk_widget_show(hbox1);
gtk_box_pack_start(GTK_BOX(vbox1), hbox1, TRUE, TRUE, 0);
label1 = gtk_label_new(_("Portion:"));
gtk_widget_show(label1);
gtk_box_pack_start(GTK_BOX(hbox1), label1, FALSE, FALSE, 0);
label_portion = gtk_label_new("");
gtk_widget_show(label_portion);
gtk_box_pack_start(GTK_BOX(hbox1), label_portion, FALSE, FALSE, 0);
button_portion = gtk_button_new();
gtk_widget_show(button_portion);
gtk_box_pack_start(GTK_BOX(hbox1), button_portion, FALSE, FALSE, 0);
alignment1 = gtk_alignment_new(0.5, 0.5, 0, 0);
gtk_widget_show(alignment1);
gtk_container_add(GTK_CONTAINER(button_portion), alignment1);
hbox2 = gtk_hbox_new(FALSE, 2);
gtk_widget_show(hbox2);
gtk_container_add(GTK_CONTAINER(alignment1), hbox2);
image1 = gtk_image_new_from_stock("gtk-properties", GTK_ICON_SIZE_BUTTON);
gtk_widget_show(image1);
gtk_box_pack_start(GTK_BOX(hbox2), image1, FALSE, FALSE, 0);
label5 = gtk_label_new_with_mnemonic(_("Change"));
gtk_widget_show(label5);
gtk_box_pack_start(GTK_BOX(hbox2), label5, FALSE, FALSE, 0);
shortcuts.label(label5);
bool expand = false;
if (settings->session.print_references_in_notes_in_full) {
expand = true;
}
expander1 = gtk_expander_new(NULL);
gtk_widget_show(expander1);
gtk_box_pack_start(GTK_BOX(vbox1), expander1, TRUE, TRUE, 0);
gtk_expander_set_expanded(GTK_EXPANDER(expander1), expand);
vbox_expander = gtk_vbox_new(FALSE, 5);
gtk_widget_show(vbox_expander);
gtk_container_add(GTK_CONTAINER(expander1), vbox_expander);
checkbutton_full_references = gtk_check_button_new_with_mnemonic(_("Write the references in the notes in full"));
gtk_widget_show(checkbutton_full_references);
gtk_box_pack_start(GTK_BOX(vbox_expander), checkbutton_full_references, FALSE, FALSE, 0);
// TO DO: Add options for 1 column, double spaced here
shortcuts.button(checkbutton_full_references);
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(checkbutton_full_references), settings->session.print_references_in_notes_in_full);
label_expander = gtk_label_new(_("Options"));
gtk_widget_show(label_expander);
gtk_expander_set_label_widget(GTK_EXPANDER(expander1), label_expander);
shortcuts.label(label_expander);
dialog_action_area1 = gtk_dialog_get_action_area (GTK_DIALOG(printprojectdialog));
gtk_widget_show(dialog_action_area1);
gtk_button_box_set_layout(GTK_BUTTON_BOX(dialog_action_area1), GTK_BUTTONBOX_END);
new InDialogHelp(printprojectdialog, NULL, &shortcuts, "file/print/project");
cancelbutton1 = gtk_button_new_from_stock("gtk-cancel");
gtk_widget_show(cancelbutton1);
gtk_dialog_add_action_widget(GTK_DIALOG(printprojectdialog), cancelbutton1, GTK_RESPONSE_CANCEL);
gtk_widget_set_can_default (GTK_WIDGET (cancelbutton1), true);
okbutton1 = gtk_button_new_from_stock("gtk-ok");
gtk_widget_show(okbutton1);
gtk_dialog_add_action_widget(GTK_DIALOG(printprojectdialog), okbutton1, GTK_RESPONSE_OK);
gtk_widget_set_can_default (GTK_WIDGET (okbutton1), true);
//.........这里部分代码省略.........
示例5: create_dialog1
//.........这里部分代码省略.........
gtk_label_set_justify (GTK_LABEL (label1), GTK_JUSTIFY_LEFT);
gtk_misc_set_alignment (GTK_MISC (label1), 0, 0.5);
label2 = gtk_label_new (_("Strength :"));
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);
label3 = gtk_label_new (_("Block Adaptative :"));
gtk_widget_show (label3);
gtk_table_attach (GTK_TABLE (table1), label3, 0, 1, 2, 3,
(GtkAttachOptions) (GTK_FILL),
(GtkAttachOptions) (0), 0, 0);
gtk_label_set_justify (GTK_LABEL (label3), GTK_JUSTIFY_LEFT);
gtk_misc_set_alignment (GTK_MISC (label3), 0, 0.5);
label4 = gtk_label_new (_("Unknown flag :"));
gtk_widget_show (label4);
gtk_table_attach (GTK_TABLE (table1), label4, 0, 1, 3, 4,
(GtkAttachOptions) (GTK_FILL),
(GtkAttachOptions) (0), 0, 0);
gtk_label_set_justify (GTK_LABEL (label4), GTK_JUSTIFY_LEFT);
gtk_misc_set_alignment (GTK_MISC (label4), 0, 0.5);
spinbuttonT_adj = gtk_adjustment_new (1, -1, 100, 0.5, 0.1, 0.1);
spinbuttonT = gtk_spin_button_new (GTK_ADJUSTMENT (spinbuttonT_adj), 1, 1);
gtk_widget_show (spinbuttonT);
gtk_table_attach (GTK_TABLE (table1), spinbuttonT, 1, 2, 0, 1,
(GtkAttachOptions) (GTK_FILL),
(GtkAttachOptions) (0), 0, 0);
gtk_spin_button_set_numeric (GTK_SPIN_BUTTON (spinbuttonT), TRUE);
spinbuttonD_adj = gtk_adjustment_new (1, -1, 100, 0.5, 0.1, 0.1);
spinbuttonD = gtk_spin_button_new (GTK_ADJUSTMENT (spinbuttonD_adj), 1, 1);
gtk_widget_show (spinbuttonD);
gtk_table_attach (GTK_TABLE (table1), spinbuttonD, 1, 2, 1, 2,
(GtkAttachOptions) (GTK_FILL),
(GtkAttachOptions) (0), 0, 0);
gtk_spin_button_set_numeric (GTK_SPIN_BUTTON (spinbuttonD), TRUE);
spinbuttonB_adj = gtk_adjustment_new (1, -1, 100, 0.5, 0.1, 0.1);
spinbuttonB = gtk_spin_button_new (GTK_ADJUSTMENT (spinbuttonB_adj), 1, 1);
gtk_widget_show (spinbuttonB);
gtk_table_attach (GTK_TABLE (table1), spinbuttonB, 1, 2, 2, 3,
(GtkAttachOptions) (GTK_FILL),
(GtkAttachOptions) (0), 0, 0);
gtk_spin_button_set_numeric (GTK_SPIN_BUTTON (spinbuttonB), TRUE);
checkbuttonBF = gtk_check_button_new_with_mnemonic (_(" "));
gtk_widget_show (checkbuttonBF);
gtk_table_attach (GTK_TABLE (table1), checkbuttonBF, 1, 2, 3, 4,
(GtkAttachOptions) (GTK_FILL),
(GtkAttachOptions) (0), 0, 0);
hscale1 = gtk_hscale_new (GTK_ADJUSTMENT (gtk_adjustment_new (0, 0, 100, 1, 1, 1)));
gtk_widget_show (hscale1);
gtk_box_pack_start (GTK_BOX (vbox1), hscale1, TRUE, TRUE, 0);
drawingarea1 = gtk_drawing_area_new ();
gtk_widget_show (drawingarea1);
gtk_box_pack_start (GTK_BOX (vbox1), drawingarea1, TRUE, TRUE, 0);
dialog_action_area1 = GTK_DIALOG (dialog1)->action_area;
gtk_widget_show (dialog_action_area1);
gtk_button_box_set_layout (GTK_BUTTON_BOX (dialog_action_area1), GTK_BUTTONBOX_END);
cancelbutton1 = gtk_button_new_from_stock ("gtk-cancel");
gtk_widget_show (cancelbutton1);
gtk_dialog_add_action_widget (GTK_DIALOG (dialog1), cancelbutton1, GTK_RESPONSE_CANCEL);
GTK_WIDGET_SET_FLAGS (cancelbutton1, GTK_CAN_DEFAULT);
okbutton1 = gtk_button_new_from_stock ("gtk-ok");
gtk_widget_show (okbutton1);
gtk_dialog_add_action_widget (GTK_DIALOG (dialog1), okbutton1, GTK_RESPONSE_OK);
GTK_WIDGET_SET_FLAGS (okbutton1, GTK_CAN_DEFAULT);
/* Store pointers to all widgets, for use by lookup_widget(). */
GLADE_HOOKUP_OBJECT_NO_REF (dialog1, dialog1, "dialog1");
GLADE_HOOKUP_OBJECT_NO_REF (dialog1, dialog_vbox1, "dialog_vbox1");
GLADE_HOOKUP_OBJECT (dialog1, vbox1, "vbox1");
GLADE_HOOKUP_OBJECT (dialog1, table1, "table1");
GLADE_HOOKUP_OBJECT (dialog1, label1, "label1");
GLADE_HOOKUP_OBJECT (dialog1, label2, "label2");
GLADE_HOOKUP_OBJECT (dialog1, label3, "label3");
GLADE_HOOKUP_OBJECT (dialog1, label4, "label4");
GLADE_HOOKUP_OBJECT (dialog1, spinbuttonT, "spinbuttonT");
GLADE_HOOKUP_OBJECT (dialog1, spinbuttonD, "spinbuttonD");
GLADE_HOOKUP_OBJECT (dialog1, spinbuttonB, "spinbuttonB");
GLADE_HOOKUP_OBJECT (dialog1, checkbuttonBF, "checkbuttonBF");
GLADE_HOOKUP_OBJECT (dialog1, hscale1, "hscale1");
GLADE_HOOKUP_OBJECT (dialog1, drawingarea1, "drawingarea1");
GLADE_HOOKUP_OBJECT_NO_REF (dialog1, dialog_action_area1, "dialog_action_area1");
GLADE_HOOKUP_OBJECT (dialog1, cancelbutton1, "cancelbutton1");
GLADE_HOOKUP_OBJECT (dialog1, okbutton1, "okbutton1");
return dialog1;
}
示例6: gtk_dialog_new
//.........这里部分代码省略.........
gtk_widget_show (dialog_vbox1);
vbox1 = gtk_vbox_new (FALSE, 0);
gtk_widget_show (vbox1);
gtk_box_pack_start (GTK_BOX (dialog_vbox1), vbox1, TRUE, TRUE, 0);
table1 = gtk_table_new (4, 2, FALSE);
gtk_widget_show (table1);
gtk_box_pack_start (GTK_BOX (vbox1), table1, TRUE, TRUE, 0);
label6 = gtk_label_new (_("0"));
gtk_widget_show (label6);
gtk_table_attach (GTK_TABLE (table1), label6, 1, 2, 3, 4,
(GtkAttachOptions) (GTK_FILL),
(GtkAttachOptions) (0), 0, 0);
gtk_label_set_justify (GTK_LABEL (label6), GTK_JUSTIFY_LEFT);
gtk_misc_set_alignment (GTK_MISC (label6), 0, 0.5);
label5 = gtk_label_new (_("Time left :"));
gtk_widget_show (label5);
gtk_table_attach (GTK_TABLE (table1), label5, 0, 1, 3, 4,
(GtkAttachOptions) (GTK_FILL),
(GtkAttachOptions) (0), 0, 0);
gtk_label_set_justify (GTK_LABEL (label5), GTK_JUSTIFY_LEFT);
gtk_misc_set_alignment (GTK_MISC (label5), 0, 0.5);
label3 = gtk_label_new (_("Timecode :"));
gtk_widget_show (label3);
gtk_table_attach (GTK_TABLE (table1), label3, 0, 1, 2, 3,
(GtkAttachOptions) (GTK_FILL),
(GtkAttachOptions) (0), 0, 0);
gtk_label_set_justify (GTK_LABEL (label3), GTK_JUSTIFY_LEFT);
gtk_misc_set_alignment (GTK_MISC (label3), 0, 0.5);
label1 = gtk_label_new (_("Nb pictures seen :"));
gtk_widget_show (label1);
gtk_table_attach (GTK_TABLE (table1), label1, 0, 1, 1, 2,
(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);
labelTime = gtk_label_new (_("00:00:00"));
gtk_widget_show (labelTime);
gtk_table_attach (GTK_TABLE (table1), labelTime, 1, 2, 2, 3,
(GtkAttachOptions) (GTK_FILL),
(GtkAttachOptions) (0), 0, 0);
gtk_label_set_justify (GTK_LABEL (labelTime), GTK_JUSTIFY_LEFT);
gtk_misc_set_alignment (GTK_MISC (labelTime), 0, 0.5);
labelNbImage = gtk_label_new (_("0"));
gtk_widget_show (labelNbImage);
gtk_table_attach (GTK_TABLE (table1), labelNbImage, 1, 2, 1, 2,
(GtkAttachOptions) (GTK_FILL),
(GtkAttachOptions) (0), 0, 0);
gtk_label_set_justify (GTK_LABEL (labelNbImage), GTK_JUSTIFY_LEFT);
gtk_misc_set_alignment (GTK_MISC (labelNbImage), 0, 0.5);
label7 = gtk_label_new (_("Indexing :"));
gtk_widget_show (label7);
gtk_table_attach (GTK_TABLE (table1), label7, 0, 1, 0, 1,
(GtkAttachOptions) (GTK_EXPAND | GTK_FILL),
(GtkAttachOptions) (0), 0, 0);
gtk_label_set_justify (GTK_LABEL (label7), GTK_JUSTIFY_LEFT);
gtk_misc_set_alignment (GTK_MISC (label7), 0, 0.5);
labelName = gtk_label_new (_("/dev/null"));
gtk_widget_show (labelName);
gtk_table_attach (GTK_TABLE (table1), labelName, 1, 2, 0, 1,
(GtkAttachOptions) (GTK_FILL),
(GtkAttachOptions) (0), 0, 0);
gtk_label_set_justify (GTK_LABEL (labelName), GTK_JUSTIFY_LEFT);
gtk_misc_set_alignment (GTK_MISC (labelName), 0, 0.5);
progressbar1 = gtk_progress_bar_new ();
gtk_widget_show (progressbar1);
gtk_box_pack_start (GTK_BOX (vbox1), progressbar1, FALSE, FALSE, 0);
dialog_action_area1 = GTK_DIALOG (dialog1)->action_area;
gtk_widget_show (dialog_action_area1);
gtk_button_box_set_layout (GTK_BUTTON_BOX (dialog_action_area1), GTK_BUTTONBOX_END);
/* Store pointers to all widgets, for use by lookup_widget(). */
GLADE_HOOKUP_OBJECT_NO_REF (dialog1, dialog1, "dialog1");
GLADE_HOOKUP_OBJECT_NO_REF (dialog1, dialog_vbox1, "dialog_vbox1");
GLADE_HOOKUP_OBJECT (dialog1, vbox1, "vbox1");
GLADE_HOOKUP_OBJECT (dialog1, table1, "table1");
GLADE_HOOKUP_OBJECT (dialog1, label6, "label6");
GLADE_HOOKUP_OBJECT (dialog1, label5, "label5");
GLADE_HOOKUP_OBJECT (dialog1, label3, "label3");
GLADE_HOOKUP_OBJECT (dialog1, label1, "label1");
GLADE_HOOKUP_OBJECT (dialog1, labelTime, "labelTime");
GLADE_HOOKUP_OBJECT (dialog1, labelNbImage, "labelNbImage");
GLADE_HOOKUP_OBJECT (dialog1, label7, "label7");
GLADE_HOOKUP_OBJECT (dialog1, labelName, "labelName");
GLADE_HOOKUP_OBJECT (dialog1, progressbar1, "progressbar1");
GLADE_HOOKUP_OBJECT_NO_REF (dialog1, dialog_action_area1, "dialog_action_area1");
return dialog1;
}
示例7: create_MainWindow
//.........这里部分代码省略.........
gtk_widget_set_size_request (drawingarea1, 480, 240);
label14 = gtk_label_new ("");
gtk_widget_show (label14);
gtk_box_pack_start (GTK_BOX (vbox3), label14, FALSE, FALSE, 0);
gtk_label_set_justify (GTK_LABEL (label14), GTK_JUSTIFY_LEFT);
hseparator1 = gtk_hseparator_new ();
gtk_widget_show (hseparator1);
gtk_box_pack_start (GTK_BOX (vbox3), hseparator1, FALSE, FALSE, 8);
scrolledwindow1 = gtk_scrolled_window_new (NULL, NULL);
gtk_widget_show (scrolledwindow1);
gtk_box_pack_start (GTK_BOX (vbox3), scrolledwindow1, TRUE, TRUE, 0);
gtk_container_set_border_width (GTK_CONTAINER (scrolledwindow1), 8);
gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (scrolledwindow1), GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC);
treeview1 = gtk_tree_view_new ();
gtk_widget_show (treeview1);
gtk_container_add (GTK_CONTAINER (scrolledwindow1), treeview1);
gtk_tree_view_set_headers_visible (GTK_TREE_VIEW (treeview1), FALSE);
checkbutton2 = gtk_check_button_new_with_mnemonic (_("_System clock uses UTC"));
gtk_widget_show (checkbutton2);
gtk_box_pack_start (GTK_BOX (vbox3), checkbutton2, FALSE, FALSE, 0);
label2 = gtk_label_new (_("Timezone"));
gtk_widget_show (label2);
gtk_notebook_set_tab_label (GTK_NOTEBOOK (notebook1), gtk_notebook_get_nth_page (GTK_NOTEBOOK (notebook1), 1), label2);
gtk_label_set_justify (GTK_LABEL (label2), GTK_JUSTIFY_LEFT);
dialog_action_area1 = GTK_DIALOG (MainWindow)->action_area;
gtk_widget_show (dialog_action_area1);
gtk_button_box_set_layout (GTK_BUTTON_BOX (dialog_action_area1), GTK_BUTTONBOX_END);
helpbutton1 = gtk_button_new_from_stock ("gtk-help");
gtk_widget_show (helpbutton1);
gtk_dialog_add_action_widget (GTK_DIALOG (MainWindow), helpbutton1, GTK_RESPONSE_HELP);
GTK_WIDGET_SET_FLAGS (helpbutton1, GTK_CAN_DEFAULT);
cancelbutton1 = gtk_button_new_from_stock ("gtk-cancel");
gtk_widget_show (cancelbutton1);
gtk_dialog_add_action_widget (GTK_DIALOG (MainWindow), cancelbutton1, GTK_RESPONSE_CANCEL);
GTK_WIDGET_SET_FLAGS (cancelbutton1, GTK_CAN_DEFAULT);
okbutton1 = gtk_button_new_from_stock ("gtk-ok");
gtk_widget_show (okbutton1);
gtk_dialog_add_action_widget (GTK_DIALOG (MainWindow), okbutton1, GTK_RESPONSE_OK);
GTK_WIDGET_SET_FLAGS (okbutton1, GTK_CAN_DEFAULT);
g_signal_connect ((gpointer) MainWindow, "delete_event",
G_CALLBACK (on_MainWindow_close),
NULL);
g_signal_connect ((gpointer) calendar1, "day_selected",
G_CALLBACK (on_calendar1_day_selected),
NULL);
g_signal_connect ((gpointer) calendar1, "month_changed",
G_CALLBACK (on_calendar1_month_changed),
NULL);
g_signal_connect ((gpointer) spinbutton1, "changed",
G_CALLBACK (on_spinbutton1_changed),
NULL);
g_signal_connect ((gpointer) spinbutton2, "changed",
G_CALLBACK (on_spinbutton2_changed),
NULL);
g_signal_connect ((gpointer) spinbutton3, "changed",
示例8: generic_dialog_setup
static void generic_dialog_setup(GenericDialog *gd,
const gchar *title,
const gchar *role,
GtkWidget *parent, gboolean auto_close,
void (*cancel_cb)(GenericDialog *, gpointer), gpointer data)
{
GtkWidget *vbox;
gd->auto_close = auto_close;
gd->data = data;
gd->cancel_cb = cancel_cb;
gd->dialog = window_new(GTK_WINDOW_TOPLEVEL, role, NULL, NULL, title);
gtk_window_set_type_hint(GTK_WINDOW(gd->dialog), GDK_WINDOW_TYPE_HINT_DIALOG);
if (parent)
{
GtkWindow *window = NULL;
if (GTK_IS_WINDOW(parent))
{
window = GTK_WINDOW(parent);
}
else
{
GtkWidget *top;
top = gtk_widget_get_toplevel(parent);
if (GTK_IS_WINDOW(top) && gtk_widget_is_toplevel(top)) window = GTK_WINDOW(top);
}
if (window) gtk_window_set_transient_for(GTK_WINDOW(gd->dialog), window);
}
g_signal_connect(G_OBJECT(gd->dialog), "delete_event",
G_CALLBACK(generic_dialog_delete_cb), gd);
g_signal_connect(G_OBJECT(gd->dialog), "key_press_event",
G_CALLBACK(generic_dialog_key_press_cb), gd);
gtk_window_set_resizable(GTK_WINDOW(gd->dialog), TRUE);
gtk_container_set_border_width(GTK_CONTAINER(gd->dialog), PREF_PAD_BORDER);
vbox = gtk_vbox_new(FALSE, PREF_PAD_BUTTON_SPACE);
gtk_container_add(GTK_CONTAINER(gd->dialog), vbox);
gtk_widget_show(vbox);
gd->vbox = gtk_vbox_new(FALSE, PREF_PAD_GAP);
gtk_box_pack_start(GTK_BOX(vbox), gd->vbox, TRUE, TRUE, 0);
gtk_widget_show(gd->vbox);
gd->hbox = gtk_hbutton_box_new();
gtk_button_box_set_layout(GTK_BUTTON_BOX(gd->hbox), GTK_BUTTONBOX_END);
gtk_box_set_spacing(GTK_BOX(gd->hbox), PREF_PAD_BUTTON_GAP);
gtk_box_pack_start(GTK_BOX(vbox), gd->hbox, FALSE, FALSE, 0);
gtk_widget_show(gd->hbox);
if (gd->cancel_cb)
{
gd->cancel_button = generic_dialog_add_button(gd, GTK_STOCK_CANCEL, NULL, gd->cancel_cb, TRUE);
}
else
{
gd->cancel_button = NULL;
}
if (generic_dialog_get_alternative_button_order(gd->hbox))
{
g_signal_connect(G_OBJECT(gd->dialog), "show",
G_CALLBACK(generic_dialog_show_cb), gd);
}
gd->default_cb = NULL;
}
示例9: remmina_ftp_client_create_toolbar
static void remmina_ftp_client_create_toolbar(RemminaFTPClient *client)
{
GtkWidget *box;
GtkWidget *button;
GtkWidget *image;
gint i = 0;
box = gtk_hbutton_box_new();
gtk_widget_show(box);
gtk_button_box_set_layout(GTK_BUTTON_BOX(box), GTK_BUTTONBOX_START);
gtk_box_pack_start(GTK_BOX(client), box, FALSE, TRUE, 0);
button = gtk_button_new_from_stock(GTK_STOCK_HOME);
gtk_widget_show(button);
gtk_widget_set_tooltip_text(button, _("Go to home folder"));
gtk_button_set_relief(GTK_BUTTON(button), GTK_RELIEF_NONE);
gtk_box_pack_start(GTK_BOX(box), button, FALSE, FALSE, 0);
g_signal_connect(G_OBJECT(button), "clicked", G_CALLBACK(remmina_ftp_client_action_home), client);
button = gtk_button_new_from_stock(GTK_STOCK_GO_UP);
gtk_widget_show(button);
gtk_widget_set_tooltip_text(button, _("Go to parent folder"));
gtk_button_set_relief(GTK_BUTTON(button), GTK_RELIEF_NONE);
gtk_box_pack_start(GTK_BOX(box), button, FALSE, FALSE, 0);
g_signal_connect(G_OBJECT(button), "clicked", G_CALLBACK(remmina_ftp_client_action_parent), client);
button = gtk_button_new_from_stock(GTK_STOCK_REFRESH);
gtk_widget_show(button);
gtk_widget_set_tooltip_text(button, _("Refresh current folder"));
gtk_button_set_relief(GTK_BUTTON(button), GTK_RELIEF_NONE);
gtk_box_pack_start(GTK_BOX(box), button, FALSE, FALSE, 0);
g_signal_connect(G_OBJECT(button), "clicked", G_CALLBACK(remmina_ftp_client_action_refresh), client);
button = gtk_button_new_with_label(_("Download"));
gtk_widget_show(button);
gtk_widget_set_tooltip_text(button, _("Download from server"));
gtk_button_set_relief(GTK_BUTTON(button), GTK_RELIEF_NONE);
image = gtk_image_new_from_icon_name("document-save", GTK_ICON_SIZE_BUTTON);
gtk_button_set_image(GTK_BUTTON(button), image);
gtk_box_pack_start(GTK_BOX(box), button, FALSE, FALSE, 0);
g_signal_connect(G_OBJECT(button), "clicked", G_CALLBACK(remmina_ftp_client_action_download), client);
client->priv->file_action_widgets[i++] = button;
button = gtk_button_new_with_label(_("Upload"));
gtk_widget_show(button);
gtk_widget_set_tooltip_text(button, _("Upload to server"));
gtk_button_set_relief(GTK_BUTTON(button), GTK_RELIEF_NONE);
image = gtk_image_new_from_icon_name("document-send", GTK_ICON_SIZE_BUTTON);
gtk_button_set_image(GTK_BUTTON(button), image);
gtk_box_pack_start(GTK_BOX(box), button, FALSE, FALSE, 0);
g_signal_connect(G_OBJECT(button), "clicked", G_CALLBACK(remmina_ftp_client_action_upload), client);
button = gtk_button_new_from_stock(GTK_STOCK_DELETE);
gtk_widget_show(button);
gtk_widget_set_tooltip_text(button, _("Delete files on server"));
gtk_button_set_relief(GTK_BUTTON(button), GTK_RELIEF_NONE);
gtk_box_pack_start(GTK_BOX(box), button, FALSE, FALSE, 0);
g_signal_connect(G_OBJECT(button), "clicked", G_CALLBACK(remmina_ftp_client_action_delete), client);
client->priv->file_action_widgets[i++] = button;
}
示例10: show_properties_dialog
//.........这里部分代码省略.........
g_signal_connect (G_OBJECT (chkbox), "clicked",
(GCallback) super_safe_cb, NULL);
gtk_grid_attach (GTK_GRID (grid), chkbox, 0, 2, 2, 1);
gtk_widget_set_tooltip_text (chkbox,
_("Prevents all moves that result in getting killed."));
gtk_widget_set_sensitive (chkbox, properties.safe_moves);
g_signal_connect (G_OBJECT (safe_chkbox), "clicked",
(GCallback) safe_cb, (gpointer) chkbox);
chkbox = gtk_check_button_new_with_mnemonic (_("_Enable sounds"));
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (chkbox), properties.sound);
g_signal_connect (G_OBJECT (chkbox), "clicked",
(GCallback) sound_cb, NULL);
gtk_grid_attach (GTK_GRID (grid), chkbox, 0, 3, 2, 1);
gtk_widget_set_tooltip_text (chkbox,
_("Play sounds for events like winning a level and dying."));
label = gtk_label_new_with_mnemonic (_("Game"));
gtk_notebook_append_page (GTK_NOTEBOOK (notebook), cpage, label);
/* The graphics page */
gpage = gtk_box_new (GTK_ORIENTATION_VERTICAL, 18);
gtk_container_set_border_width (GTK_CONTAINER (gpage), 12);
grid = gtk_grid_new ();
gtk_grid_set_row_spacing (GTK_GRID (grid), 6);
gtk_grid_set_column_spacing (GTK_GRID (grid), 12);
gtk_box_pack_start (GTK_BOX (gpage), grid, FALSE, FALSE, 0);
label = gtk_label_new_with_mnemonic (_("_Image theme:"));
gtk_widget_set_hexpand (label, TRUE);
gtk_widget_set_halign (label, GTK_ALIGN_START);
gtk_grid_attach (GTK_GRID (grid), label, 0, 0, 1, 1);
pmapmenu = make_theme_menu ();
g_signal_connect (G_OBJECT (pmapmenu), "changed",
G_CALLBACK (pmap_selection), NULL);
gtk_label_set_mnemonic_widget (GTK_LABEL (label), pmapmenu);
gtk_grid_attach (GTK_GRID (grid), pmapmenu, 1, 0, 1, 1);
label = gtk_label_new_with_mnemonic (_("_Background color:"));
gtk_widget_set_halign (label, GTK_ALIGN_START);
gtk_grid_attach (GTK_GRID (grid), label, 0, 1, 1, 1);
w = gtk_color_button_new ();
gtk_color_chooser_set_rgba (GTK_COLOR_CHOOSER (w), &properties.bgcolour);
g_signal_connect (G_OBJECT (w), "color_set",
G_CALLBACK (bg_color_callback), NULL);
gtk_label_set_mnemonic_widget (GTK_LABEL (label), w);
gtk_grid_attach (GTK_GRID (grid), w, 1, 1, 1, 1);
label = gtk_label_new_with_mnemonic (_("Appearance"));
gtk_notebook_append_page (GTK_NOTEBOOK (notebook), gpage, label);
/* The keyboard page */
kpage = gtk_box_new (GTK_ORIENTATION_VERTICAL, 18);
gtk_container_set_border_width (GTK_CONTAINER (kpage), 12);
vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 6);
gtk_box_pack_start (GTK_BOX (kpage), vbox, TRUE, TRUE, 0);
controls_list = games_controls_list_new (settings);
games_controls_list_add_controls (GAMES_CONTROLS_LIST (controls_list),
"key00", _("Key to move NW"), g_settings_get_default_value (settings, "key00"),
"key01", _("Key to move N"), g_settings_get_default_value (settings, "key01"),
"key02", _("Key to move NE"), g_settings_get_default_value (settings, "key02"),
"key03", _("Key to move W"), g_settings_get_default_value (settings, "key03"),
"key04", _("Key to hold"), g_settings_get_default_value (settings, "key04"),
"key05", _("Key to move E"), g_settings_get_default_value (settings, "key05"),
"key06", _("Key to move SW"), g_settings_get_default_value (settings, "key06"),
"key07", _("Key to move S"), g_settings_get_default_value (settings, "key07"),
"key08", _("Key to move SE"), g_settings_get_default_value (settings, "key08"),
NULL);
gtk_box_pack_start (GTK_BOX (vbox), controls_list, TRUE, TRUE, 0);
hbox = gtk_button_box_new (GTK_ORIENTATION_HORIZONTAL);
gtk_button_box_set_layout (GTK_BUTTON_BOX (hbox), GTK_BUTTONBOX_START);
gtk_box_pack_start (GTK_BOX (vbox), hbox, FALSE, FALSE, 0);
dbut = gtk_button_new_with_mnemonic (_("_Restore Defaults"));
g_signal_connect (G_OBJECT (dbut), "clicked",
G_CALLBACK (defkey_cb), NULL);
gtk_box_pack_start (GTK_BOX (hbox), dbut, FALSE, FALSE, 0);
label = gtk_label_new_with_mnemonic (_("Keyboard"));
gtk_notebook_append_page (GTK_NOTEBOOK (notebook), kpage, label);
g_signal_connect (G_OBJECT (propbox), "delete_event",
G_CALLBACK (delete_cb), NULL);
g_signal_connect (G_OBJECT (propbox), "response",
G_CALLBACK (apply_cb), NULL);
gtk_widget_show_all (propbox);
}
示例11: create_dialogAudio
//.........这里部分代码省略.........
gtk_box_pack_start (GTK_BOX (vbox7), hbox5, FALSE, FALSE, 0);
radiobuttonGainManualPIN = gtk_radio_button_new_with_mnemonic (NULL, _("Manual (db) : "));
gtk_widget_show (radiobuttonGainManualPIN);
gtk_box_pack_start (GTK_BOX (hbox5), radiobuttonGainManualPIN, FALSE, FALSE, 0);
gtk_radio_button_set_group (GTK_RADIO_BUTTON (radiobuttonGainManualPIN), radiobuttonGainAutoPIN_group);
radiobuttonGainAutoPIN_group = gtk_radio_button_get_group (GTK_RADIO_BUTTON (radiobuttonGainManualPIN));
spinbutton1_adj = gtk_adjustment_new (-6, -6, 6, 0.10000000149, 1, 1);
spinbutton1 = gtk_spin_button_new (GTK_ADJUSTMENT (spinbutton1_adj), 1, 1);
gtk_widget_show (spinbutton1);
gtk_box_pack_start (GTK_BOX (hbox5), spinbutton1, TRUE, TRUE, 0);
gtk_spin_button_set_numeric (GTK_SPIN_BUTTON (spinbutton1), TRUE);
label7 = gtk_label_new (_("<b>Gain</b>"));
gtk_widget_show (label7);
gtk_frame_set_label_widget (GTK_FRAME (Gain), label7);
gtk_label_set_use_markup (GTK_LABEL (label7), TRUE);
frame4 = gtk_frame_new (NULL);
gtk_widget_show (frame4);
gtk_box_pack_start (GTK_BOX (vbox3), frame4, TRUE, TRUE, 0);
combobox1 = gtk_combo_box_new_text ();
gtk_widget_show (combobox1);
gtk_container_add (GTK_CONTAINER (frame4), combobox1);
gtk_combo_box_append_text (GTK_COMBO_BOX (combobox1), _("No change"));
gtk_combo_box_append_text (GTK_COMBO_BOX (combobox1), _("Mono"));
gtk_combo_box_append_text (GTK_COMBO_BOX (combobox1), _("Stereo"));
gtk_combo_box_append_text (GTK_COMBO_BOX (combobox1), _("Stereo+Surround"));
gtk_combo_box_append_text (GTK_COMBO_BOX (combobox1), _("Stereo+Center"));
gtk_combo_box_append_text (GTK_COMBO_BOX (combobox1), _("Stereo+Center+Surround"));
gtk_combo_box_append_text (GTK_COMBO_BOX (combobox1), _("Stereo Front+Stero Rear"));
gtk_combo_box_append_text (GTK_COMBO_BOX (combobox1), _("5 channels"));
gtk_combo_box_append_text (GTK_COMBO_BOX (combobox1), _("5.1"));
gtk_combo_box_append_text (GTK_COMBO_BOX (combobox1), _("Dolby Prologic"));
gtk_combo_box_append_text (GTK_COMBO_BOX (combobox1), _("Dolby Prologic 2"));
label6 = gtk_label_new (_("<b>Mixer</b>"));
gtk_widget_show (label6);
gtk_frame_set_label_widget (GTK_FRAME (frame4), label6);
gtk_label_set_use_markup (GTK_LABEL (label6), TRUE);
dialog_action_area1 = GTK_DIALOG (dialogAudio)->action_area;
gtk_widget_show (dialog_action_area1);
gtk_button_box_set_layout (GTK_BUTTON_BOX (dialog_action_area1), GTK_BUTTONBOX_END);
cancelbutton1 = gtk_button_new_from_stock ("gtk-cancel");
gtk_widget_show (cancelbutton1);
gtk_dialog_add_action_widget (GTK_DIALOG (dialogAudio), cancelbutton1, GTK_RESPONSE_CANCEL);
GTK_WIDGET_SET_FLAGS (cancelbutton1, GTK_CAN_DEFAULT);
okbutton1 = gtk_button_new_from_stock ("gtk-ok");
gtk_widget_show (okbutton1);
gtk_dialog_add_action_widget (GTK_DIALOG (dialogAudio), okbutton1, GTK_RESPONSE_OK);
GTK_WIDGET_SET_FLAGS (okbutton1, GTK_CAN_DEFAULT);
/* Store pointers to all widgets, for use by lookup_widget(). */
GLADE_HOOKUP_OBJECT_NO_REF (dialogAudio, dialogAudio, "dialogAudio");
GLADE_HOOKUP_OBJECT_NO_REF (dialogAudio, dialog_vbox1, "dialog_vbox1");
GLADE_HOOKUP_OBJECT (dialogAudio, vbox3, "vbox3");
GLADE_HOOKUP_OBJECT (dialogAudio, frame3, "frame3");
GLADE_HOOKUP_OBJECT (dialogAudio, vbox6, "vbox6");
GLADE_HOOKUP_OBJECT (dialogAudio, checkbuttonDRC, "checkbuttonDRC");
GLADE_HOOKUP_OBJECT (dialogAudio, hbox3, "hbox3");
GLADE_HOOKUP_OBJECT (dialogAudio, checkbuttonTimeShift, "checkbuttonTimeShift");
GLADE_HOOKUP_OBJECT (dialogAudio, entryTimeshift, "entryTimeshift");
GLADE_HOOKUP_OBJECT (dialogAudio, label5, "label5");
GLADE_HOOKUP_OBJECT (dialogAudio, frame1, "frame1");
GLADE_HOOKUP_OBJECT (dialogAudio, vbox4, "vbox4");
GLADE_HOOKUP_OBJECT (dialogAudio, radiobuttonNone, "radiobuttonNone");
GLADE_HOOKUP_OBJECT (dialogAudio, hbox2, "hbox2");
GLADE_HOOKUP_OBJECT (dialogAudio, radiobuttonSox, "radiobuttonSox");
GLADE_HOOKUP_OBJECT (dialogAudio, entryFrequency, "entryFrequency");
GLADE_HOOKUP_OBJECT (dialogAudio, label3, "label3");
GLADE_HOOKUP_OBJECT (dialogAudio, frame2, "frame2");
GLADE_HOOKUP_OBJECT (dialogAudio, vbox5, "vbox5");
GLADE_HOOKUP_OBJECT (dialogAudio, radiobutton_fpsnone, "radiobutton_fpsnone");
GLADE_HOOKUP_OBJECT (dialogAudio, radiobutton_fpsfilm, "radiobutton_fpsfilm");
GLADE_HOOKUP_OBJECT (dialogAudio, radiobutton_fpsPAL, "radiobutton_fpsPAL");
GLADE_HOOKUP_OBJECT (dialogAudio, label4, "label4");
GLADE_HOOKUP_OBJECT (dialogAudio, Gain, "Gain");
GLADE_HOOKUP_OBJECT (dialogAudio, alignment1, "alignment1");
GLADE_HOOKUP_OBJECT (dialogAudio, hbox4, "hbox4");
GLADE_HOOKUP_OBJECT (dialogAudio, checkbutton1, "checkbutton1");
GLADE_HOOKUP_OBJECT (dialogAudio, vbox7, "vbox7");
GLADE_HOOKUP_OBJECT (dialogAudio, radiobuttonGainAutoPIN, "radiobuttonGainAutoPIN");
GLADE_HOOKUP_OBJECT (dialogAudio, hbox5, "hbox5");
GLADE_HOOKUP_OBJECT (dialogAudio, radiobuttonGainManualPIN, "radiobuttonGainManualPIN");
GLADE_HOOKUP_OBJECT (dialogAudio, spinbutton1, "spinbutton1");
GLADE_HOOKUP_OBJECT (dialogAudio, label7, "label7");
GLADE_HOOKUP_OBJECT (dialogAudio, frame4, "frame4");
GLADE_HOOKUP_OBJECT (dialogAudio, combobox1, "combobox1");
GLADE_HOOKUP_OBJECT (dialogAudio, label6, "label6");
GLADE_HOOKUP_OBJECT_NO_REF (dialogAudio, dialog_action_area1, "dialog_action_area1");
GLADE_HOOKUP_OBJECT (dialogAudio, cancelbutton1, "cancelbutton1");
GLADE_HOOKUP_OBJECT (dialogAudio, okbutton1, "okbutton1");
return dialogAudio;
}
示例12: create_PreferencesDialog
//.........这里部分代码省略.........
gtk_box_pack_start(GTK_BOX(hbox95), RecordRawDataButton, FALSE, FALSE, 0);
RawFileName = gtk_entry_new();
gtk_widget_show(RawFileName);
gtk_box_pack_start(GTK_BOX(hbox95), RawFileName, TRUE, TRUE, 0);
gtk_tooltips_set_tip(tooltips, RawFileName, _("Raw Data MP4 File Name"), NULL);
RawFileNameBrowse = gtk_button_new();
gtk_widget_show(RawFileNameBrowse);
gtk_box_pack_start(GTK_BOX(hbox95), RawFileNameBrowse, FALSE, FALSE, 0);
alignment26 = gtk_alignment_new(0.5, 0.5, 0, 0);
gtk_widget_show(alignment26);
gtk_container_add(GTK_CONTAINER(RawFileNameBrowse), alignment26);
hbox96 = gtk_hbox_new(FALSE, 2);
gtk_widget_show(hbox96);
gtk_container_add(GTK_CONTAINER(alignment26), hbox96);
image26 = gtk_image_new_from_stock("gtk-open", GTK_ICON_SIZE_BUTTON);
gtk_widget_show(image26);
gtk_box_pack_start(GTK_BOX(hbox96), image26, FALSE, FALSE, 0);
label181 = gtk_label_new_with_mnemonic(_("Browse"));
gtk_widget_show(label181);
gtk_box_pack_start(GTK_BOX(hbox96), label181, FALSE, FALSE, 0);
label171 = gtk_label_new(_("MP4 File Settings"));
gtk_widget_show(label171);
gtk_notebook_set_tab_label(GTK_NOTEBOOK(notebook1), gtk_notebook_get_nth_page(GTK_NOTEBOOK(notebook1), 2), label171);
dialog_action_area8 = GTK_DIALOG(PreferencesDialog)->action_area;
gtk_widget_show(dialog_action_area8);
gtk_button_box_set_layout(GTK_BUTTON_BOX(dialog_action_area8), GTK_BUTTONBOX_END);
cancelbutton6 = gtk_button_new_from_stock("gtk-cancel");
gtk_widget_show(cancelbutton6);
gtk_dialog_add_action_widget(GTK_DIALOG(PreferencesDialog), cancelbutton6, GTK_RESPONSE_CANCEL);
GTK_WIDGET_SET_FLAGS(cancelbutton6, GTK_CAN_DEFAULT);
okbutton8 = gtk_button_new_from_stock("gtk-ok");
gtk_widget_show(okbutton8);
gtk_dialog_add_action_widget(GTK_DIALOG(PreferencesDialog), okbutton8, GTK_RESPONSE_OK);
GTK_WIDGET_SET_FLAGS(okbutton8, GTK_CAN_DEFAULT);
g_signal_connect((gpointer) PreferencesDialog, "response",
G_CALLBACK(on_PreferencesDialog_response),
NULL);
g_signal_connect((gpointer)StreamDirectoryButton, "clicked",
G_CALLBACK(on_stream_directory_clicked),
PreferencesDialog);
g_signal_connect((gpointer)ProfileDirectoryButton, "clicked",
G_CALLBACK(on_profile_directory_clicked),
PreferencesDialog);
g_signal_connect((gpointer)RawFileNameBrowse, "clicked",
G_CALLBACK(on_raw_file_clicked),
PreferencesDialog);
/* Store pointers to all widgets, for use by lookup_widget(). */
GLADE_HOOKUP_OBJECT_NO_REF(PreferencesDialog, PreferencesDialog, "PreferencesDialog");
GLADE_HOOKUP_OBJECT_NO_REF(PreferencesDialog, dialog_vbox9, "dialog_vbox9");
GLADE_HOOKUP_OBJECT(PreferencesDialog, notebook1, "notebook1");
GLADE_HOOKUP_OBJECT(PreferencesDialog, GenericTable, "GenericTable");
GLADE_HOOKUP_OBJECT(PreferencesDialog, label173, "label173");
GLADE_HOOKUP_OBJECT(PreferencesDialog, LogLevelSpinner, "LogLevelSpinner");
示例13: create_connectionpool
//.........这里部分代码省略.........
l_probe = gtk_label_new ("Query:");
gtk_widget_ref (l_probe);
gtk_object_set_data_full (GTK_OBJECT (connectionpool), "l_probe",
l_probe, (GtkDestroyNotify) gtk_widget_unref);
gtk_widget_show (l_probe);
#if GTK_CHECK_VERSION(2,0,0)
gtk_fixed_put (GTK_FIXED (fixed1), l_probe, 8, 78);
gtk_widget_set_uposition (l_probe, 8, 78);
#else
gtk_fixed_put (GTK_FIXED (fixed1), l_probe, 8, 70);
gtk_widget_set_uposition (l_probe, 8, 70);
#endif
gtk_widget_set_usize (l_probe, 60, 24);
gtk_label_set_justify (GTK_LABEL (l_probe), GTK_JUSTIFY_RIGHT);
t_probe = gtk_entry_new ();
gtk_widget_ref (t_probe);
gtk_object_set_data_full (GTK_OBJECT (connectionpool), "t_probe",
t_probe, (GtkDestroyNotify) gtk_widget_unref);
gtk_widget_show (t_probe);
#if GTK_CHECK_VERSION(2,0,0)
gtk_fixed_put (GTK_FIXED (fixed1), t_probe, 80, 78);
gtk_widget_set_uposition (t_probe, 80, 78);
#else
gtk_fixed_put (GTK_FIXED (fixed1), t_probe, 80, 70);
gtk_widget_set_uposition (t_probe, 80, 70);
#endif
gtk_widget_set_usize (t_probe, 300, 22);
if (choose_t)
gtk_entry_set_text (GTK_ENTRY (t_probe), choose_t->probe);
dialog_action_area1 = GTK_DIALOG (connectionpool)->action_area;
gtk_object_set_data (GTK_OBJECT (connectionpool), "dialog_action_area1",
dialog_action_area1);
gtk_widget_show (dialog_action_area1);
gtk_container_set_border_width (GTK_CONTAINER (dialog_action_area1), 5);
hbuttonbox1 = gtk_hbutton_box_new ();
gtk_widget_ref (hbuttonbox1);
gtk_object_set_data_full (GTK_OBJECT (connectionpool), "hbuttonbox1",
hbuttonbox1, (GtkDestroyNotify) gtk_widget_unref);
gtk_widget_show (hbuttonbox1);
gtk_box_pack_start (GTK_BOX (dialog_action_area1), hbuttonbox1, TRUE, TRUE,
0);
gtk_button_box_set_layout (GTK_BUTTON_BOX (hbuttonbox1), GTK_BUTTONBOX_END);
gtk_button_box_set_spacing (GTK_BUTTON_BOX (hbuttonbox1), 10);
b_finish = gtk_button_new_with_label ("");
b_finish_key = gtk_label_parse_uline (GTK_LABEL (GTK_BIN (b_finish)->child),
"_Finish");
gtk_widget_add_accelerator (b_finish, "clicked", accel_group,
b_finish_key, GDK_MOD1_MASK, 0);
gtk_widget_ref (b_finish);
gtk_object_set_data_full (GTK_OBJECT (connectionpool), "b_finish", b_finish,
(GtkDestroyNotify) gtk_widget_unref);
gtk_widget_show (b_finish);
gtk_container_add (GTK_CONTAINER (hbuttonbox1), b_finish);
GTK_WIDGET_SET_FLAGS (b_finish, GTK_CAN_DEFAULT);
gtk_widget_add_accelerator (b_finish, "clicked", accel_group,
'F', GDK_MOD1_MASK, GTK_ACCEL_VISIBLE);
b_cancel = gtk_button_new_with_label ("");
b_cancel_key = gtk_label_parse_uline (GTK_LABEL (GTK_BIN (b_cancel)->child),
"_Cancel");
gtk_widget_add_accelerator (b_cancel, "clicked", accel_group,
b_cancel_key, GDK_MOD1_MASK, 0);
gtk_widget_ref (b_cancel);
gtk_object_set_data_full (GTK_OBJECT (connectionpool), "b_cancel", b_cancel,
(GtkDestroyNotify) gtk_widget_unref);
gtk_widget_show (b_cancel);
gtk_container_add (GTK_CONTAINER (hbuttonbox1), b_cancel);
GTK_WIDGET_SET_FLAGS (b_cancel, GTK_CAN_DEFAULT);
gtk_widget_add_accelerator (b_cancel, "clicked", accel_group,
'C', GDK_MOD1_MASK, GTK_ACCEL_VISIBLE);
/* Finish button events */
gtk_signal_connect (GTK_OBJECT (b_finish), "clicked",
GTK_SIGNAL_FUNC (connectionpool_finish_clicked), choose_t);
/* Cancel button events */
gtk_signal_connect (GTK_OBJECT (b_cancel), "clicked",
GTK_SIGNAL_FUNC (connectionpool_cancel_clicked), choose_t);
/* Close window button events */
gtk_signal_connect (GTK_OBJECT (connectionpool), "delete_event",
GTK_SIGNAL_FUNC (delete_event), choose_t);
gtk_signal_connect (GTK_OBJECT (connectionpool), "destroy",
GTK_SIGNAL_FUNC (gtk_main_quit), NULL);
gtk_window_add_accel_group (GTK_WINDOW (connectionpool), accel_group);
choose_t->timeout_entry = t_cptimeout;
choose_t->probe_entry = t_probe;
choose_t->mainwnd = connectionpool;
gtk_widget_show_all (connectionpool);
gtk_main ();
return choose_t->changed;
}
示例14: configure_program_dialog
//.........这里部分代码省略.........
/** ***** [START] Dialog action buttons [START] ***** **/
GtkWidget *button_close = gtk_button_new_with_label("Close") ; // gtk_dialog_add_button(GTK_DIALOG(configure_dialog), "Cancel", GTK_RESPONSE_CANCEL) ;
GtkWidget *image_close = gtk_image_new_from_file((settings.path_to_button_icons + "dialog-close.png").c_str()) ;
gtk_widget_set_tooltip_markup(button_close, "<b>Close</b> the configuration window and don't store any setting.") ;
gtk_button_set_image(GTK_BUTTON(button_close), image_close) ;
gtk_button_set_always_show_image(GTK_BUTTON(button_close), TRUE) ;
GtkWidget *button_ok = gtk_button_new_with_label("Apply") ; // gtk_dialog_add_button(GTK_DIALOG(configure_dialog), "Apply", GTK_RESPONSE_APPLY) ;
GtkWidget *image_ok = gtk_image_new_from_file((settings.path_to_button_icons + "dialog-ok.png").c_str()) ;
gtk_widget_set_tooltip_markup(button_ok, "<b>Register</b> all the settings as <i>your default configuration</i> at start.") ;
gtk_button_set_image(GTK_BUTTON(button_ok), image_ok) ;
gtk_button_set_always_show_image(GTK_BUTTON(button_ok), TRUE) ;
gtk_dialog_add_action_widget(GTK_DIALOG(configure_dialog), button_close, GTK_RESPONSE_CLOSE) ;
gtk_dialog_add_action_widget(GTK_DIALOG(configure_dialog), button_ok, GTK_RESPONSE_APPLY) ;
GtkWidget *action_area = gtk_dialog_get_action_area(GTK_DIALOG(configure_dialog)) ;
gtk_container_set_border_width(GTK_CONTAINER(action_area), 0) ;
gtk_button_box_set_layout(GTK_BUTTON_BOX(action_area), GTK_BUTTONBOX_EDGE) ;
/** ***** [END] Dialog action buttons [END] ***** **/
Radio_Config high_contrast_radiobutton ;
high_contrast_radiobutton.button = radiobutton_icons_high_contrast ;
high_contrast_radiobutton.image = image_icons_high_contrast ;
high_contrast_radiobutton.volume = playing_settings_volume_image ;
high_contrast_radiobutton.cancel = image_close ;
high_contrast_radiobutton.apply = image_ok ;
high_contrast_radiobutton.little = interface_size_little_image ;
high_contrast_radiobutton.middle = interface_size_middle_image ;
high_contrast_radiobutton.big = interface_size_big_image ;
Radio_Config oxygen_radiobutton ;
oxygen_radiobutton.button = radiobutton_icons_oxygen ;
oxygen_radiobutton.image = image_icons_oxygen ;
oxygen_radiobutton.volume = playing_settings_volume_image ;
oxygen_radiobutton.cancel = image_close ;
oxygen_radiobutton.apply = image_ok ;
oxygen_radiobutton.little = interface_size_little_image ;
oxygen_radiobutton.middle = interface_size_middle_image ;
oxygen_radiobutton.big = interface_size_big_image ;
示例15: gtk_dialog_new
GtkWidget *create_dialog1 (void)
{
GtkWidget *dialog1;
GtkWidget *dialog_vbox1;
GtkWidget *table1;
GtkWidget *hbox1;
GtkWidget *label1;
GtkWidget *entryLeft;
GtkWidget *hbox2;
GtkWidget *label2;
GtkWidget *entryRight;
GtkWidget *hbox3;
GtkWidget *label3;
GtkWidget *entryTop;
GtkWidget *hbox4;
GtkWidget *label4;
GtkWidget *entryBottom;
GtkWidget *dialog_action_area1;
GtkWidget *cancelbutton1;
GtkWidget *okbutton1;
dialog1 = gtk_dialog_new ();
gtk_window_set_title (GTK_WINDOW (dialog1), _("dialog1"));
dialog_vbox1 = GTK_DIALOG (dialog1)->vbox;
gtk_widget_show (dialog_vbox1);
table1 = gtk_table_new (2, 2, FALSE);
gtk_widget_show (table1);
gtk_box_pack_start (GTK_BOX (dialog_vbox1), table1, TRUE, TRUE, 0);
hbox1 = gtk_hbox_new (FALSE, 0);
gtk_widget_show (hbox1);
gtk_table_attach (GTK_TABLE (table1), hbox1, 0, 1, 0, 1,
(GtkAttachOptions) (GTK_EXPAND | GTK_FILL),
(GtkAttachOptions) (GTK_EXPAND | GTK_FILL), 0, 0);
label1 = gtk_label_new (_("Left:"));
gtk_widget_show (label1);
gtk_box_pack_start (GTK_BOX (hbox1), label1, TRUE, TRUE, 0);
gtk_label_set_justify (GTK_LABEL (label1), GTK_JUSTIFY_LEFT);
entryLeft = gtk_entry_new ();
gtk_widget_show (entryLeft);
gtk_box_pack_start (GTK_BOX (hbox1), entryLeft, TRUE, TRUE, 0);
gtk_widget_set_size_request (entryLeft, 60, -1);
hbox2 = gtk_hbox_new (FALSE, 0);
gtk_widget_show (hbox2);
gtk_table_attach (GTK_TABLE (table1), hbox2, 1, 2, 0, 1,
(GtkAttachOptions) (GTK_EXPAND | GTK_FILL),
(GtkAttachOptions) (GTK_FILL), 0, 0);
label2 = gtk_label_new (_("Right:"));
gtk_widget_show (label2);
gtk_box_pack_start (GTK_BOX (hbox2), label2, TRUE, TRUE, 0);
gtk_label_set_justify (GTK_LABEL (label2), GTK_JUSTIFY_LEFT);
entryRight = gtk_entry_new ();
gtk_widget_show (entryRight);
gtk_box_pack_start (GTK_BOX (hbox2), entryRight, TRUE, TRUE, 0);
gtk_widget_set_size_request (entryRight, 60, -1);
hbox3 = gtk_hbox_new (FALSE, 0);
gtk_widget_show (hbox3);
gtk_table_attach (GTK_TABLE (table1), hbox3, 0, 1, 1, 2,
(GtkAttachOptions) (GTK_FILL),
(GtkAttachOptions) (GTK_EXPAND | GTK_FILL), 0, 0);
label3 = gtk_label_new (_("Top:"));
gtk_widget_show (label3);
gtk_box_pack_start (GTK_BOX (hbox3), label3, TRUE, TRUE, 0);
gtk_label_set_justify (GTK_LABEL (label3), GTK_JUSTIFY_LEFT);
entryTop = gtk_entry_new ();
gtk_widget_show (entryTop);
gtk_box_pack_start (GTK_BOX (hbox3), entryTop, TRUE, TRUE, 0);
gtk_widget_set_size_request (entryTop, 60, -1);
hbox4 = gtk_hbox_new (FALSE, 0);
gtk_widget_show (hbox4);
gtk_table_attach (GTK_TABLE (table1), hbox4, 1, 2, 1, 2,
(GtkAttachOptions) (GTK_FILL),
(GtkAttachOptions) (GTK_FILL), 0, 0);
label4 = gtk_label_new (_("Bottom:"));
gtk_widget_show (label4);
gtk_box_pack_start (GTK_BOX (hbox4), label4, TRUE, TRUE, 0);
gtk_label_set_justify (GTK_LABEL (label4), GTK_JUSTIFY_LEFT);
entryBottom = gtk_entry_new ();
gtk_widget_show (entryBottom);
gtk_box_pack_start (GTK_BOX (hbox4), entryBottom, TRUE, TRUE, 0);
gtk_widget_set_size_request (entryBottom, 60, -1);
dialog_action_area1 = GTK_DIALOG (dialog1)->action_area;
gtk_widget_show (dialog_action_area1);
gtk_button_box_set_layout (GTK_BUTTON_BOX (dialog_action_area1), GTK_BUTTONBOX_END);
cancelbutton1 = gtk_button_new_from_stock ("gtk-cancel");
//.........这里部分代码省略.........