Re: GtkPlug for Windows

From: Date: Thu, 01 Feb 2007 14:34:46 +0000
Subject: Re: GtkPlug for Windows
References: 1 2 3 4  Groups: php.gtk.dev 
Request: Send a blank email to php-gtk-dev+get-3662@lists.php.net to get a copy of this message
Andrei Zmievski wrote:
Hi, There is a reason that we do:
     wrapped_obj = g_object_new(phpg_gtype_from_zval(this_ptr), NULL);
Instead of:
     wrapped_obj = gtk_plug_new(socket_id);
Either one creates GtkPlug object under normal circumstances. The difference appears when you try to subclass GtkPlug class in PHP-land and register it as a Gtk+ type. Now, since you have to call parent's constructor, the first call would properly get the gtype from your custom class and create your custom Gtk+ object. The second call would erroneously create GtkPlug. I think that we do not need the gtk_plug_construct() override. Just incorporate that call into the GtkPlug constructor. -Andrei The problem is that using the phpg_gtype_from_zval and then trying to
use gtk_plug_construct on it doesn't work - instead it throws Fatal error: Internal object missing in GtkPlug wrapper - so it's NOT creating a GtkPlug under normal circumstances - any ideas why this isn't working? I'd rather have a working implementation that can't be subclassed in userland than have a non-working version that can :)

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