Help: how to pack a horizontal box and vertical boxes to a notebook page?



Could any one please help me? I just started to use
gtk a week ago, I don’t have any ideas how to solve
the problems?

I am trying to put a horizontal box to this notebook
page, (currently I have a vertical box and I meant to
have two rows of label and text intput box on the page
with the label “enter order”), However, since
gtk_notebook_prepend_page(*notebook, child, tab_label)
only accept one child widget, how could I put both
vertical box and horizontal box to this page? The
following is my code. Or could anyone could give me an
example of using notebook and boxes together.

 

window = gtk_window_new(GTK_WINDOW_TOPLEVEL);

 

  gtk_window_set_title(GTK_WINDOW(window), "API");

  gtk_signal_connect(GTK_OBJECT(window),
"delete_event", GTK_SIGNAL_FUNC(delete_event), NULL);

  gtk_window_set_position(GTK_WINDOW(window),
GTK_WIN_POS_CENTER);

 

  gtk_container_set_border_width (GTK_CONTAINER
(window), 10);

 

  table = gtk_table_new(3,6,FALSE);

  gtk_container_add (GTK_CONTAINER (window), table);

 

  /* Create a new notebook, place the position of the
tabs */

  notebook = gtk_notebook_new ();

  gtk_notebook_set_tab_pos (GTK_NOTEBOOK (notebook),
GTK_POS_TOP);

  gtk_table_attach_defaults(GTK_TABLE(table),
notebook, 0,6,0,1);

  gtk_widget_show(notebook);

 

 

vbox = gtk_vbox_new(TRUE, 0);

  label = gtk_label_new ("Size: ");

  gtk_misc_set_alignment (GTK_MISC (label), 0, 0);

  gtk_box_pack_start(GTK_BOX(vbox), label, FALSE,
TRUE, 0);

  gtk_widget_show(label);

 

  inputText = gtk_entry_new_with_max_length(20);

  gtk_box_pack_start(GTK_BOX(vbox), inputText , FALSE,
FALSE, 0);

  gtk_widget_show(inputText);

 

  label = gtk_label_new ("Side: ");

  gtk_misc_set_alignment (GTK_MISC (label), 0, 0);

  gtk_box_pack_start(GTK_BOX(vbox), label, FALSE,
FALSE, 0);

  gtk_widget_show(label);

 

  inputText  = gtk_entry_new_with_max_length(20);

  gtk_box_pack_start(GTK_BOX(vbox), inputText, FALSE,
FALSE, 0);

  gtk_widget_show(inputText);

 

  

  //gtk_box_pack_start (GTK_BOX (vbox), hbox, FALSE,
FALSE, 0);

  gtk_widget_show (vbox);

 

 

  label = gtk_label_new ("Enter Order");

  gtk_notebook_prepend_page (GTK_NOTEBOOK (notebook),
vbox, label);

 

 

gtk_widget_show(table);

  gtk_widget_show(window);

 

Thanks you all very much…

Heather


__________________________________________________
Do you Yahoo!?
Yahoo! Web Hosting - establish your business online
http://webhosting.yahoo.com



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]