Re: New to GTK
| From: | Steph | Date: | Wed, 01 Aug 2001 20:12:54 +0000 |
| Subject: | Re: New to GTK | ||
| References: | 1 | Groups: | php.gtk |
| Request: | Send a blank email to php-gtk+get-2441@lists.php.net to get a copy of this message | ||
Loll, your smtp hates my smtp. Try $window->remove($firstvbox); & globalise $window in each
function to add($newvbox) to, show_all() at the end of each function as well as just before main().
If it's not having any, you might need to hide() the main window and create a fresh one in
every function. You can't display a vbox without a window.
hth
& please write via the list, it's easier!
----- Original Message -----
From: "loll" <support@quietriver.net>
To: <php-gtk@lists.php.net>
Sent: Wednesday, August 01, 2001 2:45 PM
Subject: [PHP-GTK] New to GTK
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
--
PHP GTK Mailing List (http://www.php.net/)
To unsubscribe, e-mail: php-gtk-unsubscribe@lists.php.net
For additional commands, e-mail: php-gtk-help@lists.php.net
To contact the list administrators, e-mail: php-list-admin@lists.php.net