00001 00005 #include <gtk/gtk.h> 00006 #include "gui_dict.h" 00007 #include "dict.h" 00008 #include "gui_menu.h" 00009 00014 GtkNotebook *notebook; 00015 00019 GtkWidget * 00020 top_window_new () 00021 { 00022 GtkWindow *w; 00023 GtkWidget *dict, *mainvbox, *menubar; 00024 int wnum; 00025 char ***words; 00026 00027 dict = dict_new_from_file ("/usr/share/dict/words", " -> "); 00028 00029 notebook = GTK_NOTEBOOK (gtk_notebook_new ()); 00030 00031 gtk_notebook_append_page (GTK_NOTEBOOK (notebook), dict, 00032 gtk_label_new ("Dictionary: words")); 00033 gtk_widget_show (dict); 00034 00035 menubar = gui_menu_mainmenu_new (); 00036 mainvbox = gtk_vbox_new (FALSE, 2); 00037 gtk_box_pack_start (GTK_BOX (mainvbox), menubar, FALSE, FALSE, 2); 00038 gtk_widget_show (menubar); 00039 gtk_box_pack_start (GTK_BOX (mainvbox), GTK_WIDGET (notebook), TRUE, TRUE, 00040 2); 00041 gtk_widget_show (GTK_WIDGET (notebook)); 00042 00043 w = GTK_WINDOW (gtk_window_new (GTK_WINDOW_TOPLEVEL)); 00044 gtk_container_add (GTK_CONTAINER (w), mainvbox); 00045 gtk_widget_show (mainvbox); 00046 gtk_window_set_title (w, "glw"); 00047 gtk_signal_connect (GTK_OBJECT (w), "destroy", 00048 GTK_SIGNAL_FUNC (gtk_main_quit), NULL); 00049 00050 return (GTK_WIDGET (w)); 00051 }