コード例 #1
0
ファイル: hime-setup-pho.cpp プロジェクト: CarterTsai/hime
static GtkWidget *create_eng_ch_opts()
{

  GtkWidget *hbox = gtk_hbox_new (FALSE, 1);

  opt_eng_ch_opts = gtk_combo_box_new_text ();
#if !GTK_CHECK_VERSION(2,4,0)
  GtkWidget *menu_eng_ch_opts = gtk_menu_new ();
#endif
  gtk_box_pack_start (GTK_BOX (hbox), opt_eng_ch_opts, FALSE, FALSE, 0);

  int i;
  int current_idx = get_currnet_eng_ch_sw_idx();

  for(i=0; i < tsin_eng_ch_swN; i++) {
#if GTK_CHECK_VERSION(2,4,0)
    gtk_combo_box_append_text (GTK_COMBO_BOX_TEXT (opt_eng_ch_opts), _(tsin_eng_ch_sw[i].name));
#else
    GtkWidget *item = gtk_menu_item_new_with_label (_(tsin_eng_ch_sw[i].name));
    gtk_menu_shell_append (GTK_MENU_SHELL (menu_eng_ch_opts), item);
#endif
  }

  dbg("current_idx:%d\n", current_idx);

#if !GTK_CHECK_VERSION(2,4,0)
  gtk_option_menu_set_menu (GTK_OPTION_MENU (opt_eng_ch_opts), menu_eng_ch_opts);
#endif
  gtk_combo_box_set_active (GTK_COMBO_BOX (opt_eng_ch_opts), current_idx);

  return hbox;
}
コード例 #2
0
ファイル: hime-setup-pho.c プロジェクト: Tetralet/hime
static GtkWidget *create_eng_ch_opts()
{

  GtkWidget *hbox = gtk_hbox_new (FALSE, 1);

  opt_eng_ch_opts = gtk_combo_box_new_text ();
  gtk_box_pack_start (GTK_BOX (hbox), opt_eng_ch_opts, FALSE, FALSE, 0);

  int i;
  int current_idx = get_currnet_eng_ch_sw_idx();

  for(i=0; i < tsin_eng_ch_swN; i++) {
    gtk_combo_box_append_text (GTK_COMBO_BOX_TEXT (opt_eng_ch_opts), _(tsin_eng_ch_sw[i].name));
  }

  dbg("current_idx:%d\n", current_idx);

  gtk_combo_box_set_active (GTK_COMBO_BOX (opt_eng_ch_opts), current_idx);

  return hbox;
}
コード例 #3
0
ファイル: hime-setup-pho.c プロジェクト: Explorer09/hime
static GtkWidget *create_eng_ch_opts(gint index)
{

  GtkWidget *hbox = gtk_hbox_new (FALSE, 1);

  opt_eng_ch_opts[index] = gtk_combo_box_new_text ();
  g_signal_connect (G_OBJECT (opt_eng_ch_opts[index]), "changed", G_CALLBACK (update_eng_ch_opts), NULL);
  gtk_box_pack_start (GTK_BOX (hbox), opt_eng_ch_opts[index], FALSE, FALSE, 0);

  int i;
  int current_idx = get_currnet_eng_ch_sw_idx();

  for(i=0; i < tsin_eng_ch_swN; i++) {
    gtk_combo_box_append_text (GTK_COMBO_BOX_TEXT (opt_eng_ch_opts[index]), _(tsin_eng_ch_sw[i].name));
  }

  dbg("current_idx:%d\n", current_idx);

  gtk_combo_box_set_active (GTK_COMBO_BOX (opt_eng_ch_opts[index]), current_idx);

  return hbox;
}