Re: Exporting the Gtk+ object system to interpreters [was: no_marshall signals and GtkTypeInfo]



On 19 Dec 1998, Marius Vollmer wrote:

> Why do you want to export the Gtk+ object system to Perl?  What things
> are you/your users doing with it?  Creating new composite widgets like
> the TicTacToe widget from the Tutorial, or hooking really deep into
> Gtk+ to write something like the Dial widget?  At what points becomes
> Perl/Gtk too limited so that you have to `escape' to C?

Ah, now I understand what you are asking. I simply want to be able to code
a widget in Perl that is as good as any widget coded in C. (Ideally, that
widget should then be usable from other environments, including C, but
technical limitations exist.) This includes composite widgets (one is
already included, the ColorSelectButton), and completely novel widgets.
There shouldn't be any concept of "deep hooks" needed for the latter one,
merely an exposure of the complete API needed to create and display
widgets. I've exposed most of Gdk for quite some time.

My primary rationale for this is that A) the entire point of an OO GUI is
being able to do this sort of thing, B) Perl is efficient enough to pull
it off, and C) Tcl/Tk makes this (and all sorts of other stuff) such a
pain that I want to see it done right for once, in a mainsteam toolkit. I
don't expect all widgets to be written in an interpreted language (C is
unquestionably more efficient), but I want the capability to be there,
especially if this permits better code. Ideally, I'd like any languages
running in the same process to be able to exchange widgets freely.

Also, I think by proving that everything can be managed outside of C,
using Gtk in languages other then C _or_ Perl becomes easier. Scheme,
Eiffel, Java, whatever. 

> I ask this because I'm not really familiar with programming in Gtk+.
> I want to judge how important it is to get this object system jazz
> right.  Or if one can just say: "Too tricky to get right, use this
> approach instead."

Well, I consider it important from an abstract viewpoint, but I'm also
quite sure it is a valuable technique. Consider taking OO to the max and
making your entire application an instance of a new widget class. Or
simplifying your application by making all fifty "slightly special
checkboxes" instances of a descendant class of GtkCheckBox. Or creating a
new canvas/text-manager sub-type. 

-- 
Kenneth Albanowski (kjahds@kjahds.com, CIS: 70705,126)




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