gtk_widget_show(scrolledwin_history);
KanjiDic *kanjidic_create() {  GtkWidget *vbox_maink;  GtkWidget *hbox_spinb;  GtkWidget *table_koptions;  GtkWidget *toolbar_kanji;  GtkWidget *button_closek;  GtkWidget *button_kanjipad;  GtkWidget *button_worddic;  GtkWidget *button_searchk;  GtkWidget *frame_koptions;  GtkObject *spinb_strokenum_adj;  GtkObject *spinb_plusmin_adj;  GtkWidget *hseparator;  GtkWidget *frame_kresults;  GtkWidget *scrolledwin_kresults;  GtkWidget *scrolledwin_kinfo;  GtkWidget *dock_kanjidic;  GtkWidget *hbox;  GtkWidget *frame_kinfo;  GtkWidget *tmpimage; 	GtkWidget *scrolledwin_history;	GtkWidget *vpane;  load_radkfile();  if (kanjiDic != NULL) {		gtk_widget_hide(kanjiDic->window);		gtk_widget_show(kanjiDic->window);		return kanjiDic;  }	kanjiDic = g_new0(KanjiDic, 1);	gjitenApp->kanjidic = kanjiDic;  if (kdic_line == NULL) kdic_line = (gchar *)g_malloc(KCFGNUM * 200);  if (kdic_line == NULL) gjiten_abort_with_msg("Couldn't allocate memory\n");  kanjiDic->window = gnome_app_new("gjiten", _("Gjiten - KanjiDic"));  GTK_WIDGET_SET_FLAGS(kanjiDic->window, GTK_CAN_DEFAULT);  g_signal_connect(G_OBJECT(kanjiDic->window), "destroy", G_CALLBACK(kanjidic_close), NULL);  gtk_window_set_default_size(GTK_WINDOW(kanjiDic->window), 500, 500);  dock_kanjidic = GNOME_APP(kanjiDic->window)->dock;  gtk_widget_show(dock_kanjidic);  if (gjitenApp->conf->menubar) gnome_app_create_menus(GNOME_APP(kanjiDic->window), kmenubar_uiinfo);    vbox_maink = gtk_vbox_new(FALSE, 0);  gtk_widget_show(vbox_maink);  gnome_app_set_contents(GNOME_APP(kanjiDic->window), vbox_maink);     if (gjitenApp->conf->toolbar) {    toolbar_kanji = gtk_toolbar_new();    gtk_widget_show(toolbar_kanji);    gnome_app_set_toolbar(GNOME_APP(kanjiDic->window), GTK_TOOLBAR(toolbar_kanji));        button_closek = gtk_toolbar_insert_stock(GTK_TOOLBAR(toolbar_kanji), GTK_STOCK_CLOSE,																						 _("Close KanjiDic"), "Close", 																						 NULL, NULL, -1);		g_signal_connect_swapped(G_OBJECT(button_closek), "clicked", 														 G_CALLBACK(gtk_widget_destroy), kanjiDic->window);    tmpimage = gtk_image_new_from_file(PIXMAPDIR"/kanjidic.png");    button_worddic = gtk_toolbar_append_item(GTK_TOOLBAR(toolbar_kanji), _("WordDic"),																						 _("Launch WordDic"), "WordDic", tmpimage,																						 G_CALLBACK(worddic_create), NULL);    tmpimage = gtk_image_new_from_file(PIXMAPDIR"/kanjipad.png");    button_kanjipad = gtk_toolbar_append_item(GTK_TOOLBAR(toolbar_kanji), _("KanjiPad"),					      _("Launch KanjiPad"), "KanjiPad", tmpimage,					      GTK_SIGNAL_FUNC(gjiten_start_kanjipad), NULL);        button_searchk = gtk_toolbar_insert_stock(GTK_TOOLBAR(toolbar_kanji), GTK_STOCK_FIND,					      _("Search entered Kanji"), "Search", 					      on_kanji_search, NULL, -1);  }    frame_koptions = gtk_frame_new(_("Kanji Search Options"));  gtk_widget_show(frame_koptions);  gtk_box_pack_start(GTK_BOX(vbox_maink), frame_koptions, FALSE, FALSE, 0);  gtk_container_set_border_width(GTK_CONTAINER(frame_koptions), 2);  table_koptions = gtk_table_new(3, 4, FALSE);  gtk_widget_show(table_koptions);  gtk_container_add(GTK_CONTAINER(frame_koptions), table_koptions);  //FIXME: use mnemonics  kanjiDic->checkb_stroke = gtk_check_button_new_with_mnemonic(_("Search By _Strokes:"));   gtk_widget_show(kanjiDic->checkb_stroke);  gtk_table_attach(GTK_TABLE(table_koptions), kanjiDic->checkb_stroke, 0, 1, 0, 1,									 (GtkAttachOptions)(GTK_FILL),(GtkAttachOptions)(0), 0, 0);  g_signal_connect(GTK_OBJECT(kanjiDic->checkb_stroke), "toggled", 									 GTK_SIGNAL_FUNC(shade_kanjidic_widgets), NULL);  kanjiDic->checkb_radical = gtk_check_button_new_with_mnemonic(_("Search By _Radical:"));    gtk_widget_show(kanjiDic->checkb_radical);  gtk_table_attach(GTK_TABLE(table_koptions), kanjiDic->checkb_radical, 0, 1, 1, 2,                    (GtkAttachOptions)(GTK_FILL), (GtkAttachOptions)(0), 0, 0);  g_signal_connect (GTK_OBJECT(kanjiDic->checkb_radical), "toggled", 		      GTK_SIGNAL_FUNC(shade_kanjidic_widgets), NULL);   kanjiDic->checkb_ksearch = gtk_check_button_new_with_mnemonic(_("Search By _Key:"));  gtk_widget_show(kanjiDic->checkb_ksearch);  gtk_table_attach(GTK_TABLE(table_koptions), kanjiDic->checkb_ksearch, 0, 1, 2, 3,                    (GtkAttachOptions)(GTK_FILL), (GtkAttachOptions)(0), 0, 0);  g_signal_connect(GTK_OBJECT(kanjiDic->checkb_ksearch), "toggled", 		      GTK_SIGNAL_FUNC(shade_kanjidic_widgets), NULL);  hbox_spinb = gtk_hbox_new(FALSE, 0);  gtk_widget_show(hbox_spinb);  gtk_table_attach(GTK_TABLE(table_koptions), hbox_spinb, 1, 2, 0, 1,                    (GtkAttachOptions)(GTK_FILL), (GtkAttachOptions)(GTK_FILL), 0, 0);  spinb_strokenum_adj = gtk_adjustment_new(1, 1, 30, 1, 2, 2);  kanjiDic->spinb_strokenum = gtk_spin_button_new(GTK_ADJUSTMENT(spinb_strokenum_adj), 1, 0);  gtk_widget_show(kanjiDic->spinb_strokenum);  gtk_box_pack_start(GTK_BOX(hbox_spinb), kanjiDic->spinb_strokenum, FALSE, FALSE, 0);  kanjiDic->label_plusmin = gtk_label_new("+/-");  gtk_widget_show(kanjiDic->label_plusmin);  gtk_box_pack_start(GTK_BOX(hbox_spinb), kanjiDic->label_plusmin, FALSE, FALSE, 0);  spinb_plusmin_adj = gtk_adjustment_new(0, 0, 10, 1, 10, 10);  kanjiDic->spinb_plusmin = gtk_spin_button_new(GTK_ADJUSTMENT(spinb_plusmin_adj), 1, 0);  gtk_widget_show(kanjiDic->spinb_plusmin);  gtk_box_pack_start(GTK_BOX(hbox_spinb), kanjiDic->spinb_plusmin, FALSE, FALSE, 0);  kanjiDic->button_radtable = gtk_button_new_with_mnemonic(_("Show Radical _List"));  gtk_widget_show(kanjiDic->button_radtable);  gtk_table_attach(GTK_TABLE(table_koptions), kanjiDic->button_radtable, 3, 4, 1, 2,                    (GtkAttachOptions)(0), (GtkAttachOptions)(0), 0, 0);  g_signal_connect(GTK_OBJECT(kanjiDic->button_radtable), "clicked", 		      GTK_SIGNAL_FUNC(create_window_radicals), NULL);  kanjiDic->combo_entry_radical = gtk_combo_new();  gtk_widget_show(kanjiDic->combo_entry_radical);  gtk_table_attach(GTK_TABLE(table_koptions), kanjiDic->combo_entry_radical, 1, 2, 1, 2,                    (GtkAttachOptions)(GTK_EXPAND | GTK_FILL),  (GtkAttachOptions)(0), 0, 0);  g_signal_connect(GTK_OBJECT(GTK_COMBO(kanjiDic->combo_entry_radical)->entry), 		      "activate", GTK_SIGNAL_FUNC(on_kanji_search), NULL);  gtk_combo_disable_activate(GTK_COMBO(kanjiDic->combo_entry_radical));  kanjiDic->combo_entry_key = gtk_combo_new();  gtk_widget_show(kanjiDic->combo_entry_key);  gtk_table_attach(GTK_TABLE(table_koptions), kanjiDic->combo_entry_key, 1, 2, 2, 3,                    (GtkAttachOptions)(GTK_EXPAND | GTK_FILL), (GtkAttachOptions)(0), 0, 0);  g_signal_connect(GTK_OBJECT(GTK_COMBO(kanjiDic->combo_entry_key)->entry), 		      "activate", GTK_SIGNAL_FUNC(on_kanji_search), NULL);  gtk_combo_disable_activate(GTK_COMBO(kanjiDic->combo_entry_key));  kanjiDic->button_clearrad = gtk_button_new_with_label(_("Clear"));  gtk_widget_show(kanjiDic->button_clearrad);  gtk_table_attach(GTK_TABLE(table_koptions), kanjiDic->button_clearrad, 2, 3, 1, 2,                    (GtkAttachOptions)(0), (GtkAttachOptions)(0), 5, 0);  g_signal_connect_swapped(GTK_OBJECT(kanjiDic->button_clearrad), "clicked", 													 GTK_SIGNAL_FUNC(gjiten_clear_entry_box), 													 GTK_OBJECT(GTK_COMBO(kanjiDic->combo_entry_radical)->entry));  kanjiDic->button_cleark = gtk_button_new_with_label(_("Clear"));  gtk_widget_show(kanjiDic->button_cleark);  gtk_table_attach(GTK_TABLE(table_koptions), kanjiDic->button_cleark, 2, 3, 2, 3,									 (GtkAttachOptions)(0), (GtkAttachOptions)(0), 5, 0);  g_signal_connect_swapped(GTK_OBJECT(kanjiDic->button_cleark), "clicked", 													 GTK_SIGNAL_FUNC(gjiten_clear_entry_box), 													 GTK_OBJECT(GTK_COMBO(kanjiDic->combo_entry_key)->entry));  hseparator = gtk_hseparator_new();  gtk_widget_show(hseparator);  gtk_box_pack_start(GTK_BOX(vbox_maink), hseparator, FALSE, FALSE, 7);  frame_kresults = gtk_frame_new(_("Search Results :"));  gtk_widget_show(frame_kresults);  gtk_container_set_border_width(GTK_CONTAINER(frame_kresults), 2);  scrolledwin_kresults = gtk_scrolled_window_new(NULL, NULL);  gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(scrolledwin_kresults),				 GTK_POLICY_NEVER, GTK_POLICY_ALWAYS);  gtk_scrolled_window_set_shadow_type(GTK_SCROLLED_WINDOW(scrolledwin_kresults), GTK_SHADOW_IN);  gtk_widget_show(scrolledwin_kresults);  gtk_container_add(GTK_CONTAINER(frame_kresults), scrolledwin_kresults);  kanjiDic->kanji_results_view = gtk_text_view_new();  kanjiDic->kanji_results_buffer = gtk_text_view_get_buffer(GTK_TEXT_VIEW(kanjiDic->kanji_results_view));  gtk_text_view_set_wrap_mode(GTK_TEXT_VIEW(kanjiDic->kanji_results_view), GTK_WRAP_CHAR);	gtk_text_view_set_editable(GTK_TEXT_VIEW(kanjiDic->kanji_results_view), FALSE);  gtk_widget_show(kanjiDic->kanji_results_view);  gtk_container_add(GTK_CONTAINER(scrolledwin_kresults), kanjiDic->kanji_results_view);  gtk_widget_set_size_request(kanjiDic->kanji_results_view, -1, 66);  hbox = gtk_hbox_new(FALSE, 0);  gtk_widget_show(hbox);    kanjiDic->text_kanjinfo_view = gtk_text_view_new();  kanjiDic->text_kanjinfo_buffer = gtk_text_view_get_buffer(GTK_TEXT_VIEW(kanjiDic->text_kanjinfo_view));  gtk_text_view_set_wrap_mode(GTK_TEXT_VIEW(kanjiDic->text_kanjinfo_view), GTK_WRAP_WORD);	gtk_text_view_set_editable(GTK_TEXT_VIEW(kanjiDic->text_kanjinfo_view), FALSE);  gtk_widget_show(kanjiDic->text_kanjinfo_view);  frame_kinfo = gtk_frame_new(_("Kanji Info :"));  gtk_widget_show(frame_kinfo);  gtk_container_set_border_width(GTK_CONTAINER(frame_kinfo), 2);  gtk_container_add(GTK_CONTAINER(frame_kinfo), hbox);  scrolledwin_kinfo = gtk_scrolled_window_new(NULL, NULL);  gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(scrolledwin_kinfo),				 GTK_POLICY_NEVER, GTK_POLICY_AUTOMATIC);  gtk_scrolled_window_set_shadow_type(GTK_SCROLLED_WINDOW(scrolledwin_kinfo), GTK_SHADOW_IN);  gtk_widget_show(scrolledwin_kinfo);  gtk_box_pack_start(GTK_BOX(hbox), scrolledwin_kinfo, TRUE, TRUE, 0);  gtk_container_add(GTK_CONTAINER(scrolledwin_kinfo), kanjiDic->text_kanjinfo_view);  scrolledwin_history = gtk_scrolled_window_new(NULL, NULL);  gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(scrolledwin_history),																 GTK_POLICY_NEVER, GTK_POLICY_AUTOMATIC);  gtk_widget_show(scrolledwin_history);  kanjiDic->vbox_history = gtk_vbox_new(FALSE, 0);  gtk_widget_show(kanjiDic->vbox_history);  history_init();  gtk_scrolled_window_add_with_viewport(GTK_SCROLLED_WINDOW(scrolledwin_history), kanjiDic->vbox_history);					//  gtk_container_add(GTK_CONTAINER(scrolledwin_history), kanjiDic->vbox_history);  gtk_box_pack_start(GTK_BOX(hbox), scrolledwin_history, FALSE, FALSE, 0);  vpane = gtk_vpaned_new();  gtk_widget_show(vpane);  gtk_paned_add1(GTK_PANED(vpane), frame_kresults);  gtk_paned_add2(GTK_PANED(vpane), frame_kinfo);  gtk_box_pack_start(GTK_BOX(vbox_maink), vpane, TRUE, TRUE, 0);  kanjiDic->appbar_kanji = gnome_appbar_new(TRUE, TRUE, GNOME_PREFERENCES_NEVER);  gtk_widget_show(kanjiDic->appbar_kanji);  gtk_box_pack_start(GTK_BOX(vbox_maink), kanjiDic->appbar_kanji, FALSE, FALSE, 0);  shade_kanjidic_widgets();  g_signal_connect(GTK_OBJECT(GTK_ADJUSTMENT(spinb_strokenum_adj)), 				  "value_changed", GTK_SIGNAL_FUNC(on_kanji_search), NULL);  g_signal_connect(GTK_OBJECT(GTK_ADJUSTMENT(spinb_plusmin_adj)), 				  "value_changed", GTK_SIGNAL_FUNC(on_kanji_search), NULL);  gtk_text_buffer_create_tag(kanjiDic->text_kanjinfo_buffer, "blue_foreground", "foreground", "blue", NULL);  	kanjidic_apply_fonts();  gtk_widget_show(kanjiDic->window);	return kanjiDic;}