Re: interaction between php-gtk windows

From: Date: Mon, 03 Feb 2003 15:54:17 +0000
Subject: Re: interaction between php-gtk windows
References: 1  Groups: php.gtk.general 
Request: Send a blank email to php-gtk-general+get-3000@lists.php.net to get a copy of this message
On Mon, 3 Feb 2003, [iso-8859-1] D. Hammerich wrote: > i'm new with gtk-php an have basic problem. > there is the following class: > > class NewWindow { > var $window; > var $field; > var $button; > > //Constructor > function NewWindow() { > $this->window = new GtkWindow(); > $this->button = new GtkButton("Do something"); > $table = &new GtkTable(2,2); > .... and so on > } > added some functions ...attach the widgets to the > table.. > $this->window->show_all(); > } > > //for creating an instance of NewWindow via button > click in my toplevel window > function MyNewWindow() { > $mywindow = &new NewWindow(); > } > > then i connect MyNewWindow() with a button in the > toplevel window. > > Now MY QUESTION: > how can interacte these new "child"-windows with each > other. for example, how can i copy the content of a > entry of one window into the entry of the other window > via click > or how can i transfering data from the "child"-window > to the toplevel window via click You would need to keep track of each window's instance. Perhaps you load them into an array: $mywindows[] = &new NewWindow(); then you can refer to them via the array: $first_window = $mywindows[1]; $first_window_field = $first_window->field; $first_window_field_text = $first_window_field->get_text(0,-1); Is that what you're looking for? > i think i need a window handle to identify the window > i want to use. in any case - its a basic technique. Right, and the window 'handle' it what's returned from your &new NewWindow() function call. > i searched the web - nothing ! the php-gtk manual is a > joke, Insulting the people who write the docs (and are on list) is probably not the best way to get help. --rdp Rich Payne http://talisman.mv.com rdp at talisman dot mv dot com

« previous php.gtk.general (#3000) next »