当前位置: 首页>>代码示例>>C++>>正文


C++ GTK_WIDGET_SET_FLAGS函数代码示例

本文整理汇总了C++中GTK_WIDGET_SET_FLAGS函数的典型用法代码示例。如果您正苦于以下问题:C++ GTK_WIDGET_SET_FLAGS函数的具体用法?C++ GTK_WIDGET_SET_FLAGS怎么用?C++ GTK_WIDGET_SET_FLAGS使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了GTK_WIDGET_SET_FLAGS函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: create_ChromaShift

GtkWidget*
create_ChromaShift (void)
{
  GtkWidget *ChromaShift;
  GtkWidget *dialog_vbox1;
  GtkWidget *vbox1;
  GtkWidget *table1;
  GtkWidget *label1;
  GtkWidget *label2;
  GtkObject *spinbutton_U_adj;
  GtkWidget *spinbutton_U;
  GtkObject *spinbutton_V_adj;
  GtkWidget *spinbutton_V;
  GtkWidget *hscale;
  GtkWidget *frame1;
  GtkWidget *alignment1;
  GtkWidget *drawingarea1;
  GtkWidget *label3;
  GtkWidget *dialog_action_area1;
  GtkWidget *cancelbutton1;
  GtkWidget *applybutton1;
  GtkWidget *okbutton1;

  ChromaShift = gtk_dialog_new ();
  gtk_window_set_title (GTK_WINDOW (ChromaShift), QT_TR_NOOP("ChromaShift"));
  gtk_window_set_type_hint (GTK_WINDOW (ChromaShift), GDK_WINDOW_TYPE_HINT_DIALOG);

  dialog_vbox1 = GTK_DIALOG (ChromaShift)->vbox;
  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 (2, 2, FALSE);
  gtk_widget_show (table1);
  gtk_box_pack_start (GTK_BOX (vbox1), table1, FALSE, FALSE, 0);

  label1 = gtk_label_new (QT_TR_NOOP("U Shift :"));
  gtk_widget_show (label1);
  gtk_table_attach (GTK_TABLE (table1), label1, 0, 1, 0, 1,
                    (GtkAttachOptions) (GTK_FILL),
                    (GtkAttachOptions) (0), 0, 0);
  gtk_misc_set_alignment (GTK_MISC (label1), 0, 0.5);

  label2 = gtk_label_new (QT_TR_NOOP("V Shift :"));
  gtk_widget_show (label2);
  gtk_table_attach (GTK_TABLE (table1), label2, 0, 1, 1, 2,
                    (GtkAttachOptions) (GTK_FILL),
                    (GtkAttachOptions) (0), 0, 0);
  gtk_misc_set_alignment (GTK_MISC (label2), 0, 0.5);

  spinbutton_U_adj = gtk_adjustment_new (0, -32, 32, 1, 10, 10);
  spinbutton_U = gtk_spin_button_new (GTK_ADJUSTMENT (spinbutton_U_adj), 1, 0);
  gtk_widget_show (spinbutton_U);
  gtk_table_attach (GTK_TABLE (table1), spinbutton_U, 1, 2, 0, 1,
                    (GtkAttachOptions) (0),
                    (GtkAttachOptions) (0), 0, 0);
  gtk_spin_button_set_numeric (GTK_SPIN_BUTTON (spinbutton_U), TRUE);

  spinbutton_V_adj = gtk_adjustment_new (0, -32, 32, 1, 10, 10);
  spinbutton_V = gtk_spin_button_new (GTK_ADJUSTMENT (spinbutton_V_adj), 1, 0);
  gtk_widget_show (spinbutton_V);
  gtk_table_attach (GTK_TABLE (table1), spinbutton_V, 1, 2, 1, 2,
                    (GtkAttachOptions) (0),
                    (GtkAttachOptions) (0), 0, 0);
  gtk_spin_button_set_numeric (GTK_SPIN_BUTTON (spinbutton_V), TRUE);

  hscale = gtk_hscale_new (GTK_ADJUSTMENT (gtk_adjustment_new (0, 0, 100, 1, 1, 1)));
  gtk_widget_show (hscale);
  gtk_box_pack_start (GTK_BOX (vbox1), hscale, FALSE, FALSE, 0);
  gtk_scale_set_digits (GTK_SCALE (hscale), 0);

  frame1 = gtk_frame_new (NULL);
  gtk_widget_show (frame1);
  gtk_box_pack_start (GTK_BOX (vbox1), frame1, TRUE, TRUE, 0);
  gtk_frame_set_shadow_type (GTK_FRAME (frame1), GTK_SHADOW_NONE);

  alignment1 = gtk_alignment_new (0.5, 0.5, 1, 1);
  gtk_widget_show (alignment1);
  gtk_container_add (GTK_CONTAINER (frame1), alignment1);
  gtk_alignment_set_padding (GTK_ALIGNMENT (alignment1), 0, 0, 12, 0);

  drawingarea1 = gtk_drawing_area_new ();
  gtk_widget_show (drawingarea1);
  gtk_container_add (GTK_CONTAINER (alignment1), drawingarea1);

  label3 = gtk_label_new (QT_TR_NOOP("<b>Preview</b>"));
  gtk_widget_show (label3);
  gtk_frame_set_label_widget (GTK_FRAME (frame1), label3);
  gtk_label_set_use_markup (GTK_LABEL (label3), TRUE);

  dialog_action_area1 = GTK_DIALOG (ChromaShift)->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 (ChromaShift), cancelbutton1, GTK_RESPONSE_CANCEL);
  GTK_WIDGET_SET_FLAGS (cancelbutton1, GTK_CAN_DEFAULT);
//.........这里部分代码省略.........
开发者ID:BackupTheBerlios,项目名称:avidemux-svn,代码行数:101,代码来源:DIA_chromaShift.cpp

示例2: xfburn_preferences_dialog_init


//.........这里部分代码省略.........
  gtk_container_add (GTK_CONTAINER (scrolled_window), priv->treeview_devices);
  g_object_unref (store);
  
  /* add columns */
  column_name = gtk_tree_view_column_new ();
  gtk_tree_view_column_set_title (column_name, _("Name"));
  gtk_tree_view_column_set_expand (column_name, TRUE);

  cell_icon = gtk_cell_renderer_pixbuf_new ();
  gtk_tree_view_column_pack_start (column_name, cell_icon, FALSE);
  gtk_tree_view_column_set_attributes (column_name, cell_icon, "pixbuf", DEVICE_LIST_COLUMN_ICON, NULL);
  g_object_set (cell_icon, "xalign", 0.0, "ypad", 0, NULL);

  cell_name = gtk_cell_renderer_text_new ();
  gtk_tree_view_column_pack_start (column_name, cell_name, TRUE);
  gtk_tree_view_column_set_attributes (column_name, cell_name, "text", DEVICE_LIST_COLUMN_NAME, NULL);

  gtk_tree_view_append_column (GTK_TREE_VIEW (priv->treeview_devices), column_name);
  gtk_tree_view_insert_column_with_attributes (GTK_TREE_VIEW (priv->treeview_devices), -1, _("Node"),
                                               gtk_cell_renderer_text_new (), "text", DEVICE_LIST_COLUMN_NODE, NULL);
  gtk_tree_view_insert_column_with_attributes (GTK_TREE_VIEW (priv->treeview_devices), -1, _("Write CD-R"),
                                               gtk_cell_renderer_toggle_new (), "active", DEVICE_LIST_COLUMN_CDR, NULL);
  gtk_tree_view_insert_column_with_attributes (GTK_TREE_VIEW (priv->treeview_devices), -1, _("Write CD-RW"),
                                               gtk_cell_renderer_toggle_new (), "active", DEVICE_LIST_COLUMN_CDRW,
                                               NULL);
  gtk_tree_view_insert_column_with_attributes (GTK_TREE_VIEW (priv->treeview_devices), -1, _("Write DVD-R"),
                                               gtk_cell_renderer_toggle_new (), "active", DEVICE_LIST_COLUMN_DVDR,
                                               NULL);
  gtk_tree_view_insert_column_with_attributes (GTK_TREE_VIEW (priv->treeview_devices), -1, _("Write DVD-RAM"),
                                               gtk_cell_renderer_toggle_new (), "active", DEVICE_LIST_COLUMN_DVDRAM,
                                               NULL);
  gtk_tree_view_insert_column_with_attributes (GTK_TREE_VIEW (priv->treeview_devices), -1, _("Write Blu-ray"),
                                               gtk_cell_renderer_toggle_new (), "active", DEVICE_LIST_COLUMN_BD,
                                               NULL);

  hbox = gtk_hbox_new (FALSE, 0);
  gtk_box_pack_start (GTK_BOX (vbox2), hbox, FALSE, FALSE, BORDER);
  gtk_widget_show (hbox);

  priv->button_scan = xfce_gtk_button_new_mixed (GTK_STOCK_CDROM, _("Sc_an for devices"));
  gtk_box_pack_end (GTK_BOX (hbox), priv->button_scan, FALSE, FALSE, BORDER);
  g_signal_connect (G_OBJECT (priv->button_scan), "clicked", G_CALLBACK (scan_button_clicked_cb), obj);
  gtk_widget_show (priv->button_scan);

  gtk_icon_size_lookup (GTK_ICON_SIZE_DIALOG, &x, &y);
  icon = gtk_icon_theme_load_icon ( gtk_icon_theme_get_default(), "media-optical", x, GTK_ICON_LOOKUP_GENERIC_FALLBACK, NULL);
  if (!icon)
    icon = gtk_icon_theme_load_icon ( gtk_icon_theme_get_default(), "media-cdrom", x, GTK_ICON_LOOKUP_GENERIC_FALLBACK, NULL);
  if (!icon)
    icon = gtk_icon_theme_load_icon ( gtk_icon_theme_get_default(), GTK_STOCK_CDROM, x, GTK_ICON_LOOKUP_GENERIC_FALLBACK, NULL);

  
  gtk_list_store_append (icon_store, &iter);
  gtk_list_store_set (icon_store, &iter,
                      SETTINGS_LIST_PIXBUF_COLUMN, icon,
                      SETTINGS_LIST_TEXT_COLUMN, _("Devices"),
                      SETTINGS_LIST_INDEX_COLUMN, idx,
                      -1);
  if (icon)
    g_object_unref (G_OBJECT (icon));
  
  exo_mutual_binding_new (G_OBJECT (priv->notebook), "page", G_OBJECT (priv->icon_bar), "active");


  /* below the device list */
