Re: gtk2-perl

On Wed, Oct 16, 2002 at 08:51:52PM -0400, muppet wrote:
namely, have you put any thought into how widgets from other sources 
will be bound into gtk2-perl?  i have several custom Gtk widgets in a C 
library i link into perl via XS, and make extensive use of 
Gtk::Widget->new_from_pointer in my old code.  this is a somewhat 
critcal feature for me.

and Daniel wrote (in private mail, hope it is OK to quote it here):
I have the following problem. Some function return GtkWidget. This can
correspond to the content of another Widget. In C, no problem, they
alwayas return a GtkWidget but this can be anything (like GtkButton or
GnomeDateEdit...). In perl, you can't do that : 


I think we will need some kind of type system to handle
certain cases:
* Sometimes we know exactly what class we are supposed
  return, no problems.
* In the signalhandler, the perl-object reference is saved
  in the closure. No problems.
* A function returns a GObject of unknown exact type which is 
  referenced from another GObject. Trouble!
  We need some kind of type system that given a GObject can
  return it corresponding perl package.
  - perhaps it could somehow be stored in the GObject at creation time
  - otherwise it could register itself at creation time or at
    package loading time with 
        + GType and
        + corresponding perl package.
    Maybe the GType mechanism can be extended to support this?
* Wrapping/accessing new widget should be possible through such
  a system and if the generic code if GObject which enables communication 
  with (at compile time) unknown object types.

Writing widgets in perl would be great fun.
Personally I like to concentrate on getting
a stable base implementation of gtk+ 2.0 for perl
together first.
But anyone is free to hack away towards whatever
satisfice their personal goals. Patches will be accepted
as long as they don't unneccassarily break thing.

happy hacking,


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]