Re: __gtype and constants

From: Date: Thu, 19 Aug 2004 19:10:06 +0000
Subject: Re: __gtype and constants
References: 1 2 3 4 5 6  Groups: php.gtk.dev 
Request: Send a blank email to php-gtk-dev+get-735@lists.php.net to get a copy of this message
On Wed, 18 Aug 2004, Alan Knowles wrote: > I though we could inject stuff into the phpdoc block area? I am a bit confused. What does phpdoc have to do with this? > That's an interesting subject.. it's kind of like an observer pattern, > python's syntax for it is really nasty ;) > > > class myObject extends GObject { > function mysignal_default_signal_hander($self, $var1) { > .... default implementation.... > } > function __construct() { > $s = new GSignal($this,'mysignal', G_SIGNAL_RUN_FIRST, > 'mysignal_handler'); > echo $s->id; // gets the signal ID.. > > } > function some_info() { > $id = GSignal::lookup($this,'mysignal'); > $name = GSignal::lookup_name($this,1); > $array = GSignal::list_names($this,1); > $array = GSignal::list_ids($this,1); Two of these are present in gtk.org API, but lookup_names() and list_names() are not. Did you make them up? > ah.. I see what you are getting at.. - the only kludge I can think of here.. > > function __construct() { > $p = new GParam($this,'propname'); > $p->default = ..... > $p->flags = ..... > > } > > of course in C# we would be doing > > $this += new GParam('propname'); > :) Or just $this->install_property().. - Andrei

« previous php.gtk.dev (#735) next »