Re: Passing variables between functions
| From: | Martin Cameron | Date: | Wed, 21 Mar 2001 20:19:55 +0000 |
| Subject: | Re: Passing variables between functions | ||
| References: | 1 2 | Groups: | php.gtk |
| Request: | Send a blank email to php-gtk+get-1061@lists.php.net to get a copy of this message | ||
Hi Andrei
Thanks for your prompt response.
I've tried changing create_list function by adding these lines:
function create_list(){
global $window, $vapned, $list, $text, $labeltext, $labelname,
$entry;
$vbox = & new GtkVbox(FALSE,10);
$vbox->set_border_width(10);
$scrolled_window = & new GtkScrolledWindow(NULL,NULL);
$scrolled_window->set_policy(GTK_POLICY_AUTOMATIC,
GTK_POLICY_AUTOMATIC);
$scrolled_window->set_usize(400,500);
$vbox->pack_start($scrolled_window, TRUE,TRUE,0);
$scrolled_window->show();
---> $entry = new GtkEntry();
---> $username = $entry->get_text;
if($username == ''){
$username = "phkfoste";
}else{
$username = $entry->get_text;
}
but to no avail. Can you give me a bit more of a lead.
Regards
Martin Cameron
Andrei Zmievski wrote:
> If you have local $entry declared as global, it means that it's already a
> reference (to the global $entry variable), and by doing
>
> $entry = &new GtkEntry();
>
> you simply disassociate local $entry from global one and set it to
> GtkEntry. Try doing this:
>
> $entry = new GtkEntry();
>
> -Andrei
> * Unix is user friendly, it is just chooses its users selectively. *