Re:
| From: | Steph | Date: | Thu, 04 Jul 2002 20:00:39 +0000 |
| Subject: | Re: | ||
| Groups: | php.gtk.general | ||
| Request: | Send a blank email to php-gtk-general+get-2209@lists.php.net to get a copy of this message | ||
they are giving a handle to the child property belonging to the frame,
and then removing it.
----- Original Message -----
From: "Pablo Fischer" <exilion@yifan.net>
To: "Steph" <sfox@php.net>
Cc: <php-gtk-general@lists.php.net>
Sent: Thursday, July 04, 2002 2:53 PM
>
her.com.mx><1025746826.5127.11.camel@pablo.fischer.com.mx><3D23B104.4060
901@
> akbkhome.com><1025750667.2919.15.camel@pablo.fischer.com.mx>
> <03a001c2230f$0086a1a0$e09001d5@p2q4w7>
> <1025757670.10559.2.camel@pablo.fischer.com.mx>
> <042c01c22368$80501ca0$e09001d5@p2q4w7>
> Content-Type: text/plain; charset=ISO-8859-1
> Content-Transfer-Encoding: quoted-printable
> X-Mailer: Evolution/1.0.2-5mdk
> Date: 04 Jul 2002 09:55:25 -0500
> Message-Id: <1025794526.2887.1.camel@pablo.fischer.com.mx>
> Mime-Version: 1.0
> Subject: Re: Fw: [PHP-GTK] Actions to other place
> Status:
>
> Thanks.. It works.. just a question. What does this lines are doing?
>
> $child =3D $work_area->child;
> if($child) $work_area->remove($child);
>
> Thanks.
>
>
>
> El jue, 04-07-2002 a las 09:38, Steph escribi=F3:
> > Don't globalise the poor thing and it will work ..
> >=20
> > <?
> > dl('php_gtk.' . (strstr(PHP_OS, 'WIN') ? 'dll' :
> > 'so'));
> >=20
> > function create_button($box) {
> > $work_area =3D &new GtkFrame();
> > $box->pack_start($work_area, true);
> > $func_button =3D &new GtkButton("Function Button");
> > $func_button->connect_object('clicked', 'news', $work_area);
> > $box->pack_start($func_button, false);
> > }
> >=20
> > function news($work_area) {
> > $child =3D $work_area->child; =20
> > if($child) $work_area->remove($child);
> > $label =3D &new GtkLabel("News");
> > $work_area->add($label);
> > $label->show();
> > }
> >=20
> > $window =3D &new GtkWindow();
> > $window->connect_object('destroy', array('gtk',
> > 'main_quit'));
> > $box =3D &new GtkVBox();
> > $window->add($box);
> > create_button($box);
> > $window->show_all();
> >=20
> > gtk::main();
> > ?>
> > ----- Original Message -----=20
> > From: "Pablo Fischer" <exilion@yifan.net>
> > To: "Steph" <sfox@php.net>
> > Cc: <php-gtk-general@lists.php.net>
> > Sent: Thursday, July 04, 2002 4:41 AM
> > Subject: Re: Fw: [PHP-GTK] Actions to other place
> >=20
> >=20
> > > Sorry.. doesnt works:
> > >=20
> > >=20
> > >=20
> > > > if($label) { ......
> > >=20
> > > <?php
> > >=20
> > > function show_news() {
> > > global $work_area,$label;
> > > if($label) {
> > > $work_area->remove($label);
> > > $label =3D &new GtkLabel("News");
> > > $work_area->add($label);
> > > $label->show();
> > > }
> > > return $label;
> > > }
> > > ?> =20
> > >=20
> > >=20
> > > I can just add/remove an object from a frame and I need to
add/remove
> > > the object the times that a button its clicked.
> > >=20
> > > Paul Fischer
> > >=20
> >=20
> >=20
>
>
>
> --
> PHP-GTK General Mailing List (http://gtk.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>