#if 0
  priv->check_empty_speed_list = gtk_check_button_new_with_mnemonic (_("Show warning on _empty speed list"));
  gtk_box_pack_start (GTK_BOX (vbox2), priv->check_empty_speed_list, FALSE, FALSE, BORDER);
  gtk_widget_show (priv->check_empty_speed_list);
#endif

  /* fifo */
  vbox3 = gtk_vbox_new (FALSE, 0);
  gtk_widget_show (vbox3);

  frame = xfce_gtk_frame_box_new_with_content (_("FIFO buffer size (in kb)"), vbox3);
  gtk_box_pack_start (GTK_BOX (vbox), frame, TRUE, TRUE, BORDER);
  gtk_widget_show (frame);

  priv->scale_fifo = gtk_hscale_new_with_range (0.0, FIFO_MAX_SIZE, 32.0);
  gtk_scale_set_value_pos (GTK_SCALE (priv->scale_fifo), GTK_POS_LEFT);
  gtk_range_set_value (GTK_RANGE (priv->scale_fifo), 0);
  gtk_box_pack_start (GTK_BOX (vbox3), priv->scale_fifo, FALSE, FALSE, BORDER/2);
  gtk_widget_show (priv->scale_fifo);

  
  /* action buttons */
  button_close = gtk_button_new_from_stock ("gtk-close");
  gtk_widget_show (button_close);
  gtk_dialog_add_action_widget (GTK_DIALOG (obj), button_close, GTK_RESPONSE_CLOSE);
  GTK_WIDGET_SET_FLAGS (button_close, GTK_CAN_DEFAULT);
  gtk_widget_grab_focus (button_close);
  gtk_widget_grab_default (button_close);

  g_signal_connect (G_OBJECT (obj), "response", G_CALLBACK (xfburn_preferences_dialog_response_cb), priv);
  
  refresh_devices_list (obj);
  
  g_object_unref (icon_store);
}
开发者ID:Pjotr123,项目名称:xfburn,代码行数:101,代码来源:xfburn-preferences-dialog.c

示例3: create_win_save_phrase

void create_win_save_phrase(WSP_S *wsp, int wspN)
{
#if WIN32
  if (test_mode)
    return;
#endif

  if (!wspN)
    return;

  SAVE_SESS *sess = tzmalloc(SAVE_SESS, 1);

  GtkWidget *main_window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
  gtk_window_set_has_resize_grip(GTK_WINDOW(main_window), FALSE);
  sess->win = main_window;

  gtk_window_set_default_size(GTK_WINDOW (main_window), 20, 10);

  gtk_window_set_title(GTK_WINDOW(main_window), _(_L("加片語到詞庫")));

#if 0
  g_signal_connect (G_OBJECT (main_window), "delete_event",
                     G_CALLBACK (delete_event), sess);
#endif

  GtkWidget *vbox = gtk_vbox_new (FALSE, 0);
  gtk_orientable_set_orientation(GTK_ORIENTABLE(vbox), GTK_ORIENTATION_VERTICAL);
  gtk_container_add (GTK_CONTAINER (main_window), vbox);

  char tt[512];
  tt[0] = 0;
  wsp_str(wsp, wspN, tt);

  gtk_box_pack_start (GTK_BOX (vbox), gtk_label_new(tt), FALSE, FALSE, 0);

  int i;
  for(i=0; i<wspN; i++) {
    if (ph_key_sz==2)
      strcat(tt, phokey_to_str(wsp[i].key));
    strcat(tt, " ");
  }

  if (tt[0])
    gtk_box_pack_start (GTK_BOX (vbox), gtk_label_new(tt), FALSE, FALSE, 0);

  sess->mywsp = tmemdup(wsp, WSP_S, wspN);
  sess->mywspN = wspN;

  GtkWidget *hbox_cancel_ok = gtk_hbox_new (FALSE, 10);
  gtk_box_pack_start (GTK_BOX (vbox), hbox_cancel_ok , FALSE, FALSE, 5);

  GtkWidget *button_ok = gtk_button_new_from_stock (GTK_STOCK_OK);
  gtk_box_pack_start (GTK_BOX (hbox_cancel_ok), button_ok, TRUE, TRUE, 5);

  GtkWidget *button_cancel = gtk_button_new_from_stock (GTK_STOCK_CANCEL);
  gtk_box_pack_start (GTK_BOX (hbox_cancel_ok), button_cancel, TRUE, TRUE, 0);

  sess->label_countdown = gtk_label_new(NULL);
  gtk_box_pack_start (GTK_BOX (vbox), sess->label_countdown, FALSE, FALSE, 5);

#if 1
#if WIN32
  set_no_focus(main_window);
#endif
  gtk_widget_realize(main_window);
#if UNIX
  set_no_focus(main_window);
#else
  win32_init_win(main_window);
#endif
#endif

//  dbg("mmmmmmmmmmmmm\n");

  GTK_WIDGET_SET_FLAGS (button_ok, GTK_CAN_DEFAULT);
  gtk_widget_grab_default (button_ok);


#if 1
//  dbg("main_window %x\n", main_window);
  g_signal_connect (G_OBJECT (button_cancel), "clicked",
                            G_CALLBACK (close_win_save_phrase),
                            sess);

  g_signal_connect (G_OBJECT (button_ok), "clicked",
                            G_CALLBACK (cb_ok),
                            sess);
#endif

  gtk_window_present(GTK_WINDOW(main_window));
  gtk_window_set_keep_above(GTK_WINDOW(main_window), TRUE);
//  gtk_window_set_modal(GTK_WINDOW(main_window), TRUE);

  sess->countdown = 3;
  disp_countdown(sess);
  sess->countdown_handle = g_timeout_add(1000, timeout_countdown, sess);
  gtk_widget_show_all(main_window);
}
开发者ID:CarterTsai,项目名称:hime,代码行数:98,代码来源:win-save-phrase.cpp

示例4: create_vmmstatus

GtkWidget*
create_vmmstatus (void)
{
  GtkWidget *vmmstatus;
  GtkWidget *dialog_vbox1;
  GtkWidget *vbox1;
  GtkWidget *hbox1;
  GtkWidget *label1;
  GtkWidget *label5;
  GtkWidget *label2;
  GtkWidget *label3;
  GtkWidget *dialog_action_area1;
  GtkWidget *closebutton1;

  vmmstatus = gtk_dialog_new ();
  gtk_window_set_title (GTK_WINDOW (vmmstatus), _("VMM Status"));
  gtk_window_set_default_size (GTK_WINDOW (vmmstatus), 384, 384);
  gtk_window_set_destroy_with_parent (GTK_WINDOW (vmmstatus), TRUE);
  gtk_window_set_type_hint (GTK_WINDOW (vmmstatus), GDK_WINDOW_TYPE_HINT_DIALOG);

  dialog_vbox1 = GTK_DIALOG (vmmstatus)->vbox;
  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);

  hbox1 = gtk_hbox_new (FALSE, 0);
  gtk_widget_show (hbox1);
  gtk_box_pack_start (GTK_BOX (vbox1), hbox1, FALSE, TRUE, 0);

  label1 = gtk_label_new (_("Status:"));
  gtk_widget_show (label1);
  gtk_box_pack_start (GTK_BOX (hbox1), label1, FALSE, FALSE, 0);
  gtk_misc_set_padding (GTK_MISC (label1), 12, 12);

  label5 = gtk_label_new ("");
  gtk_widget_show (label5);
  gtk_box_pack_start (GTK_BOX (hbox1), label5, TRUE, FALSE, 0);

  label2 = gtk_label_new ("");
  gtk_widget_show (label2);
  gtk_box_pack_start (GTK_BOX (hbox1), label2, FALSE, FALSE, 0);
  gtk_misc_set_padding (GTK_MISC (label2), 12, 12);

  label3 = gtk_label_new ("");
  gtk_widget_show (label3);
  gtk_box_pack_start (GTK_BOX (vbox1), label3, TRUE, TRUE, 0);
  gtk_misc_set_alignment (GTK_MISC (label3), 0, 0);
  gtk_misc_set_padding (GTK_MISC (label3), 12, 12);

  dialog_action_area1 = GTK_DIALOG (vmmstatus)->action_area;
  gtk_widget_show (dialog_action_area1);
  gtk_button_box_set_layout (GTK_BUTTON_BOX (dialog_action_area1), GTK_BUTTONBOX_END);

  closebutton1 = gtk_button_new_from_stock ("gtk-close");
  gtk_widget_show (closebutton1);
  gtk_dialog_add_action_widget (GTK_DIALOG (vmmstatus), closebutton1, GTK_RESPONSE_CLOSE);
  GTK_WIDGET_SET_FLAGS (closebutton1, GTK_CAN_DEFAULT);

  g_signal_connect ((gpointer) vmmstatus, "destroy",
                    G_CALLBACK (on_dialog1_destroy),
                    NULL);
  g_signal_connect ((gpointer) closebutton1, "clicked",
                    G_CALLBACK (on_closebutton1_clicked),
                    NULL);

  /* Store pointers to all widgets, for use by lookup_widget(). */
  GLADE_HOOKUP_OBJECT_NO_REF (vmmstatus, vmmstatus, "vmmstatus");
  GLADE_HOOKUP_OBJECT_NO_REF (vmmstatus, dialog_vbox1, "dialog_vbox1");
  GLADE_HOOKUP_OBJECT (vmmstatus, vbox1, "vbox1");
  GLADE_HOOKUP_OBJECT (vmmstatus, hbox1, "hbox1");
  GLADE_HOOKUP_OBJECT (vmmstatus, label1, "label1");
  GLADE_HOOKUP_OBJECT (vmmstatus, label5, "label5");
  GLADE_HOOKUP_OBJECT (vmmstatus, label2, "label2");
  GLADE_HOOKUP_OBJECT (vmmstatus, label3, "label3");
  GLADE_HOOKUP_OBJECT_NO_REF (vmmstatus, dialog_action_area1, "dialog_action_area1");
  GLADE_HOOKUP_OBJECT (vmmstatus, closebutton1, "closebutton1");

  return vmmstatus;
}
开发者ID:anbangr,项目名称:bitvisor-dev,代码行数:81,代码来源:interface.c

