ASPN ActiveState Programmer Network
ActiveState
/ Home / Perl / PHP / Python / Tcl / XSLT /
/ Safari / My ASPN /
Cookbooks | Documentation | Mailing Lists | Modules | News Feeds | Products | User Groups


Recent Messages
List Archives
About the List
List Leaders
Subscription Options

View Subscriptions
Help

View by Topic
ActiveState
.NET Framework
Open Source
Perl
PHP
Python
Tcl
Web Services
XML & XSLT

View by Category
Database
General
SOAP
System Administration
Tools
User Interfaces
Web Programming
XML Programming


MyASPN >> Mail Archive >> php-gtk-dev
php-gtk-dev
Re: [PHP-GTK-DEV] Custom Signals Support
by Andrei Zmievski other posts by this author
Mar 16 2007 11:47AM messages near this date
[PHP-GTK-DEV] Custom Signals Support | Re: [PHP-GTK-DEV] Custom Signals Support
I had a closer look at this.

>  First of all, signals are assigned globally for a gtype.  Right now  
>  php classes that extend a php-gtk gtype aren't creating their own  
>  gtype but just using their parents.  Why is this bad? Well if you  
>  extend gtkwindow and add a custom signal...the signal is added to  
>  gtkwindow (and by default also to your extended class) which may  
>  not be the intended behavior.  Now, it is possible to create new  
>  gtypes that extend a parent gtype so I know HOW to fix the problem,  
>  however I don't know WHERE that code needs to go.  Any suggestions?

I've started work on registering custom gtypes (from PHP classes).  
It's quite involved and I'll probably commit a big chunk once it's  
working.

>  The second problem is I'd like to allow custom signals to be  
>  created using just a class name and not an object instance.  I can  
>  grab the zend_class_entry but right now the gtype is NOT stored in  
>  it.  You can get the class entry from the gtype...but not the other  
>  way around.  Any suggestions for fixing that problem?

There is phpg_gtype_from_class(), but if you think it's useful to  
specify gtype via class name, then we should just add that to  
phpg_gtype_from_zval().

As for the patch.. Why do you think it's better to specify the class  
closure explicitly rather than rely on a standard, like  
"do_<signal_name> " or something similar?

Also, I'm thinking about moving all signal/type related methods and  
constants to GObject. Currently we have a few in Gtk:: class, but on  
reflection, I don't think it's the right place for it. I'd rather  
move it before the beta release. Any disagreements?

-Andrei

-- 
PHP-GTK Development Mailing List (http://gtk.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
Thread:
Elizabeth Smith
Andrei Zmievski
Steph Fox
Andrei Zmievski
Elizabeth Smith

Privacy Policy | Email Opt-out | Feedback | Syndication
© ActiveState Software Inc. All rights reserved