blond problem (for me)
| From: | hans at linux dot gelrevision dot nl | Date: | Tue, 13 Mar 2001 09:31:52 +0000 |
| Subject: | blond problem (for me) | ||
| Groups: | php.gtk | ||
| Request: | Send a blank email to php-gtk+get-762@lists.php.net to get a copy of this message | ||
Hi all,
Been writing a small application with php-gtk but I have some trouble getting
the id of objects:
I have 2 functions in my code, one to display a mainscreen and one to clear a
list which is declared within the first function:
function mainwindow(){
$window = &new GtkWindow();
..........
$scrolled_window = &new GtkScrolledWindow();
$scrolled_window->set_policy(GTK_POLICY_NEVER, GTK_POLICY_ALWAYS);
//filling a list
$mainBox->pack_start($scrolled_window, true, true, 0);
}
function clearlist() {
global $list, $items;
$list->clear_items(0,count($items));
}
If I write the code for the mainscreen outside of the function it all works
great. The list will get cleared. However, within a function I can't seem to
make it work. I tried to declare the vars for the list object global too within
the first function but it doesn't find the object:
<b>Fatal error</b>: Call to a member function on a non-object in <b>
Does anyone of you have a solution/pointer for me?
Regards,
Hans Wolters
--
Linux : http://linux.gelrevision.nl/
phpReview : http://phpReview.nl.linux.org/
Boeken : http://nl.linux.org/boeken/