Re: Global scope

From: Date: Fri, 09 Jan 2004 16:32:48 +0000
Subject: Re: Global scope
References: 1  Groups: php.gtk.general 
Request: Send a blank email to php-gtk-general+get-4349@lists.php.net to get a copy of this message
Hi , you can destroy the GtkPixmap and then just add another to its container ... or better still (I think!) you can swap the contents of the GtkPixmap with set(); , eg //set up the 2 or however many images images... list($this->off_map, $this->off_mask) = Gdk::pixmap_create_from_xpm( $gdkwin , null , $IM_PATH . $im . '_off.xpm' ) ; list($this->on_map, $this->on_mask) = Gdk::pixmap_create_from_xpm( $gdkwin , null , $IM_PATH . $im . '_on.xpm' ) ; // some way of identifying them ( using set_data() would probably be a better way to identify them but anyway ) $on = &new GtkPixmap( $this->on_map , $this->on_mask) ; $on->set_name( 'on' ) ; $off = &new GtkPixmap($this->off_map, $this->off_mask); $off->set_name( 'off' ); ( $what == 'off' ) ? $some_container->add( $off ) : $some_container->add( $on ) ; //then to swap the images $ims=$some_container->children(); if($ims[0]->get_name()=='off' ){ $ims[0]->set($this->on_map, $this->on_mask); $ims[0]->set_name( 'on' ); }else{ $ims[0]->set($this->off_map, $this->off_mask); $ims[0]->set_name( 'off' ); } or along those lines anyway... Regards, Simon. ----- Original Message ----- From: "Frank Kicenko" <frank.kicenko@amjtcam.com> To: <php-gtk-general@lists.php.net> Sent: Wednesday, December 24, 2003 11:01 PM Subject: [PHP-GTK] Global scope > Hi all, > > I have a question. > > I have a Clist which works just fine, I have the callbacks working fine. I > have the Clist shown at the top of the window and I have an area at the > bottom in which I will display images. I have registered a "select_row" > callback and I would like to change the image from the select_row callback > function. > > The question is... how do I insert the new image as there is an image > already added to the vbox? Any pointers on how to do this? > > Thanks. > > -- > PHP-GTK General Mailing List (http://gtk.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > > > >

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