Re: [PHP-GTK] New to GTK

[email protected] ("Steph")
Newsgroups php.gtk
Message-ID <021501c11a92$8726d120$05e47ad5@t2r1o8>
You have it under the vpaned.  Either get rid of the vpaned completely or get rid of the box if you don't need it .. you can add the entry to the vpaned using add1 (top) or add2 (bottom), that should resolve it.

----- 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]
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.