示例5: gtk_dialog_new


//.........这里部分代码省略.........
                    (GtkAttachOptions) (GTK_EXPAND | GTK_FILL),
                    (GtkAttachOptions) (0), 0, 0);
  gtk_spin_button_set_numeric (GTK_SPIN_BUTTON (spinImax), TRUE);

  spinPmin_adj = gtk_adjustment_new (2, 2, 31, 1, 10, 0);
  spinPmin = gtk_spin_button_new (GTK_ADJUSTMENT (spinPmin_adj), 1, 0);
  gtk_widget_show (spinPmin);
  gtk_table_attach (GTK_TABLE (table3), spinPmin, 1, 2, 2, 3,
                    (GtkAttachOptions) (GTK_EXPAND | GTK_FILL),
                    (GtkAttachOptions) (0), 0, 0);
  gtk_spin_button_set_numeric (GTK_SPIN_BUTTON (spinPmin), TRUE);

  spinPmax_adj = gtk_adjustment_new (2, 2, 31, 1, 10, 0);
  spinPmax = gtk_spin_button_new (GTK_ADJUSTMENT (spinPmax_adj), 1, 0);
  gtk_widget_show (spinPmax);
  gtk_table_attach (GTK_TABLE (table3), spinPmax, 1, 2, 3, 4,
                    (GtkAttachOptions) (GTK_EXPAND | GTK_FILL),
                    (GtkAttachOptions) (0), 0, 0);
  gtk_spin_button_set_numeric (GTK_SPIN_BUTTON (spinPmax), TRUE);

  label3 = gtk_label_new (QT_TR_NOOP("Quantizer"));
  gtk_widget_show (label3);
  gtk_notebook_set_tab_label (GTK_NOTEBOOK (notebook1), gtk_notebook_get_nth_page (GTK_NOTEBOOK (notebook1), 2), label3);
  gtk_label_set_justify (GTK_LABEL (label3), GTK_JUSTIFY_LEFT);

  label13 = gtk_label_new (QT_TR_NOOP("Not Yet!"));
  gtk_widget_show (label13);
  gtk_container_add (GTK_CONTAINER (notebook1), label13);
  gtk_label_set_justify (GTK_LABEL (label13), GTK_JUSTIFY_LEFT);

  label4 = gtk_label_new (QT_TR_NOOP("B Frames"));
  gtk_widget_show (label4);
  gtk_notebook_set_tab_label (GTK_NOTEBOOK (notebook1), gtk_notebook_get_nth_page (GTK_NOTEBOOK (notebook1), 3), label4);
  gtk_label_set_justify (GTK_LABEL (label4), GTK_JUSTIFY_LEFT);

  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, notebook1, "notebook1");
  GLADE_HOOKUP_OBJECT (dialog1, table1, "table1");
  GLADE_HOOKUP_OBJECT (dialog1, radioCQ, "radioCQ");
  GLADE_HOOKUP_OBJECT (dialog1, radioCBR, "radioCBR");
  GLADE_HOOKUP_OBJECT (dialog1, radio2Pass, "radio2Pass");
  GLADE_HOOKUP_OBJECT (dialog1, entryCQ, "entryCQ");
  GLADE_HOOKUP_OBJECT (dialog1, entryCBR, "entryCBR");
  GLADE_HOOKUP_OBJECT (dialog1, entry2Pass, "entry2Pass");
  GLADE_HOOKUP_OBJECT (dialog1, label1, "label1");
  GLADE_HOOKUP_OBJECT (dialog1, table2, "table2");
  GLADE_HOOKUP_OBJECT (dialog1, label5, "label5");
  GLADE_HOOKUP_OBJECT (dialog1, label6, "label6");
  GLADE_HOOKUP_OBJECT (dialog1, label7, "label7");
  GLADE_HOOKUP_OBJECT (dialog1, spinbuttonMaxIFrame, "spinbuttonMaxIFrame");
  GLADE_HOOKUP_OBJECT (dialog1, label8, "label8");
  GLADE_HOOKUP_OBJECT (dialog1, spinbuttonMinIFrame, "spinbuttonMinIFrame");
  GLADE_HOOKUP_OBJECT (dialog1, optionME, "optionME");
  GLADE_HOOKUP_OBJECT (dialog1, menu4, "menu4");
  GLADE_HOOKUP_OBJECT (dialog1, _0___none1, "_0___none1");
  GLADE_HOOKUP_OBJECT (dialog1, _1__very_low1, "_1__very_low1");
  GLADE_HOOKUP_OBJECT (dialog1, _2__low1, "_2__low1");
  GLADE_HOOKUP_OBJECT (dialog1, _3__medium1, "_3__medium1");
  GLADE_HOOKUP_OBJECT (dialog1, _4__high1, "_4__high1");
  GLADE_HOOKUP_OBJECT (dialog1, _5__very_high1, "_5__very_high1");
  GLADE_HOOKUP_OBJECT (dialog1, _6__ultra_high1, "_6__ultra_high1");
  GLADE_HOOKUP_OBJECT (dialog1, optionQzer, "optionQzer");
  GLADE_HOOKUP_OBJECT (dialog1, menu5, "menu5");
  GLADE_HOOKUP_OBJECT (dialog1, h263_quantizer1, "h263_quantizer1");
  GLADE_HOOKUP_OBJECT (dialog1, mpeg_quantizer1, "mpeg_quantizer1");
  GLADE_HOOKUP_OBJECT (dialog1, label2, "label2");
  GLADE_HOOKUP_OBJECT (dialog1, table3, "table3");
  GLADE_HOOKUP_OBJECT (dialog1, label9, "label9");
  GLADE_HOOKUP_OBJECT (dialog1, label10, "label10");
  GLADE_HOOKUP_OBJECT (dialog1, label11, "label11");
  GLADE_HOOKUP_OBJECT (dialog1, label12, "label12");
  GLADE_HOOKUP_OBJECT (dialog1, spinImin, "spinImin");
  GLADE_HOOKUP_OBJECT (dialog1, spinImax, "spinImax");
  GLADE_HOOKUP_OBJECT (dialog1, spinPmin, "spinPmin");
  GLADE_HOOKUP_OBJECT (dialog1, spinPmax, "spinPmax");
  GLADE_HOOKUP_OBJECT (dialog1, label3, "label3");
  GLADE_HOOKUP_OBJECT (dialog1, label13, "label13");
  GLADE_HOOKUP_OBJECT (dialog1, label4, "label4");
  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;
}
开发者ID:BackupTheBerlios,项目名称:avidemux-svn,代码行数:101,代码来源:DIA_xvid.cpp

示例6: create_dialog1


