Re: Tcl/Gtk? gtk_signal_connect_interp?



Marius Vollmer <mvo@zagadka.ping.de> writes:

> The first thing you need to get straight is the mapping between the
> Gtk+ run-time type system and the TCL `type system' (cough).  You
> need to find ways to convert between each of the `fundamental' types
> of Gtk+.  They are listed in gtktypeutils.h as GtkFundamentalType.
> 
> Ints, floats, doubles, strings, enums, flags should be easy.
> Pointer does not need to be wrapped.  Boxed and Object is more
> complicated.  I think in TCL you need give these things names.
> Callbacks should'nt be any harder.

names aren't necessary.  Tcl (since 8.0) has an object system.

i.e., you can create new object types, defining conversions from some
object to that type, and from your new type to a string.  Commands
which take arguments of this new type use Tcl_Get*FromObj
(Tcl_GetIntFromObj, for example).  There's lazy conversion between the
two representations.  Callbacks aren't any harder; Tk just uses
strings (the code hasn't been updated), but I guess the code for
"after" or "trace" could be used to see how to do it properly.

It may be convenient to provide names, though, as Tk provides (or
requires) names for widgets.  These can then be made into commands (as
Tk's are) for manipulation.

I think looking at the way Perl/Gtk and Guile/Gtk are constructed is a
good suggestion, to use the same descriptions they use for getting at
all the types and functions.  Another *really* useful feature would be
providing compatibility with Tk's "send", for easy use of Tcl/Tk
programming tools, and other communication between Tcl/Tk and Tcl/Gtk
applications.



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