New to GTK
| From: | loll | Date: | Wed, 01 Aug 2001 13:45:40 +0000 |
| Subject: | New to GTK | ||
| Groups: | php.gtk | ||
| Request: | Send a blank email to php-gtk+get-2436@lists.php.net to get a copy of this message | ||
Hi,
Im new to GTK and im using some of the example scripts to try and learn how it all works
Using the menu example script thats available.. Im trying to add text boxes to the main box...
here is a code snippet from the menu.php example:
$window = &new GtkWindow();
$window->connect('destroy', shutdown);
$window->set_position(GTK_WIN_POS_CENTER);
$window->set_usize(450,400);
$window->set_policy(FALSE,TRUE,FALSE);
$box = &new GtkVBox();
$window->add($box);
$box->show();
$vpane= &new GtkVPaned();
$vpane->set_border_width(0);
$vpane->set_handle_size(0);
$box->add($vpane);
$vpane->show();
$accel = &new GtkAccelGroup();
$window->add_accel_group($accel);
$label = &new GtkLabel("");
$label->set_line_wrap(TRUE);
$scrl_win = &new GtkScrolledWindow();
$scrl_win->set_policy(GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC);
$col1 = &new GdkColor(60000,60000,60000);
$col2 = &new GdkColor(0,0,0);
$style = $scrl_win->style;
$style->bg[GTK_STATE_NORMAL] = $col1;
$style->fg[GTK_STATE_NORMAL] = $col2;
$vpane->add2($scrl_win);
$scrl_win->show();
$scrl_win->add_with_viewport($label);
$label->show();
$window->show_all();
if i change it to be like this:
$window = &new GtkWindow();
$window->connect('destroy', shutdown);
$window->set_position(GTK_WIN_POS_CENTER);
$window->set_usize(450,400);
$window->set_policy(FALSE,TRUE,FALSE);
$box = &new GtkVBox();
$window->add($box);
$box->show();
$vpane= &new GtkVPaned();
$vpane->set_border_width(0);
$vpane->set_handle_size(0);
//===================================
$entry = &new GtkEntry();
$box->add($entry);
$entry->show();
//====================================
$box->add($vpane);
this adds a text box but it puts it centered under the main box(expanding the window etc) ... How do i get the box to be inside the main box ?
Thansk for your help
Loll