//.........这里部分代码省略.........
  gtk_misc_set_alignment (GTK_MISC (label10), 0, 0.5);

  label7 = gtk_label_new_with_mnemonic (QT_TR_NOOP("_Weight:"));
  gtk_widget_show (label7);
  gtk_table_attach (GTK_TABLE (table3), label7, 0, 1, 4, 5,
                    (GtkAttachOptions) (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);

  hscaleGammaB = gtk_hscale_new (GTK_ADJUSTMENT (gtk_adjustment_new (1, 0.1, 3, 0.05, 1, 0)));
  gtk_widget_show (hscaleGammaB);
  gtk_table_attach (GTK_TABLE (table3), hscaleGammaB, 1, 2, 3, 4,
                    (GtkAttachOptions) (GTK_FILL),
                    (GtkAttachOptions) (GTK_FILL), 0, 0);
  gtk_widget_set_size_request (hscaleGammaB, 144, 0);
  gtk_scale_set_value_pos (GTK_SCALE (hscaleGammaB), GTK_POS_RIGHT);
  gtk_scale_set_digits (GTK_SCALE (hscaleGammaB), 2);

  hscaleGammaWeight = gtk_hscale_new (GTK_ADJUSTMENT (gtk_adjustment_new (1, 0, 1, 0.05, 1, 0)));
  gtk_widget_show (hscaleGammaWeight);
  gtk_table_attach (GTK_TABLE (table3), hscaleGammaWeight, 1, 2, 4, 5,
                    (GtkAttachOptions) (GTK_FILL),
                    (GtkAttachOptions) (GTK_FILL), 0, 0);
  gtk_widget_set_size_request (hscaleGammaWeight, 144, 0);
  gtk_scale_set_value_pos (GTK_SCALE (hscaleGammaWeight), GTK_POS_RIGHT);
  gtk_scale_set_digits (GTK_SCALE (hscaleGammaWeight), 2);

  label2 = gtk_label_new (QT_TR_NOOP("<b>Gamma</b>"));
  gtk_widget_show (label2);
  gtk_frame_set_label_widget (GTK_FRAME (frame2), label2);
  gtk_label_set_use_markup (GTK_LABEL (label2), TRUE);
  gtk_label_set_justify (GTK_LABEL (label2), GTK_JUSTIFY_LEFT);

  hscale1 = gtk_hscale_new (GTK_ADJUSTMENT (gtk_adjustment_new (0, 0, 100, 1, 1, 0)));
  gtk_widget_show (hscale1);
  gtk_box_pack_start (GTK_BOX (vbox1), hscale1, FALSE, FALSE, 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);

  gtk_label_set_mnemonic_widget (GTK_LABEL (label4), hscaleBrightness);
  gtk_label_set_mnemonic_widget (GTK_LABEL (label5), hscaleSaturation);
  gtk_label_set_mnemonic_widget (GTK_LABEL (label3), hscaleContrast);
  gtk_label_set_mnemonic_widget (GTK_LABEL (label6), hscaleGamma);
  gtk_label_set_mnemonic_widget (GTK_LABEL (label8), hscaleGammaR);
  gtk_label_set_mnemonic_widget (GTK_LABEL (label9), hscaleGammaG);
  gtk_label_set_mnemonic_widget (GTK_LABEL (label10), hscaleGammaB);
  gtk_label_set_mnemonic_widget (GTK_LABEL (label7), hscaleGammaWeight);

  /* 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, hbox1, "hbox1");
  GLADE_HOOKUP_OBJECT (dialog1, frame1, "frame1");
  GLADE_HOOKUP_OBJECT (dialog1, table2, "table2");
  GLADE_HOOKUP_OBJECT (dialog1, label4, "label4");
  GLADE_HOOKUP_OBJECT (dialog1, label5, "label5");
  GLADE_HOOKUP_OBJECT (dialog1, hscaleBrightness, "hscaleBrightness");
  GLADE_HOOKUP_OBJECT (dialog1, hscaleSaturation, "hscaleSaturation");
  GLADE_HOOKUP_OBJECT (dialog1, hscaleContrast, "hscaleContrast");
  GLADE_HOOKUP_OBJECT (dialog1, label3, "label3");
  GLADE_HOOKUP_OBJECT (dialog1, label1, "label1");
  GLADE_HOOKUP_OBJECT (dialog1, frame2, "frame2");
  GLADE_HOOKUP_OBJECT (dialog1, table3, "table3");
  GLADE_HOOKUP_OBJECT (dialog1, label6, "label6");
  GLADE_HOOKUP_OBJECT (dialog1, hscaleGamma, "hscaleGamma");
  GLADE_HOOKUP_OBJECT (dialog1, hscaleGammaR, "hscaleGammaR");
  GLADE_HOOKUP_OBJECT (dialog1, label8, "label8");
  GLADE_HOOKUP_OBJECT (dialog1, hscaleGammaG, "hscaleGammaG");
  GLADE_HOOKUP_OBJECT (dialog1, label9, "label9");
  GLADE_HOOKUP_OBJECT (dialog1, label10, "label10");
  GLADE_HOOKUP_OBJECT (dialog1, label7, "label7");
  GLADE_HOOKUP_OBJECT (dialog1, hscaleGammaB, "hscaleGammaB");
  GLADE_HOOKUP_OBJECT (dialog1, hscaleGammaWeight, "hscaleGammaWeight");
  GLADE_HOOKUP_OBJECT (dialog1, label2, "label2");
  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;
}
开发者ID:BackupTheBerlios,项目名称:avidemux-svn,代码行数:101,代码来源:DIA_eq2.cpp

示例7: create_TextProfileDialog

void create_TextProfileDialog (CTextProfile *tp)
{
    GtkWidget *TextEncoderDialog;
    GtkWidget *dialog_vbox11;
    GtkWidget *table8;
    GtkWidget *TextEncodingOptionMenu;
    GtkWidget *label211;
    GtkWidget *label212;
    GtkObject *TextRepeatTimeSpinner_adj;
    GtkWidget *TextRepeatTimeSpinner;
    GtkWidget *label213;
    GtkWidget *TextProfileEntry;
    GtkWidget *dialog_action_area10;
    GtkWidget *cancelbutton8;
    GtkWidget *okbutton10;

    TextEncoderDialog = gtk_dialog_new();
    gtk_window_set_title(GTK_WINDOW(TextEncoderDialog), _("Text Encoder"));
    gtk_window_set_modal(GTK_WINDOW(TextEncoderDialog), TRUE);
    gtk_window_set_resizable(GTK_WINDOW(TextEncoderDialog), FALSE);

    dialog_vbox11 = GTK_DIALOG(TextEncoderDialog)->vbox;
    gtk_widget_show(dialog_vbox11);

    table8 = gtk_table_new(3, 2, TRUE);
    gtk_widget_show(table8);
    gtk_box_pack_start(GTK_BOX(dialog_vbox11), table8, TRUE, TRUE, 0);
    gtk_table_set_row_spacings(GTK_TABLE(table8), 11);
    gtk_table_set_col_spacings(GTK_TABLE(table8), 7);

    TextEncodingOptionMenu = gtk_option_menu_new();
    gtk_widget_show(TextEncodingOptionMenu);
    gtk_table_attach(GTK_TABLE(table8), TextEncodingOptionMenu, 1, 2, 1, 2,
                     (GtkAttachOptions)(GTK_FILL),
                     (GtkAttachOptions)(0), 0, 0);

    label211 = gtk_label_new(_("Text Encoder:"));
    gtk_widget_show(label211);
    gtk_table_attach(GTK_TABLE(table8), label211, 0, 1, 1, 2,
                     (GtkAttachOptions)(GTK_FILL),
                     (GtkAttachOptions)(0), 0, 0);
    gtk_misc_set_alignment(GTK_MISC(label211), 0, 0.5);

    label212 = gtk_label_new(_("Repeat Time:"));
    gtk_widget_show(label212);
    gtk_table_attach(GTK_TABLE(table8), label212, 0, 1, 2, 3,
                     (GtkAttachOptions)(GTK_FILL),
                     (GtkAttachOptions)(0), 0, 0);
    gtk_misc_set_alignment(GTK_MISC(label212), 0, 0.5);

    TextRepeatTimeSpinner_adj = gtk_adjustment_new(tp != NULL ? tp->GetFloatValue(CFG_TEXT_REPEAT_TIME_SECS) : 1, 0, 100, 1, 10, 10);
    TextRepeatTimeSpinner = gtk_spin_button_new(GTK_ADJUSTMENT(TextRepeatTimeSpinner_adj), 1, 1);
    gtk_widget_show(TextRepeatTimeSpinner);
    gtk_table_attach(GTK_TABLE(table8), TextRepeatTimeSpinner, 1, 2, 2, 3,
                     (GtkAttachOptions)(GTK_EXPAND | GTK_FILL),
                     (GtkAttachOptions)(0), 0, 0);
    gtk_spin_button_set_numeric(GTK_SPIN_BUTTON(TextRepeatTimeSpinner), TRUE);

    label213 = gtk_label_new(_("Text Profile:"));
    gtk_widget_show(label213);
    gtk_table_attach(GTK_TABLE(table8), label213, 0, 1, 0, 1,
                     (GtkAttachOptions)(GTK_FILL),
                     (GtkAttachOptions)(0), 0, 0);
    gtk_misc_set_alignment(GTK_MISC(label213), 0, 0.5);

    TextProfileEntry = gtk_entry_new();
    gtk_widget_show (TextProfileEntry);
    gtk_table_attach (GTK_TABLE(table8), TextProfileEntry, 1, 2, 0, 1,
                      (GtkAttachOptions)(GTK_EXPAND | GTK_FILL),
                      (GtkAttachOptions)(0), 0, 0);

    dialog_action_area10 = GTK_DIALOG(TextEncoderDialog)->action_area;
    gtk_widget_show(dialog_action_area10);
    gtk_button_box_set_layout(GTK_BUTTON_BOX(dialog_action_area10), GTK_BUTTONBOX_END);

    cancelbutton8 = gtk_button_new_from_stock("gtk-cancel");
    gtk_widget_show(cancelbutton8);
    gtk_dialog_add_action_widget(GTK_DIALOG(TextEncoderDialog), cancelbutton8, GTK_RESPONSE_CANCEL);
    GTK_WIDGET_SET_FLAGS(cancelbutton8, GTK_CAN_DEFAULT);

    okbutton10 = gtk_button_new_from_stock("gtk-ok");
    gtk_widget_show(okbutton10);
    gtk_dialog_add_action_widget(GTK_DIALOG(TextEncoderDialog), okbutton10, GTK_RESPONSE_OK);
    GTK_WIDGET_SET_FLAGS(okbutton10, GTK_CAN_DEFAULT);

    g_signal_connect((gpointer) TextEncoderDialog, "response",
                     G_CALLBACK(on_TextEncoderDialog_response),
                     tp);

    /* Store pointers to all widgets, for use by lookup_widget(). */
    GLADE_HOOKUP_OBJECT_NO_REF(TextEncoderDialog, TextEncoderDialog, "TextEncoderDialog");
    GLADE_HOOKUP_OBJECT_NO_REF(TextEncoderDialog, dialog_vbox11, "dialog_vbox11");
    GLADE_HOOKUP_OBJECT(TextEncoderDialog, table8, "table8");
    GLADE_HOOKUP_OBJECT(TextEncoderDialog, TextEncodingOptionMenu, "TextEncodingOptionMenu");
    GLADE_HOOKUP_OBJECT(TextEncoderDialog, label211, "label211");
    GLADE_HOOKUP_OBJECT(TextEncoderDialog, label212, "label212");
    GLADE_HOOKUP_OBJECT(TextEncoderDialog, TextRepeatTimeSpinner, "TextRepeatTimeSpinner");
    GLADE_HOOKUP_OBJECT (TextEncoderDialog, label213, "label213");
    GLADE_HOOKUP_OBJECT (TextEncoderDialog, TextProfileEntry, "TextProfileEntry");
    GLADE_HOOKUP_OBJECT_NO_REF(TextEncoderDialog, dialog_action_area10, "dialog_action_area10");
//.........这里部分代码省略.........
开发者ID:qmwd2006,项目名称:mpeg4ip,代码行数:101,代码来源:text_dialog.cpp

示例8: create_dialog1


//.........这里部分代码省略.........

    label4 = gtk_label_new (QT_TR_NOOP("Select Language :"));
    gtk_widget_show (label4);
    gtk_table_attach (GTK_TABLE (table1), label4, 0, 1, 1, 2,
                      (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);

    optionmenu1 = gtk_option_menu_new ();
    gtk_widget_show (optionmenu1);
    gtk_table_attach (GTK_TABLE (table1), optionmenu1, 1, 2, 1, 2,
                      (GtkAttachOptions) (GTK_FILL),
                      (GtkAttachOptions) (0), 0, 0);

    label2 = gtk_label_new (QT_TR_NOOP("Select Sub"));
    gtk_widget_show (label2);
    gtk_frame_set_label_widget (GTK_FRAME (frame1), label2);
    gtk_label_set_justify (GTK_LABEL (label2), GTK_JUSTIFY_LEFT);

    frame2 = gtk_frame_new (NULL);
    gtk_widget_show (frame2);
    gtk_box_pack_start (GTK_BOX (vbox1), frame2, TRUE, TRUE, 0);

    table2 = gtk_table_new (2, 2, FALSE);
    gtk_widget_show (table2);
    gtk_container_add (GTK_CONTAINER (frame2), table2);

    label6 = gtk_label_new (QT_TR_NOOP("Extra Shrink Factor :"));
    gtk_widget_show (label6);
    gtk_table_attach (GTK_TABLE (table2), label6, 0, 1, 0, 1,
                      (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);

    spinbutton1_adj = gtk_adjustment_new (1, 1, 2, 0.1, 0.2, 0.2);
    spinbutton1 = gtk_spin_button_new (GTK_ADJUSTMENT (spinbutton1_adj), 1, 0);
    gtk_widget_show (spinbutton1);
    gtk_table_attach (GTK_TABLE (table2), spinbutton1, 1, 2, 0, 1,
                      (GtkAttachOptions) (GTK_EXPAND | GTK_FILL),
                      (GtkAttachOptions) (0), 0, 0);

    label7 = gtk_label_new (QT_TR_NOOP("Shift (ms) :"));
    gtk_widget_show (label7);
    gtk_table_attach (GTK_TABLE (table2), label7, 0, 1, 1, 2,
                      (GtkAttachOptions) (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);

    entryShift = gtk_entry_new ();
    gtk_widget_show (entryShift);
    gtk_table_attach (GTK_TABLE (table2), entryShift, 1, 2, 1, 2,
                      (GtkAttachOptions) (GTK_EXPAND | GTK_FILL),
                      (GtkAttachOptions) (0), 0, 0);

    label5 = gtk_label_new (QT_TR_NOOP("Extra Settings"));
    gtk_widget_show (label5);
    gtk_frame_set_label_widget (GTK_FRAME (frame2), label5);
    gtk_label_set_justify (GTK_LABEL (label5), GTK_JUSTIFY_LEFT);

    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, frame1, "frame1");
    GLADE_HOOKUP_OBJECT (dialog1, table1, "table1");
    GLADE_HOOKUP_OBJECT (dialog1, buttonSelect, "buttonSelect");
    GLADE_HOOKUP_OBJECT (dialog1, labelVobsub, "labelVobsub");
    GLADE_HOOKUP_OBJECT (dialog1, label4, "label4");
    GLADE_HOOKUP_OBJECT (dialog1, optionmenu1, "optionmenu1");
    GLADE_HOOKUP_OBJECT (dialog1, label2, "label2");
    GLADE_HOOKUP_OBJECT (dialog1, frame2, "frame2");
    GLADE_HOOKUP_OBJECT (dialog1, table2, "table2");
    GLADE_HOOKUP_OBJECT (dialog1, label6, "label6");
    GLADE_HOOKUP_OBJECT (dialog1, spinbutton1, "spinbutton1");
    GLADE_HOOKUP_OBJECT (dialog1, label7, "label7");
    GLADE_HOOKUP_OBJECT (dialog1, entryShift, "entryShift");
    GLADE_HOOKUP_OBJECT (dialog1, label5, "label5");
    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;
}
开发者ID:BackupTheBerlios,项目名称:avidemux-svn,代码行数:101,代码来源:DIA_vobsub.cpp

示例9: DoMessageBox

int DoMessageBox (const char* lpText, const char* lpCaption, guint32 uType)
{
  GtkWidget *window, *w, *vbox, *hbox;
  int mode = (uType & MB_TYPEMASK), ret, loop = 1;
 
  window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
  gtk_signal_connect (GTK_OBJECT (window), "delete_event",
                      GTK_SIGNAL_FUNC (dialog_delete_callback), NULL);
  gtk_signal_connect (GTK_OBJECT (window), "destroy",
                      GTK_SIGNAL_FUNC (gtk_widget_destroy), NULL);
  gtk_window_set_title (GTK_WINDOW (window), lpCaption);
  gtk_container_border_width (GTK_CONTAINER (window), 10);
  g_object_set_data (G_OBJECT (window), "loop", &loop);
  g_object_set_data (G_OBJECT (window), "ret", &ret);
  gtk_widget_realize (window);
 
  vbox = gtk_vbox_new (FALSE, 10);
  gtk_container_add (GTK_CONTAINER (window), vbox);
  gtk_widget_show (vbox);
 
  w = gtk_label_new (lpText);
  gtk_box_pack_start (GTK_BOX (vbox), w, FALSE, FALSE, 2);
  gtk_label_set_justify (GTK_LABEL (w), GTK_JUSTIFY_LEFT);
  gtk_widget_show (w);
 
  w = gtk_hseparator_new ();
  gtk_box_pack_start (GTK_BOX (vbox), w, FALSE, FALSE, 2);
  gtk_widget_show (w);
 
  hbox = gtk_hbox_new (FALSE, 10);
  gtk_box_pack_start (GTK_BOX (vbox), hbox, FALSE, FALSE, 2);
  gtk_widget_show (hbox);
 
  if (mode == MB_OK)
  {
    w = gtk_button_new_with_label ("Ok");
    gtk_box_pack_start (GTK_BOX (hbox), w, TRUE, TRUE, 0);
    gtk_signal_connect (GTK_OBJECT (w), "clicked",
                        GTK_SIGNAL_FUNC (dialog_button_callback), GINT_TO_POINTER (IDOK));
    GTK_WIDGET_SET_FLAGS (w, GTK_CAN_DEFAULT);
    gtk_widget_grab_default (w);
    gtk_widget_show (w);
    ret = IDOK;
  }
  else if (mode ==  MB_OKCANCEL)
  {
    w = gtk_button_new_with_label ("Ok");
    gtk_box_pack_start (GTK_BOX (hbox), w, TRUE, TRUE, 0);
    gtk_signal_connect (GTK_OBJECT (w), "clicked",
                        GTK_SIGNAL_FUNC (dialog_button_callback), GINT_TO_POINTER (IDOK));
    GTK_WIDGET_SET_FLAGS (w, GTK_CAN_DEFAULT);
    gtk_widget_grab_default (w);
    gtk_widget_show (w);
 
    w = gtk_button_new_with_label ("Cancel");
    gtk_box_pack_start (GTK_BOX (hbox), w, TRUE, TRUE, 0);
    gtk_signal_connect (GTK_OBJECT (w), "clicked",
                        GTK_SIGNAL_FUNC (dialog_button_callback), GINT_TO_POINTER (IDCANCEL));
    gtk_widget_show (w);
    ret = IDCANCEL;
  }
  else if (mode == MB_YESNOCANCEL)
  {
    w = gtk_button_new_with_label ("Yes");
    gtk_box_pack_start (GTK_BOX (hbox), w, TRUE, TRUE, 0);
    gtk_signal_connect (GTK_OBJECT (w), "clicked",
                        GTK_SIGNAL_FUNC (dialog_button_callback), GINT_TO_POINTER (IDYES));
    GTK_WIDGET_SET_FLAGS (w, GTK_CAN_DEFAULT);
    gtk_widget_grab_default (w);
    gtk_widget_show (w);
 
    w = gtk_button_new_with_label ("No");
    gtk_box_pack_start (GTK_BOX (hbox), w, TRUE, TRUE, 0);
    gtk_signal_connect (GTK_OBJECT (w), "clicked",
                        GTK_SIGNAL_FUNC (dialog_button_callback), GINT_TO_POINTER (IDNO));
    gtk_widget_show (w);
 
    w = gtk_button_new_with_label ("Cancel");
    gtk_box_pack_start (GTK_BOX (hbox), w, TRUE, TRUE, 0);
    gtk_signal_connect (GTK_OBJECT (w), "clicked",
                        GTK_SIGNAL_FUNC (dialog_button_callback), GINT_TO_POINTER (IDCANCEL));
    gtk_widget_show (w);
    ret = IDCANCEL;
  }
  else /* if (mode == MB_YESNO) */
  {
    w = gtk_button_new_with_label ("Yes");
    gtk_box_pack_start (GTK_BOX (hbox), w, TRUE, TRUE, 0);
    gtk_signal_connect (GTK_OBJECT (w), "clicked",
                        GTK_SIGNAL_FUNC (dialog_button_callback), GINT_TO_POINTER (IDYES));
    GTK_WIDGET_SET_FLAGS (w, GTK_CAN_DEFAULT);
    gtk_widget_grab_default (w);
    gtk_widget_show (w);
 
    w = gtk_button_new_with_label ("No");
    gtk_box_pack_start (GTK_BOX (hbox), w, TRUE, TRUE, 0);
    gtk_signal_connect (GTK_OBJECT (w), "clicked",
                        GTK_SIGNAL_FUNC (dialog_button_callback), GINT_TO_POINTER (IDNO));
    gtk_widget_show (w);
    ret = IDNO;
//.........这里部分代码省略.........
开发者ID:AEonZR,项目名称:GtkRadiant,代码行数:101,代码来源:TexTool.cpp

示例10: gtk_accel_group_new


//.........这里部分代码省略.........
                               GTK_ACCEL_VISIBLE);

    // Configuration tab
    stwidgets.configtab = gtk_label_new("Configuration");
    gtk_notebook_set_tab_label(GTK_NOTEBOOK(stwidgets.tabs), gtk_notebook_get_nth_page(GTK_NOTEBOOK(stwidgets.tabs), 0), stwidgets.configtab);

    // Messages scrollable area
    stwidgets.messagesscroll = gtk_scrolled_window_new(NULL, NULL);
    gtk_container_add(GTK_CONTAINER(stwidgets.tabs), stwidgets.messagesscroll);
    gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(stwidgets.messagesscroll), GTK_POLICY_NEVER, GTK_POLICY_ALWAYS);

    // Messages text area
    stwidgets.messagestext = gtk_text_view_new();
    gtk_container_add(GTK_CONTAINER(stwidgets.messagesscroll), stwidgets.messagestext);
    gtk_text_view_set_editable(GTK_TEXT_VIEW(stwidgets.messagestext), FALSE);
    gtk_text_view_set_wrap_mode(GTK_TEXT_VIEW(stwidgets.messagestext), GTK_WRAP_WORD);
    gtk_text_view_set_cursor_visible(GTK_TEXT_VIEW(stwidgets.messagestext), FALSE);
    gtk_text_view_set_left_margin(GTK_TEXT_VIEW(stwidgets.messagestext), 2);
    gtk_text_view_set_right_margin(GTK_TEXT_VIEW(stwidgets.messagestext), 2);

    // Messages tab
    stwidgets.messagestab = gtk_label_new("Messages");
    gtk_notebook_set_tab_label(GTK_NOTEBOOK(stwidgets.tabs), gtk_notebook_get_nth_page(GTK_NOTEBOOK(stwidgets.tabs), 1), stwidgets.messagestab);

    // Dialogue box buttons layout
    stwidgets.buttons = gtk_hbutton_box_new();
    gtk_box_pack_start(GTK_BOX(stwidgets.vlayout), stwidgets.buttons, FALSE, TRUE, 0);
    gtk_container_set_border_width(GTK_CONTAINER(stwidgets.buttons), 3);
    gtk_button_box_set_layout(GTK_BUTTON_BOX(stwidgets.buttons), GTK_BUTTONBOX_END);

    // Cancel button
    stwidgets.cancelbutton = gtk_button_new();
    gtk_container_add(GTK_CONTAINER(stwidgets.buttons), stwidgets.cancelbutton);
    GTK_WIDGET_SET_FLAGS(stwidgets.cancelbutton, GTK_CAN_DEFAULT);
    gtk_widget_add_accelerator(stwidgets.cancelbutton, "grab_focus", stwidgets.accel_group,
                               GDK_C, GDK_MOD1_MASK,
                               GTK_ACCEL_VISIBLE);
    gtk_widget_add_accelerator(stwidgets.cancelbutton, "clicked", stwidgets.accel_group,
                               GDK_Escape, 0,
                               GTK_ACCEL_VISIBLE);

    stwidgets.cancelbuttonalign = gtk_alignment_new(0.5, 0.5, 0, 0);
    gtk_container_add(GTK_CONTAINER(stwidgets.cancelbutton), stwidgets.cancelbuttonalign);

    stwidgets.cancelbuttonlayout = gtk_hbox_new(FALSE, 2);
    gtk_container_add(GTK_CONTAINER(stwidgets.cancelbuttonalign), stwidgets.cancelbuttonlayout);

    stwidgets.cancelbuttonicon = gtk_image_new_from_stock("gtk-cancel", GTK_ICON_SIZE_BUTTON);
    gtk_box_pack_start(GTK_BOX(stwidgets.cancelbuttonlayout), stwidgets.cancelbuttonicon, FALSE, FALSE, 0);

    stwidgets.cancelbuttonlabel = gtk_label_new_with_mnemonic("_Cancel");
    gtk_box_pack_start(GTK_BOX(stwidgets.cancelbuttonlayout), stwidgets.cancelbuttonlabel, FALSE, FALSE, 0);

    // Start button
    stwidgets.startbutton = gtk_button_new();
    gtk_container_add(GTK_CONTAINER(stwidgets.buttons), stwidgets.startbutton);
    GTK_WIDGET_SET_FLAGS(stwidgets.startbutton, GTK_CAN_DEFAULT);
    gtk_widget_add_accelerator(stwidgets.startbutton, "grab_focus", stwidgets.accel_group,
                               GDK_S, GDK_MOD1_MASK,
                               GTK_ACCEL_VISIBLE);
    gtk_widget_add_accelerator(stwidgets.startbutton, "clicked", stwidgets.accel_group,
                               GDK_Return, 0,
                               GTK_ACCEL_VISIBLE);

    stwidgets.startbuttonalign = gtk_alignment_new(0.5, 0.5, 0, 0);
    gtk_container_add(GTK_CONTAINER(stwidgets.startbutton), stwidgets.startbuttonalign);
开发者ID:Daedolon,项目名称:erampage,代码行数:67,代码来源:startgtk.editor.c

示例11: gimp_dialog_create_action_areav

/**
 * gimp_dialog_create_action_areav:
 * @dialog: The #GtkDialog you want to create the action_area for.
 * @args: A @va_list as obtained with va_start() describing the action_area
 *        buttons.
 *
 */
void
gimp_dialog_create_action_areav (GtkDialog *dialog,
				 va_list    args)
{
  GtkWidget *hbbox = NULL;
  GtkWidget *button;

  /*  action area variables  */
  const gchar    *label;
  GtkSignalFunc   callback;
  gpointer        data;
  GtkObject      *slot_object;
  GtkWidget     **widget_ptr;
  gboolean        default_action;
  gboolean        connect_delete;

  gboolean delete_connected = FALSE;

  g_return_if_fail (dialog != NULL);
  g_return_if_fail (GTK_IS_DIALOG (dialog));

  /*  prepare the action_area  */
  label = va_arg (args, const gchar *);

  if (label)
    {
      gtk_container_set_border_width (GTK_CONTAINER (dialog->action_area), 2);
      gtk_box_set_homogeneous (GTK_BOX (dialog->action_area), FALSE);

      hbbox = gtk_hbutton_box_new ();
      gtk_button_box_set_spacing (GTK_BUTTON_BOX (hbbox), 4);
      gtk_box_pack_end (GTK_BOX (dialog->action_area), hbbox, FALSE, FALSE, 0);
      gtk_widget_show (hbbox);
    }

  /*  the action_area buttons  */
  while (label)
    {
      callback       = va_arg (args, GtkSignalFunc);
      data           = va_arg (args, gpointer);
      slot_object    = va_arg (args, GtkObject *);
      widget_ptr     = va_arg (args, GtkWidget **);
      default_action = va_arg (args, gboolean);
      connect_delete = va_arg (args, gboolean);

      button = gtk_button_new_with_label (label);
      GTK_WIDGET_SET_FLAGS (button, GTK_CAN_DEFAULT);
      gtk_box_pack_start (GTK_BOX (hbbox), button, FALSE, FALSE, 0);

      if (slot_object == (GtkObject *) 1)
	slot_object = GTK_OBJECT (dialog);

      if (data == NULL)
	data = dialog;

      if (callback)
	{
	  if (slot_object)
	    gtk_signal_connect_object (GTK_OBJECT (button), "clicked",
				       GTK_SIGNAL_FUNC (callback),
				       slot_object);
	  else
	    gtk_signal_connect (GTK_OBJECT (button), "clicked",
				GTK_SIGNAL_FUNC (callback),
				data);
	}

      if (widget_ptr)
	*widget_ptr = button;

      if (connect_delete && callback && !delete_connected)
	{
	  gtk_object_set_data (GTK_OBJECT (dialog),
			       "gimp_dialog_cancel_callback",
			       callback);
	  gtk_object_set_data (GTK_OBJECT (dialog),
			       "gimp_dialog_cancel_widget",
			       slot_object ? slot_object : GTK_OBJECT (button));

	  /*  catch the WM delete event  */
	  gtk_signal_connect (GTK_OBJECT (dialog), "delete_event",
			      GTK_SIGNAL_FUNC (gimp_dialog_delete_callback),
			      data);

	  delete_connected = TRUE;
	}

      if (default_action)
	gtk_widget_grab_default (button);
      gtk_widget_show (button);

      label = va_arg (args, gchar *);
    }
//.........这里部分代码省略.........
开发者ID:milankni,项目名称:cinepaint-oyranos,代码行数:101,代码来源:dialog.c

示例12: create_bsv_viewer_pref_dlg


//.........这里部分代码省略.........
  gtk_widget_show (hbox21);
  gtk_box_pack_start (GTK_BOX (vbox3), hbox21, FALSE, FALSE, 0);
  gtk_container_set_border_width (GTK_CONTAINER (hbox21), 2);

  label6 = gtk_label_new (_("GDF Logfile: "));
  gtk_widget_show (label6);
  gtk_box_pack_start (GTK_BOX (hbox21), label6, FALSE, FALSE, 0);

  logfile_entry = gtk_entry_new ();
  gtk_widget_show (logfile_entry);
  gtk_box_pack_start (GTK_BOX (hbox21), logfile_entry, TRUE, TRUE, 0);

  button15 = gtk_button_new ();
  gtk_widget_show (button15);
  gtk_box_pack_start (GTK_BOX (hbox21), button15, FALSE, FALSE, 0);

  image17 = gtk_image_new_from_stock ("gtk-floppy", GTK_ICON_SIZE_BUTTON);
  gtk_widget_show (image17);
  gtk_container_add (GTK_CONTAINER (button15), image17);

  hbox22 = gtk_hbox_new (FALSE, 0);
  gtk_widget_show (hbox22);
  gtk_box_pack_start (GTK_BOX (vbox3), hbox22, FALSE, FALSE, 0);
  gtk_container_set_border_width (GTK_CONTAINER (hbox22), 2);

  label7 = gtk_label_new (_("Patient ID: "));
  gtk_widget_show (label7);
  gtk_box_pack_start (GTK_BOX (hbox22), label7, FALSE, FALSE, 0);

  patid_entry = gtk_entry_new ();
  gtk_widget_show (patid_entry);
  gtk_box_pack_start (GTK_BOX (hbox22), patid_entry, TRUE, TRUE, 0);

  hbox23 = gtk_hbox_new (FALSE, 0);
  gtk_widget_show (hbox23);
  gtk_box_pack_start (GTK_BOX (vbox3), hbox23, FALSE, FALSE, 0);
  gtk_container_set_border_width (GTK_CONTAINER (hbox23), 2);

  label8 = gtk_label_new (_("Record ID: "));
  gtk_widget_show (label8);
  gtk_box_pack_start (GTK_BOX (hbox23), label8, FALSE, FALSE, 0);

  recid_entry = gtk_entry_new ();
  gtk_widget_show (recid_entry);
  gtk_box_pack_start (GTK_BOX (hbox23), recid_entry, TRUE, TRUE, 0);

  label2 = gtk_label_new (_("Logfile"));
  gtk_widget_show (label2);
  gtk_notebook_set_tab_label (GTK_NOTEBOOK (notebook1), gtk_notebook_get_nth_page (GTK_NOTEBOOK (notebook1), 1), label2);

  dialog_action_area1 = GTK_DIALOG (bsv_viewer_pref_dlg)->action_area;
  gtk_widget_show (dialog_action_area1);
  gtk_button_box_set_layout (GTK_BUTTON_BOX (dialog_action_area1), GTK_BUTTONBOX_END);

  okbutton1 = gtk_button_new_from_stock ("gtk-ok");
  gtk_widget_show (okbutton1);
  gtk_dialog_add_action_widget (GTK_DIALOG (bsv_viewer_pref_dlg), okbutton1, GTK_RESPONSE_OK);
  GTK_WIDGET_SET_FLAGS (okbutton1, GTK_CAN_DEFAULT);

  g_signal_connect ((gpointer) bsv_viewer_pref_dlg, "delete_event",
                    G_CALLBACK (update_viewer_settings),
                    NULL);
  g_signal_connect ((gpointer) button15, "clicked",
                    G_CALLBACK (show_fs_dlg),
                    NULL);
  g_signal_connect ((gpointer) okbutton1, "clicked",
                    G_CALLBACK (update_viewer_settings_but),
                    NULL);

  /* Store pointers to all widgets, for use by lookup_widget(). */
  GLADE_HOOKUP_OBJECT_NO_REF (bsv_viewer_pref_dlg, bsv_viewer_pref_dlg, "bsv_viewer_pref_dlg");
  GLADE_HOOKUP_OBJECT_NO_REF (bsv_viewer_pref_dlg, dialog_vbox1, "dialog_vbox1");
  GLADE_HOOKUP_OBJECT (bsv_viewer_pref_dlg, notebook1, "notebook1");
  GLADE_HOOKUP_OBJECT (bsv_viewer_pref_dlg, vbox2, "vbox2");
  GLADE_HOOKUP_OBJECT (bsv_viewer_pref_dlg, hbox19, "hbox19");
  GLADE_HOOKUP_OBJECT (bsv_viewer_pref_dlg, label3, "label3");
  GLADE_HOOKUP_OBJECT (bsv_viewer_pref_dlg, chanperscreen_spinb, "chanperscreen_spinb");
  GLADE_HOOKUP_OBJECT (bsv_viewer_pref_dlg, hbox20, "hbox20");
  GLADE_HOOKUP_OBJECT (bsv_viewer_pref_dlg, label4, "label4");
  GLADE_HOOKUP_OBJECT (bsv_viewer_pref_dlg, hrange_spinb, "hrange_spinb");
  GLADE_HOOKUP_OBJECT (bsv_viewer_pref_dlg, label5, "label5");
  GLADE_HOOKUP_OBJECT (bsv_viewer_pref_dlg, label1, "label1");
  GLADE_HOOKUP_OBJECT (bsv_viewer_pref_dlg, vbox3, "vbox3");
  GLADE_HOOKUP_OBJECT (bsv_viewer_pref_dlg, hbox21, "hbox21");
  GLADE_HOOKUP_OBJECT (bsv_viewer_pref_dlg, label6, "label6");
  GLADE_HOOKUP_OBJECT (bsv_viewer_pref_dlg, logfile_entry, "logfile_entry");
  GLADE_HOOKUP_OBJECT (bsv_viewer_pref_dlg, button15, "button15");
  GLADE_HOOKUP_OBJECT (bsv_viewer_pref_dlg, image17, "image17");
  GLADE_HOOKUP_OBJECT (bsv_viewer_pref_dlg, hbox22, "hbox22");
  GLADE_HOOKUP_OBJECT (bsv_viewer_pref_dlg, label7, "label7");
  GLADE_HOOKUP_OBJECT (bsv_viewer_pref_dlg, patid_entry, "patid_entry");
  GLADE_HOOKUP_OBJECT (bsv_viewer_pref_dlg, hbox23, "hbox23");
  GLADE_HOOKUP_OBJECT (bsv_viewer_pref_dlg, label8, "label8");
  GLADE_HOOKUP_OBJECT (bsv_viewer_pref_dlg, recid_entry, "recid_entry");
  GLADE_HOOKUP_OBJECT (bsv_viewer_pref_dlg, label2, "label2");
  GLADE_HOOKUP_OBJECT_NO_REF (bsv_viewer_pref_dlg, dialog_action_area1, "dialog_action_area1");
  GLADE_HOOKUP_OBJECT (bsv_viewer_pref_dlg, okbutton1, "okbutton1");

  return bsv_viewer_pref_dlg;
}
开发者ID:NBT-Analytics,项目名称:Biosig,代码行数:101,代码来源:interface.c

示例13: create_dialog1

GtkWidget*
create_dialog1 (void)
{
  GtkWidget *dialog1;
  GtkWidget *dialog_vbox1;
  GtkWidget *vbox1;
  GtkWidget *label1;
  GtkWidget *entryName;
  GtkWidget *label2;
  GtkWidget *entryParam;
  GtkWidget *dialog_action_area1;
  GtkWidget *cancelbutton1;
  GtkWidget *okbutton1;

  dialog1 = gtk_dialog_new ();
  gtk_window_set_title (GTK_WINDOW (dialog1), QT_TR_NOOP("Pipe to"));

  dialog_vbox1 = GTK_DIALOG (dialog1)->vbox;
  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);

  label1 = gtk_label_new (QT_TR_NOOP("Application path/name (/usr/bin/sox...)"));
  gtk_widget_show (label1);
  gtk_box_pack_start (GTK_BOX (vbox1), label1, FALSE, FALSE, 0);
  gtk_label_set_justify (GTK_LABEL (label1), GTK_JUSTIFY_LEFT);

  entryName = gtk_entry_new ();
  gtk_widget_show (entryName);
  gtk_box_pack_start (GTK_BOX (vbox1), entryName, FALSE, FALSE, 0);

  label2 = gtk_label_new (QT_TR_NOOP("Full parameter line"));
  gtk_widget_show (label2);
  gtk_box_pack_start (GTK_BOX (vbox1), label2, FALSE, FALSE, 0);
  gtk_label_set_justify (GTK_LABEL (label2), GTK_JUSTIFY_LEFT);

  entryParam = gtk_entry_new ();
  gtk_widget_show (entryParam);
  gtk_box_pack_start (GTK_BOX (vbox1), entryParam, 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);

  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, label1, "label1");
  GLADE_HOOKUP_OBJECT (dialog1, entryName, "entryName");
  GLADE_HOOKUP_OBJECT (dialog1, label2, "label2");
  GLADE_HOOKUP_OBJECT (dialog1, entryParam, "entryParam");
  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;
}
开发者ID:BackupTheBerlios,项目名称:avidemux-svn,代码行数:70,代码来源:DIA_pipe.cpp

