Re: Extending PHP1 GTK Widget class with PHP?
| From: | Benjamin Smith | Date: | Tue, 06 Jun 2006 23:16:36 +0000 |
| Subject: | Re: Extending PHP1 GTK Widget class with PHP? | ||
| References: | 1 2 | Groups: | php.gtk.general |
| Request: | Send a blank email to php-gtk-general+get-6993@lists.php.net to get a copy of this message | ||
See below
On Monday 05 June 2006 23:45, Malk0 wrote:
> you can do
>
> function SuperTree(){
> parent::SuperTree();
> }
>
> this would work, by the way depending on what you really want to
> achieve it can be more suitable to create an object that contain an
> instance of a gtkwidget like this
So, let's say that I wanted to have a GtkText widget, but with some new method
embedded, the following should work:?
?
class ExtraText extends GtkText
{
Function ExtraText ($hadj=NULL, $vadj=NULL);
{
parent::gtkText($hadj, $vadj);
}
Function FancyExtraFunction()
{
DoSomethingReallyNeat();
}
} // end of class ExtraText
$eText=&New ExtraText();
$eText->Set_Usize($width, $height);
$eText->Show();
$eText->FancyExtraFunction();
?>
> class SuperTree{
> function SuperTree(){
> $this->ctree = &new gtkctree();
> }
> }
>
> this second manner will allow you to have other widget embedded in the
> SuperTree class, not the first one.
> hope this help,
> nathan
>
> On 6/6/06, Benjamin Smith <lists@benjamindsmith.com> wrote:
> > Is it possible to extend a Gtk Widget in PHP4/GTK1?
> >
> > EG:
> >
> > Class SuperTree Extends GtkCTree(
> >
> > Function SuperTree()
> > {
> > // HOW WOULD I INSTANTIATE THE GtkWidget?
> > }
> > ) // end class SuperTree
> >
> > -Ben
> > --
> > "The best way to predict the future is to invent it."
> > - XEROX PARC slogan, circa 1978
> >
> > --
> > PHP-GTK General Mailing List (http://gtk.php.net/)
> > To unsubscribe, visit: http://www.php.net/unsub.php
> >
> >
>
> --
> PHP-GTK General Mailing List (http://gtk.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
> --
> This message has been scanned for viruses and
> dangerous content by MailScanner, and is
> believed to be clean.
>
>
--
"The best way to predict the future is to invent it."
- XEROX PARC slogan, circa 1978