Re: [PHP-GTK] New to GTK
[email protected] ("Steph")
| Newsgroups | php.gtk |
|---|---|
| Message-ID | <03fb01c11ac6$5cb50ae0$05e47ad5@t2r1o8> |
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" <[email protected]> To: <[email protected]> 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: [email protected] For additional commands, e-mail: [email protected] To contact the list administrators, e-mail: [email protected]