示例14: create_kbm_window


//.........这里部分代码省略.........

  GtkWidget *hbox_tsin_tone_char_input = gtk_hbox_new(FALSE, 0);
  gtk_box_pack_start (GTK_BOX (vbox_r), hbox_tsin_tone_char_input , TRUE, TRUE, 1);
  check_button_tsin_tone_char_input = gtk_check_button_new_with_label(_("(詞音) 輸入注音聲調符號"));
  gtk_box_pack_start (GTK_BOX (hbox_tsin_tone_char_input), check_button_tsin_tone_char_input, FALSE, FALSE, 0);
  gtk_toggle_button_set_active(
     GTK_TOGGLE_BUTTON(check_button_tsin_tone_char_input), tsin_tone_char_input);


  GtkWidget *hbox_tsin_tab_phrase_end = gtk_hbox_new(FALSE, 1);
  gtk_box_pack_start (GTK_BOX (vbox_r), hbox_tsin_tab_phrase_end , TRUE, TRUE, 1);
  check_button_tsin_tab_phrase_end = gtk_check_button_new_with_label(_("(詞音) 使用 Escape/Tab 斷詞"));
  gtk_box_pack_start (GTK_BOX (hbox_tsin_tab_phrase_end), check_button_tsin_tab_phrase_end, FALSE, FALSE, 0);
  gtk_toggle_button_set_active(
     GTK_TOGGLE_BUTTON(check_button_tsin_tab_phrase_end), tsin_tab_phrase_end);

  GtkWidget *hbox_tsin_tail_select_key = gtk_hbox_new(FALSE, 0);
  gtk_box_pack_start (GTK_BOX (vbox_r), hbox_tsin_tail_select_key , TRUE, TRUE, 1);
  check_button_tsin_tail_select_key = gtk_check_button_new_with_label(_("選擇鍵顯示於候選字(詞)後方"));
  gtk_box_pack_start (GTK_BOX (hbox_tsin_tail_select_key), check_button_tsin_tail_select_key, FALSE, FALSE, 0);
  gtk_toggle_button_set_active(
     GTK_TOGGLE_BUTTON(check_button_tsin_tail_select_key), tsin_tail_select_key);

  GtkWidget *hbox_tsin_buffer_editing_mode = gtk_hbox_new(FALSE, 0);
  gtk_box_pack_start (GTK_BOX (vbox_r), hbox_tsin_buffer_editing_mode , TRUE, TRUE, 1);
  check_button_tsin_buffer_editing_mode = gtk_check_button_new_with_label(_("\\ 鍵可切換 jkx 鍵編輯模式"));
  gtk_box_pack_start (GTK_BOX (hbox_tsin_buffer_editing_mode), check_button_tsin_buffer_editing_mode, FALSE, FALSE, 0);
  gtk_toggle_button_set_active(
     GTK_TOGGLE_BUTTON(check_button_tsin_buffer_editing_mode), tsin_buffer_editing_mode);

  GtkWidget *hbox_tsin_use_pho_near = gtk_hbox_new(FALSE, 0);
  gtk_box_pack_start (GTK_BOX (vbox_r), hbox_tsin_use_pho_near , TRUE, TRUE, 1);
  check_button_tsin_use_pho_near = gtk_check_button_new_with_label(_("按下 ↑ 鍵查詢近似音"));
  gtk_box_pack_start (GTK_BOX (hbox_tsin_use_pho_near), check_button_tsin_use_pho_near, FALSE, FALSE, 0);
  gtk_toggle_button_set_active(
     GTK_TOGGLE_BUTTON(check_button_tsin_use_pho_near), tsin_use_pho_near);

  GtkWidget *frame_tsin_buffer_size = gtk_frame_new(_("(詞音) 的編輯緩衝區大小"));
  gtk_box_pack_start (GTK_BOX (vbox_r), frame_tsin_buffer_size, FALSE, FALSE, 0);
  gtk_container_set_border_width (GTK_CONTAINER (frame_tsin_buffer_size), 1);
  GtkAdjustment *adj_gtab_in =
   (GtkAdjustment *) gtk_adjustment_new (tsin_buffer_size, 10.0, MAX_PH_BF, 1.0, 1.0, 0.0);
  spinner_tsin_buffer_size = gtk_spin_button_new (adj_gtab_in, 0, 0);
  gtk_container_add (GTK_CONTAINER (frame_tsin_buffer_size), spinner_tsin_buffer_size);

  GtkWidget *frame_tsin_cursor_color = gtk_frame_new(_("詞音游標的顏色"));
  gtk_box_pack_start (GTK_BOX (vbox_r), frame_tsin_cursor_color, FALSE, FALSE, 0);
  gtk_container_set_border_width (GTK_CONTAINER (frame_tsin_cursor_color), 1);
  GtkWidget *button_tsin_cursor_color = gtk_button_new();
  g_signal_connect (G_OBJECT (button_tsin_cursor_color), "clicked",
                    G_CALLBACK (cb_tsin_cursor_color), G_OBJECT (hime_kbm_window));
  da_cursor =  gtk_drawing_area_new();
  gtk_container_add (GTK_CONTAINER (button_tsin_cursor_color), da_cursor);
  gdk_color_parse(tsin_cursor_color, &tsin_cursor_gcolor);
