help with interface
- From: Omar Armas Aleman <kaos jlagunez iquimica unam mx>
 
- To: gtk-list <gtk-list redhat com>
 
- Subject: help with interface
 
- Date: Fri, 5 Jun 1998 11:56:36 -0500 (CDT)
 
i wanna make something like this:
---------------------------------
|File			About	|
|-------------------------------|
|	 |			|
|[button]|			|
|	 |			|
|[button]|			|
|	 |	Drawing area	|
|[button]|			|
|	 |			|
|[button]|			|
|	 |			|
_________________________________
but i have some problems building the interface.
i only get the menus and a big horizontal button.
should it be a pack containing two packs?
here's the code:
 window = gtk_window_new(GTK_WINDOW_TOPLEVEL);
    gtk_signal_connect(GTK_OBJECT(window), "destroy", 
		       GTK_SIGNAL_FUNC(file_quit_cmd_callback), 
                       "WM destroy");
    gtk_window_set_title(GTK_WINDOW(window), "DSP");
    gtk_widget_set_usize(GTK_WIDGET(window), 500, 500);
//for the menu
    main_vbox = gtk_vbox_new(FALSE, 1);
       gtk_container_border_width(GTK_CONTAINER(main_vbox), 1);
//for the buttons and drawing area
    box_main = gtk_hbox_new(FALSE, 1);
    gtk_container_border_width(GTK_CONTAINER(box_main), 3);
//for now, it does nothing
    button = gtk_button_new_with_label ("Generate Signal");
    gtk_signal_connect_object (GTK_OBJECT (button), "clicked",
			       GTK_SIGNAL_FUNC (gtk_widget_destroy),
			       GTK_OBJECT(window));
//add main_vbox to the window
    gtk_container_add(GTK_CONTAINER(window), main_vbox);
    gtk_widget_show(main_vbox);
//add box_main to the window. it should contain the buttons and drawing
area
    gtk_container_add(GTK_CONTAINER(window), box_main);
    gtk_widget_show(box_main);
//create menus
    get_main_menu(&menubar, &accel);
    gtk_window_add_accelerator_table(GTK_WINDOW(window), accel);
//pack menu to vbox
    gtk_box_pack_start(GTK_BOX(main_vbox), menubar, FALSE, TRUE, 0);
    gtk_widget_show(menubar);
//pack button to main_box
    gtk_box_pack_start(GTK_BOX(main_vbox), button, FALSE, TRUE, 0);
    gtk_widget_show(button);
//show main window
    gtk_widget_show(window);
    gtk_main();
omar
[
Date Prev][
Date Next]   [
Thread Prev][
Thread Next]   
[
Thread Index]
[
Date Index]
[
Author Index]