GTK Entry and GTK Notebook
[email protected] (Lorrie Cooke) Fri, 10 Aug 2001 16:07:12 -0500
| Newsgroups | php.gtk |
|---|---|
| Message-ID | <[email protected]> |
Hi :)
Im trying to get text out of a entry box that is in a GTK Notebook
Usually its just a matter of using $name = $entry->get_text();
however when i try that I am getting an error: call to undefined
function get_text()
below is a code snippet:
When I echo $currname it is returning "object" as expected.. but then
the error comes.. So im not sure what I have done wrong..
Thansk for the help :)
Lorrie
//====================================
function create_it($currname){
echo "debug:$currname";
$name = $currname->get_text();
echo ":$name:";
}
$window = &new GtkWindow();
$window->set_title("test nookbook");
$window->set_position(GTK_WIN_POS_CENTER);
$window->set_default_size((gdk::screen_width()-200),
(gdk::screen_height()-200));
$window->connect_object('destroy', array('gtk', 'main_quit'));
$box = &new GtkVBox();
$box->show();
$heading = &new GtkLabel("test");
$box->add($heading);
$heading->show();
$hbox = &new GtkHBox(true);
$box->add($hbox);
$hbox->show();
$name = &new GtkLabel("NAME:");
$name -> set_justify(GTK_JUSTIFY_RIGHT);
$hbox->add($name);
$name->show();
$affname = &new GtkEntry();
$hbox->add($affname);
$affname->show();
$button = &new GtkButton('Done');
$button->connect('clicked',create_it,$affname);
$box->add($button);
$button->show();
$label1 = &new GtkLabel('main');
$notebook = &new GtkNotebook();
$window->add($notebook);
$notebook->append_page($box, $label1);
$notebook->show();
$window->show_all();
Gtk::main();