#if !GTK_CHECK_VERSION(2,91,6)
  gtk_widget_modify_bg(da_cursor, GTK_STATE_NORMAL, &tsin_cursor_gcolor);
#else
  GdkRGBA rgbbg;
  gdk_rgba_parse(&rgbbg, gdk_color_to_string(&tsin_cursor_gcolor));
  gtk_widget_override_background_color(da_cursor, GTK_STATE_FLAG_NORMAL, &rgbbg);
#endif
  gtk_widget_set_size_request(da_cursor, 16, 2);
  gtk_container_add (GTK_CONTAINER (frame_tsin_cursor_color), button_tsin_cursor_color);

  GtkWidget *hbox_cancel_ok = gtk_hbox_new (FALSE, 10);
  gtk_grid_set_column_homogeneous(GTK_GRID(hbox_cancel_ok), TRUE);
  gtk_box_pack_start (GTK_BOX (vbox_top), hbox_cancel_ok , FALSE, FALSE, 5);
  GtkWidget *button_cancel = gtk_button_new_from_stock (GTK_STOCK_CANCEL);
  if (button_order)
    gtk_box_pack_end (GTK_BOX (hbox_cancel_ok), button_cancel, TRUE, TRUE, 0);
  else
    gtk_box_pack_start (GTK_BOX (hbox_cancel_ok), button_cancel, TRUE, TRUE, 0);
  GtkWidget *button_ok = gtk_button_new_from_stock (GTK_STOCK_OK);
