RE: [PHP-GTK-DEV] __gtype and constants
| From: | Steph | Date: | Sat, 14 Aug 2004 11:26:02 +0000 |
| Subject: | RE: [PHP-GTK-DEV] __gtype and constants | ||
| References: | 1 | Groups: | php.gtk.dev |
| Request: | Send a blank email to php-gtk-dev+get-719@lists.php.net to get a copy of this message | ||
> Two things.
>
> 1. I hacked in a static class variable called '__gtype' which contains
> the GType object corresponding to the class it's in. For example,
> GtkButton::$__gtype will give you the GType object for it. To get the
> actual value of the type, GtkButton::$__gtype->type. Nifty or not?
:) it's very PHP 5-ish
> 2. I am trying to figure out how to go about doing constants. I can
> either leave them in the global namespace, e.g. GTK_WINDOW_TOPLEVEL, or
> I can move into each class' namespace, e.g. GtkWindow::TOPLEVEL. The
> access to the second version is a tad slower than the first, but I think
> it achieves a nice encapsulation. Thoughts?
I prefer global, but then I came out of the Ark. Should there be a poll on
this on the general list?
>
> -Andrei
> * DOS is, quite possibly, the worst text-adventure game ever. *
>
> --
> PHP-GTK Development Mailing List (http://gtk.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>