_("Close"), "Close", NULL, NULL, -1);
_("Close Gjiten"), "Close", NULL, NULL, -1);
WordDic *worddic_create() {  GtkWidget *vbox_main;  GtkWidget *dock_main;  GtkWidget *toolbar;  GtkWidget *button_exit;  //  GtkWidget *button_pref;  GtkWidget *button_kanjipad;  GtkWidget *button_kanjidic;  GtkWidget *button_clear;  GtkWidget *button_srch;  //  GtkWidget *button_copy;  //  GtkWidget *button_paste;  GtkWidget *frame_japopt;  GtkWidget *vbox_japopt;  GSList *vbox_japopt_group = NULL;  GSList *dicssearch_group = NULL;  GtkWidget *frame_engopt;  GtkWidget *vbox_engopt;  GSList *vbox_engopt_group = NULL;  GtkWidget *table_gopt;  GtkWidget *frame_gopt;  GtkWidget *hbox_searchlimit;  GtkWidget *hbox_entry;  GtkWidget *label_enter;  GtkWidget *button_search;  GtkWidget *frame_results;  GtkWidget *vbox_results;  GtkWidget *scrolledwin_results;  GtkObject *spinb_searchlimit_adj;  GtkWidget *tmpimage;	if (wordDic == NULL) {		wordDic = g_new0(WordDic, 1);		gjitenApp->worddic = wordDic;	}	else {		gtk_widget_hide(wordDic->window);		gtk_widget_show(wordDic->window);		return wordDic;	}  wordDic->spinb_searchlimit = NULL;  wordDic->radiob_searchdic = NULL;  wordDic->checkb_autoadjust = NULL;  wordDic->checkb_verb = NULL;	worddic_init_history();  Verbinit(); //FIXME: On demand  wordDic->window = gnome_app_new("gjiten", _("Gjiten - WordDic"));  GTK_WIDGET_SET_FLAGS(wordDic->window, GTK_CAN_DEFAULT);  g_signal_connect(G_OBJECT(wordDic->window), "destroy", G_CALLBACK(worddic_close), NULL);  gtk_window_set_default_size(GTK_WINDOW(wordDic->window), 500, 500);  dock_main = GNOME_APP(wordDic->window)->dock;  gtk_widget_show(dock_main);  if (gjitenApp->conf->menubar) gnome_app_create_menus(GNOME_APP(wordDic->window), menubar_uiinfo);  if (gjitenApp->conf->toolbar) {    toolbar = gtk_toolbar_new();    gtk_widget_show(toolbar);    gnome_app_set_toolbar(GNOME_APP(wordDic->window), GTK_TOOLBAR(toolbar));        button_exit = gtk_toolbar_insert_stock(GTK_TOOLBAR(toolbar), GTK_STOCK_CLOSE,																					 _("Close"), "Close", NULL, NULL, -1);		g_signal_connect_swapped(G_OBJECT(button_exit), "clicked", 														 G_CALLBACK(gtk_widget_destroy), wordDic->window);    wordDic->button_back = gtk_toolbar_insert_stock(GTK_TOOLBAR(toolbar), GTK_STOCK_GO_BACK,																										_("Back"), "Back", 																										on_back_clicked, NULL, -1);    gtk_widget_set_sensitive(wordDic->button_back, FALSE);    wordDic->button_forward = gtk_toolbar_insert_stock(GTK_TOOLBAR(toolbar), GTK_STOCK_GO_FORWARD,																											 _("Forward"), "Forward", 																											 on_forward_clicked, NULL, -1);    gtk_widget_set_sensitive(wordDic->button_forward, FALSE);    tmpimage = gtk_image_new_from_file(PIXMAPDIR"/kanjidic.png");    button_kanjidic = gtk_toolbar_append_item(GTK_TOOLBAR(toolbar), _("KanjiDic"),																							_("KanjiDic"), "KanjiDic", tmpimage,																							G_CALLBACK(kanjidic_create), NULL);    tmpimage = gtk_image_new_from_file(PIXMAPDIR"/kanjipad.png");    button_kanjipad = gtk_toolbar_append_item(GTK_TOOLBAR(toolbar), _("KanjiPad"),																							_("KanjiPad"), "KanjiPad", tmpimage,																							G_CALLBACK(gjiten_start_kanjipad), NULL);    button_srch = gtk_toolbar_insert_stock(GTK_TOOLBAR(toolbar), GTK_STOCK_FIND,																					 _("Search"), "Search", 																					 on_text_entered, NULL, -1);		/*		gtk_toolbar_insert_stock(GTK_TOOLBAR(toolbar), GTK_STOCK_NO, 														 _("Show/Hide options"), "Show/Hide options",														 G_CALLBACK(worddic_show_hide_options), NULL, -1);		*/		gtk_toolbar_append_item(GTK_TOOLBAR(toolbar), _("Show/Hide\noptions"),														_("Show/Hide options"), "Show/Hide options", NULL,														G_CALLBACK(worddic_show_hide_options), NULL);    /*    button_srch = gtk_toolbar_insert_item(GTK_TOOLBAR(toolbar), _("Search"), "Search", "Search",                                              GtkWidget *icon,					  on_text_entered, NULL, -1);    */    /*    tmp_toolbar_icon = gnome_stock_pixmap_widget(wordDic->window, GNOME_STOCK_PIXMAP_COPY);    button_copy = gtk_toolbar_append_element(GTK_TOOLBAR(toolbar),					      GTK_TOOLBAR_CHILD_BUTTON,  NULL, _("Copy"),					      NULL, NULL, tmp_toolbar_icon, NULL, NULL);    gtk_widget_show(button_copy);    g_signal_connect(G_OBJECT(button_copy), "clicked",G_CALLBACK(worddic_copy), NULL);      tmp_toolbar_icon = gnome_stock_pixmap_widget(wordDic->window, GNOME_STOCK_PIXMAP_PASTE);    button_paste = gtk_toolbar_append_element(GTK_TOOLBAR(toolbar),					       GTK_TOOLBAR_CHILD_BUTTON, NULL,_("Paste"),					       NULL, NULL, tmp_toolbar_icon, NULL, NULL);    gtk_widget_show(button_paste);    g_signal_connect(G_OBJECT(button_paste), "clicked",G_CALLBACK(worddic_paste), NULL);    */       gtk_toolbar_set_style(GTK_TOOLBAR(toolbar), GTK_TOOLBAR_BOTH);  }          vbox_main = gtk_vbox_new(FALSE, 0);  gtk_widget_show(vbox_main);  gnome_app_set_contents(GNOME_APP(wordDic->window), vbox_main);  wordDic->hbox_options = gtk_hbox_new(FALSE, 0);  gtk_widget_show(wordDic->hbox_options);  gtk_box_pack_start(GTK_BOX(vbox_main), wordDic->hbox_options, FALSE, TRUE, 0);  frame_japopt = gtk_frame_new(_("Japanese Search Options: "));  gtk_widget_show(frame_japopt);  gtk_box_pack_start(GTK_BOX(wordDic->hbox_options), frame_japopt, TRUE, TRUE, 0);  gtk_container_set_border_width(GTK_CONTAINER(frame_japopt), 5);  vbox_japopt = gtk_vbox_new(FALSE, 0);  gtk_widget_show(vbox_japopt);  gtk_container_add(GTK_CONTAINER(frame_japopt), vbox_japopt);  wordDic->radiob_jpexact = gtk_radio_button_new_with_mnemonic(vbox_japopt_group, _("E_xact Matches"));  vbox_japopt_group = gtk_radio_button_get_group(GTK_RADIO_BUTTON(wordDic->radiob_jpexact));  gtk_widget_show(wordDic->radiob_jpexact);  gtk_box_pack_start(GTK_BOX(vbox_japopt), wordDic->radiob_jpexact, FALSE, FALSE, 0);  wordDic->radiob_startw = gtk_radio_button_new_with_mnemonic(vbox_japopt_group, _("_Start With Expression"));  vbox_japopt_group = gtk_radio_button_get_group(GTK_RADIO_BUTTON(wordDic->radiob_startw));  gtk_widget_show(wordDic->radiob_startw);  gtk_box_pack_start(GTK_BOX(vbox_japopt), wordDic->radiob_startw, FALSE, FALSE, 0);  wordDic->radiob_endw = gtk_radio_button_new_with_mnemonic(vbox_japopt_group, _("E_nd With Expression"));  vbox_japopt_group = gtk_radio_button_get_group(GTK_RADIO_BUTTON(wordDic->radiob_endw));  gtk_widget_show(wordDic->radiob_endw);  gtk_box_pack_start(GTK_BOX(vbox_japopt), wordDic->radiob_endw, FALSE, FALSE, 0);  wordDic->radiob_any = gtk_radio_button_new_with_mnemonic(vbox_japopt_group, _("_Any Matches"));  vbox_japopt_group = gtk_radio_button_get_group(GTK_RADIO_BUTTON(wordDic->radiob_any));  gtk_widget_show(wordDic->radiob_any);  gtk_box_pack_start(GTK_BOX(vbox_japopt), wordDic->radiob_any, FALSE, FALSE, 0);  wordDic->checkb_verb = gtk_check_button_new_with_mnemonic(_("_Verb Deinflection"));  gtk_widget_show(wordDic->checkb_verb);  gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(wordDic->checkb_verb), TRUE);  gtk_box_pack_start(GTK_BOX(vbox_japopt), wordDic->checkb_verb, FALSE, FALSE, 0);  g_signal_connect(G_OBJECT(wordDic->checkb_verb), "toggled", 									 G_CALLBACK(shade_worddic_widgets), NULL);  gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(wordDic->checkb_verb), gjitenApp->conf->deinflection_enabled);    frame_engopt = gtk_frame_new(_("English Search Options: "));  gtk_widget_show(frame_engopt);  gtk_box_pack_start(GTK_BOX(wordDic->hbox_options), frame_engopt, TRUE, TRUE, 0);  gtk_container_set_border_width(GTK_CONTAINER(frame_engopt), 5);  vbox_engopt = gtk_vbox_new(FALSE, 0);  gtk_widget_show(vbox_engopt);  gtk_container_add(GTK_CONTAINER(frame_engopt), vbox_engopt);  wordDic->radiob_engexact = gtk_radio_button_new_with_mnemonic(vbox_engopt_group, _("Wh_ole Expressions"));  vbox_engopt_group = gtk_radio_button_get_group(GTK_RADIO_BUTTON(wordDic->radiob_engexact));  gtk_widget_show(wordDic->radiob_engexact);  gtk_box_pack_start(GTK_BOX(vbox_engopt), wordDic->radiob_engexact, FALSE, FALSE, 0);  wordDic->radiob_words = gtk_radio_button_new_with_mnemonic(vbox_engopt_group, _("_Whole Words"));  vbox_engopt_group = gtk_radio_button_get_group(GTK_RADIO_BUTTON(wordDic->radiob_words));  gtk_widget_show(wordDic->radiob_words);  gtk_box_pack_start(GTK_BOX(vbox_engopt), wordDic->radiob_words, FALSE, FALSE, 0);  wordDic->radiob_partial = gtk_radio_button_new_with_mnemonic(vbox_engopt_group, _("Any _Matches"));  vbox_engopt_group = gtk_radio_button_get_group(GTK_RADIO_BUTTON(wordDic->radiob_partial));  gtk_widget_show(wordDic->radiob_partial);  gtk_box_pack_start(GTK_BOX(vbox_engopt), wordDic->radiob_partial, FALSE, FALSE, 0);  frame_gopt = gtk_frame_new(_("General Options: "));  gtk_widget_show(frame_gopt);  gtk_box_pack_start(GTK_BOX(wordDic->hbox_options), frame_gopt, TRUE, TRUE, 0);  gtk_container_set_border_width(GTK_CONTAINER(frame_gopt), 5);  table_gopt = gtk_table_new(3, 2, FALSE);  gtk_widget_show(table_gopt);  gtk_container_add(GTK_CONTAINER(frame_gopt), table_gopt);  wordDic->radiob_searchdic = gtk_radio_button_new_with_mnemonic(dicssearch_group, _("Search _Dic:"));  dicssearch_group = gtk_radio_button_get_group(GTK_RADIO_BUTTON(wordDic->radiob_searchdic));  gtk_widget_show(wordDic->radiob_searchdic);  gtk_table_attach(GTK_TABLE(table_gopt), wordDic->radiob_searchdic, 0, 1, 0, 1,                   (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), 									 (GtkAttachOptions)(0), 0, 0);  g_signal_connect_swapped(G_OBJECT(wordDic->radiob_searchdic), "clicked", 													 G_CALLBACK(shade_worddic_widgets), NULL);  // DICTFILE SELECTION MENU	  wordDic->dicselection_menu = gtk_option_menu_new();	worddic_update_dic_menu();   gtk_table_attach(GTK_TABLE(table_gopt), wordDic->dicselection_menu, 1, 2, 0, 1,                   (GtkAttachOptions) (GTK_EXPAND | GTK_FILL),									 (GtkAttachOptions)(0), 0, 0);  wordDic->radiob_searchall = gtk_radio_button_new_with_mnemonic(dicssearch_group, _("Sea_rch All Dictionaries"));  gtk_widget_show(wordDic->radiob_searchall);  gtk_table_attach(GTK_TABLE(table_gopt), wordDic->radiob_searchall, 0, 2, 1, 2,                   (GtkAttachOptions)(GTK_EXPAND | GTK_FILL), 									 (GtkAttachOptions)(0), 0, 0);  g_signal_connect_swapped(G_OBJECT(wordDic->radiob_searchall), "clicked", 			     G_CALLBACK(shade_worddic_widgets), NULL);  wordDic->checkb_autoadjust = gtk_check_button_new_with_mnemonic(_("A_uto Adjust Options"));  gtk_widget_show(wordDic->checkb_autoadjust);  gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(wordDic->checkb_autoadjust), TRUE);  gtk_table_attach(GTK_TABLE(table_gopt), wordDic->checkb_autoadjust, 0, 2, 2, 3,                   (GtkAttachOptions)(GTK_EXPAND | GTK_FILL), 									 (GtkAttachOptions)(0), 0, 0);  g_signal_connect(G_OBJECT(wordDic->checkb_autoadjust), "toggled", 									 G_CALLBACK(shade_worddic_widgets), NULL);  gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(wordDic->checkb_autoadjust), gjitenApp->conf->autoadjust_enabled);    hbox_searchlimit = gtk_hbox_new(FALSE, 0);  gtk_widget_show(hbox_searchlimit);  gtk_table_attach(GTK_TABLE(table_gopt), hbox_searchlimit, 0, 2, 3, 4,                   (GtkAttachOptions)(GTK_FILL), 									 (GtkAttachOptions)(0), 0, 0);  wordDic->checkb_searchlimit = gtk_check_button_new_with_mnemonic(_("_Limit Results:"));  gtk_widget_show(wordDic->checkb_searchlimit);  gtk_box_pack_start(GTK_BOX(hbox_searchlimit), wordDic->checkb_searchlimit, FALSE, FALSE, 0);  g_signal_connect(G_OBJECT(wordDic->checkb_searchlimit), "toggled", 									 G_CALLBACK(checkb_searchlimit_toggled), NULL);  gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(wordDic->checkb_searchlimit), gjitenApp->conf->searchlimit_enabled);	spinb_searchlimit_adj = gtk_adjustment_new(gjitenApp->conf->maxwordmatches, 1, G_MAXFLOAT, 1, 2, 2);  wordDic->spinb_searchlimit = gtk_spin_button_new(GTK_ADJUSTMENT(spinb_searchlimit_adj), 1, 0);  gtk_widget_show(wordDic->spinb_searchlimit);  gtk_box_pack_start(GTK_BOX(hbox_searchlimit), wordDic->spinb_searchlimit, FALSE, FALSE, 0);  gtk_widget_set_sensitive(wordDic->spinb_searchlimit,(GTK_TOGGLE_BUTTON(wordDic->checkb_searchlimit)->active));  g_signal_connect(G_OBJECT(spinb_searchlimit_adj), "value_changed", 		      G_CALLBACK(get_searchlimit), NULL);    hbox_entry = gtk_hbox_new(FALSE, 0);     gtk_widget_show(hbox_entry);  gtk_box_pack_start(GTK_BOX(vbox_main), hbox_entry, FALSE, TRUE, 14);  gtk_container_set_border_width(GTK_CONTAINER(hbox_entry), 3);  label_enter = gtk_label_new(_("Enter expression :"));  gtk_widget_show(label_enter);  gtk_box_pack_start(GTK_BOX(hbox_entry), label_enter, FALSE, TRUE, 5);  gtk_label_set_justify(GTK_LABEL(label_enter), GTK_JUSTIFY_RIGHT);  gtk_misc_set_alignment(GTK_MISC(label_enter), 1, 0.5);  gtk_misc_set_padding(GTK_MISC(label_enter), 7, 0);  wordDic->combo_entry = gtk_combo_new();  gtk_widget_show(wordDic->combo_entry);  gtk_box_pack_start(GTK_BOX(hbox_entry), wordDic->combo_entry, TRUE, TRUE, 0);  g_signal_connect(G_OBJECT(GTK_COMBO(wordDic->combo_entry)->entry), 									 "activate", G_CALLBACK(on_text_entered), NULL);  g_signal_connect(G_OBJECT(wordDic->window), "key_press_event", G_CALLBACK(set_focus_on_entry), GTK_COMBO(wordDic->combo_entry)->entry);  gtk_combo_disable_activate(GTK_COMBO(wordDic->combo_entry));  gtk_combo_set_case_sensitive(GTK_COMBO(wordDic->combo_entry), TRUE);  if (wordDic->combo_entry_glist != NULL) {    gtk_combo_set_popdown_strings(GTK_COMBO(wordDic->combo_entry), wordDic->combo_entry_glist);    gtk_entry_set_text(GTK_ENTRY(GTK_COMBO(wordDic->combo_entry)->entry), "");  }  GTK_WIDGET_SET_FLAGS(GTK_COMBO(wordDic->combo_entry)->entry, GTK_CAN_DEFAULT);  gtk_widget_grab_focus(GTK_COMBO(wordDic->combo_entry)->entry);  gtk_widget_grab_default(GTK_COMBO(wordDic->combo_entry)->entry);    button_search = gtk_button_new_with_label(_("Search"));  gtk_widget_show(button_search);  gtk_box_pack_start(GTK_BOX(hbox_entry), button_search, FALSE, FALSE, 7);  g_signal_connect(G_OBJECT(button_search), "clicked",G_CALLBACK(on_text_entered), NULL);  button_clear = gtk_button_new_with_mnemonic(_("_Clear"));  gtk_widget_show(button_clear);  gtk_box_pack_start(GTK_BOX(hbox_entry), button_clear, FALSE, FALSE, 0);  g_signal_connect_swapped(G_OBJECT(button_clear), "clicked", 													 G_CALLBACK(gjiten_clear_entry_box), 													 G_OBJECT(GTK_COMBO(wordDic->combo_entry)->entry));  frame_results = gtk_frame_new(_("Search results :"));  gtk_widget_show(frame_results);  gtk_box_pack_start(GTK_BOX(vbox_main), frame_results, TRUE, TRUE, 0);  gtk_container_set_border_width(GTK_CONTAINER(frame_results), 5);  gtk_frame_set_label_align(GTK_FRAME(frame_results), 0.03, 0.5);  vbox_results = gtk_vbox_new(FALSE, 0);  gtk_widget_show(vbox_results);  gtk_container_add(GTK_CONTAINER(frame_results), vbox_results);  wordDic->text_results_view = gtk_text_view_new();  wordDic->text_results_buffer = gtk_text_view_get_buffer(GTK_TEXT_VIEW(wordDic->text_results_view));  gtk_text_view_set_wrap_mode(GTK_TEXT_VIEW(wordDic->text_results_view), GTK_WRAP_WORD);  gtk_widget_show(wordDic->text_results_view);	gtk_text_view_set_editable(GTK_TEXT_VIEW(wordDic->text_results_view), FALSE);    //set up fonts and tags  gtk_text_buffer_create_tag(wordDic->text_results_buffer, "blue_foreground", "foreground", "blue", NULL);    gtk_text_buffer_create_tag(wordDic->text_results_buffer, "red_foreground", "foreground", "red", NULL);    gtk_text_buffer_create_tag(wordDic->text_results_buffer, "brown_foreground", "foreground", "brown", NULL);    worddic_apply_fonts();  scrolledwin_results = gtk_scrolled_window_new(NULL, NULL);  gtk_scrolled_window_set_shadow_type(GTK_SCROLLED_WINDOW(scrolledwin_results), GTK_SHADOW_IN);  gtk_container_add(GTK_CONTAINER(scrolledwin_results), wordDic->text_results_view);  gtk_box_pack_start(GTK_BOX(vbox_results), scrolledwin_results, TRUE, TRUE, 0);  gtk_widget_show(scrolledwin_results);  wordDic->appbar_mainwin = gnome_appbar_new(TRUE, TRUE, GNOME_PREFERENCES_NEVER);  gtk_widget_show(wordDic->appbar_mainwin);  gtk_box_pack_end(GTK_BOX(vbox_results), wordDic->appbar_mainwin, FALSE, FALSE, 0);   gtk_widget_show(wordDic->window);  gjiten_flush_errors();	return wordDic;}