#if !GTK_CHECK_VERSION(2,91,2)
  if (button_order)
    gtk_box_pack_end (GTK_BOX (hbox_cancel_ok), button_ok, TRUE, TRUE, 5);
  else
    gtk_box_pack_start (GTK_BOX (hbox_cancel_ok), button_ok, TRUE, TRUE, 5);
#else
  if (button_order)
    gtk_grid_attach_next_to (GTK_BOX (hbox_cancel_ok), button_ok, button_cancel, GTK_POS_LEFT, 1, 1);
  else
    gtk_grid_attach_next_to (GTK_BOX (hbox_cancel_ok), button_ok, button_cancel, GTK_POS_RIGHT, 1, 1);
#endif

  g_signal_connect (G_OBJECT (button_cancel), "clicked",
                            G_CALLBACK (close_kbm_window),
                            G_OBJECT (hime_kbm_window));

  g_signal_connect_swapped (G_OBJECT (button_ok), "clicked",
                            G_CALLBACK (cb_ok),
                            G_OBJECT (hime_kbm_window));

  GTK_WIDGET_SET_FLAGS (button_cancel, GTK_CAN_DEFAULT);
  gtk_widget_grab_default (button_cancel);

  gtk_widget_show_all (hime_kbm_window);

  return;
}
开发者ID:Tetralet,项目名称:hime,代码行数:101,代码来源:hime-setup-pho.c

