Re: [gtk-list] help with interface
- From: Oliver Schulze <oliver Pla net PY>
- To: gtk-list redhat com
- Subject: Re: [gtk-list] help with interface
- Date: Fri, 05 Jun 1998 20:01:53 +0000
Omar Armas Aleman wrote:
>
> 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
>
> --
> To unsubscribe: mail -s unsubscribe gtk-list-request@redhat.com < /dev/null
Maybe you should put(with gtk_container_add) a hbox in window.
Then, pack(with gtk_box_pack_start()) the other two box(main_vbox and
box_main) into the hbox.
Good luck.
--
~~~~~~~~~~~~~~~~~~
Oliver Schulze L.
oliver@pla.net.py
Asuncion-Paraguay
~~~~~~~~~~~~~~~~~~X
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]