示例15: create_connect_window


//.........这里部分代码省略.........
	gtk_table_attach(GTK_TABLE(table1), address_entry, 1, 2, 0, 1,
			 (GtkAttachOptions)(GTK_EXPAND | GTK_FILL), 
			 (GtkAttachOptions)0, 0, 0); 

	login_entry = gtk_entry_new();
	gtk_table_attach(GTK_TABLE(table1), login_entry, 1, 2, 1, 2,
			 (GtkAttachOptions)(GTK_EXPAND | GTK_FILL),
			 (GtkAttachOptions)0, 0, 0);
	password_entry = gtk_entry_new();
	gtk_entry_set_visibility(GTK_ENTRY(password_entry), 0);
	gtk_table_attach(GTK_TABLE(table1), password_entry, 1, 2, 2, 3,
			 (GtkAttachOptions)(GTK_EXPAND | GTK_FILL),
			 (GtkAttachOptions)0, 0, 0);

	secure_toggle = gtk_check_button_new_with_label("Secure");
#ifdef CONFIG_HOPE
	gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(secure_toggle), 1);
#else
	gtk_widget_set_sensitive(secure_toggle, 0);
#endif
	cipher_label = gtk_label_new("Cipher:");
	cipher_entry = gtk_entry_new();
#ifdef CONFIG_CIPHER
	gtk_entry_set_text(GTK_ENTRY(cipher_entry), ghtlc->htlc->cipheralg);
#else
	gtk_widget_set_sensitive(cipher_entry, 0);
#endif
	compress_label = gtk_label_new("Compress:");
	compress_entry = gtk_entry_new();
#ifdef CONFIG_COMPRESS
	gtk_entry_set_text(GTK_ENTRY(compress_entry), ghtlc->htlc->compressalg);
#else
	gtk_widget_set_sensitive(compress_entry, 0);
#endif
	gtk_table_attach(GTK_TABLE(table1), secure_toggle, 0, 1, 3, 4,
			 (GtkAttachOptions)(GTK_EXPAND | GTK_FILL),
			 (GtkAttachOptions)0, 0, 0);
	hbox = gtk_hbox_new(0, 0);
	gtk_box_pack_start(GTK_BOX(hbox), cipher_label, 0, 0, 2);
	gtk_box_pack_start(GTK_BOX(hbox), cipher_entry, 0, 0, 2);
	gtk_table_attach(GTK_TABLE(table1), hbox, 1, 2, 3, 4,
			 (GtkAttachOptions)(GTK_EXPAND | GTK_FILL),
			 (GtkAttachOptions)0, 0, 0);
	hbox = gtk_hbox_new(0, 0);
	gtk_box_pack_start(GTK_BOX(hbox), compress_label, 0, 0, 2);
	gtk_box_pack_start(GTK_BOX(hbox), compress_entry, 0, 0, 2);
	gtk_table_attach(GTK_TABLE(table1), hbox, 1, 2, 4, 5,
			 (GtkAttachOptions)(GTK_EXPAND | GTK_FILL),
			 (GtkAttachOptions)0, 0, 0);

	cc = xmalloc(sizeof(struct connect_context));
	cc->ghtlc = ghtlc;
	cc->connect_window = connect_window;
	cc->address_entry = address_entry;
	cc->login_entry = login_entry;
	cc->password_entry = password_entry;
	cc->cipher_entry = cipher_entry;
	cc->compress_entry = compress_entry;
	cc->secure_toggle = secure_toggle;

	bookmarkmenu = gtk_option_menu_new();
	gtk_table_attach(GTK_TABLE(table1), bookmarkmenu, 2, 3, 0, 1,
			 (GtkAttachOptions)0,
			 (GtkAttachOptions)0, 0, 0);
	bookmarkmenu_menu = gtk_menu_new(); 
	list_bookmarks(bookmarkmenu_menu, cc);
	gtk_option_menu_set_menu(GTK_OPTION_MENU(bookmarkmenu), bookmarkmenu_menu);

	hbuttonbox1 = gtk_hbutton_box_new();
	gtk_box_pack_start(GTK_BOX(vbox1), hbuttonbox1, 1, 1, 0);

	save_button = gtk_button_new_with_label("Save...");
	gtk_container_add(GTK_CONTAINER(hbuttonbox1), save_button);
	GTK_WIDGET_SET_FLAGS(save_button, GTK_CAN_DEFAULT);
	gtk_signal_connect_object(GTK_OBJECT(save_button), "clicked",
				  GTK_SIGNAL_FUNC(save_dialog), (gpointer)cc);
  
	button_cancel = gtk_button_new_with_label("Cancel");
	gtk_signal_connect_object(GTK_OBJECT(button_cancel), "clicked",
				  GTK_SIGNAL_FUNC(close_connect_window), (gpointer)cc);
	gtk_container_add(GTK_CONTAINER(hbuttonbox1), button_cancel);
	GTK_WIDGET_SET_FLAGS(button_cancel, GTK_CAN_DEFAULT);
  
	button_connect = gtk_button_new_with_label("Connect");
	gtk_signal_connect_object(GTK_OBJECT(button_connect), "clicked",
				  GTK_SIGNAL_FUNC(server_connect), (gpointer)cc);
	gtk_container_add(GTK_CONTAINER (hbuttonbox1), button_connect);
	GTK_WIDGET_SET_FLAGS(button_connect, GTK_CAN_DEFAULT);

	gtk_signal_connect_object(GTK_OBJECT(address_entry), "activate",
				  GTK_SIGNAL_FUNC(server_connect), (gpointer)cc);
	gtk_signal_connect_object(GTK_OBJECT(login_entry), "activate",
				  GTK_SIGNAL_FUNC(server_connect), (gpointer)cc);
	gtk_signal_connect_object(GTK_OBJECT(password_entry), "activate",
				  GTK_SIGNAL_FUNC(server_connect), (gpointer)cc);

	gtk_widget_show_all(connect_window);

	return cc;
}
开发者ID:Schala,项目名称:mhxd,代码行数:101,代码来源:connect.c


注:本文中的GTK_WIDGET_SET_FLAGS函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。