[812] in The GTK GIMP ToolKit mailing list archive

home help back first fref pref prev next nref lref last post

[gtk-list] Re: Gtk and the scripting languages of the world

daemon@ATHENA.MIT.EDU (Marius Vollmer)
Sun Aug 24 08:59:41 1997

To: gtk-list@redhat.com
From: Marius Vollmer <mvo@zagadka.ping.de>
Date: 24 Aug 1997 11:33:21 +0200
In-Reply-To: Kenneth Albanowski's message of Sat, 23 Aug 1997 15:42:41 -0400 (EDT)
Resent-From: gtk-list@redhat.com
Reply-To: gtk-list@redhat.com

Kenneth Albanowski <kjahds@kjahds.com> writes:
> 
> On 23 Aug 1997, Marius Vollmer wrote:
> 
> > Then we can't use them.  But the gtk_object_set_data/get_data
> > mechanism can work with types, I think.
> 
> Oh yes. Here's a sample from Gtk. (Which _still_ isn't on CPAN. I think
> Andreas is at perlcon in SJ, at the moment, or coming back from it.)
>
> [...]

I was thinking about adding two new functions to the gtk_object_*
family:

    gtk_object_set_typed_data (GtkObject*, gchar *key, const GtkArg *data);
    gtk_object_get_typed_data (GtkObject*, gchar *key, GtkArg *data);

The GtkArg structure contains the type id and some value in its "d"
union, as usual.  I have already unified the GTK_ARG_* types with the
GtkObject* types and added support for enums, bit masks and reference
counted structures, so that -- with some more additions -- every type
the interpreter cares about can be expressed.

Data that has been set with gtk_object_set_data and is then retrieved
with gtk_object_get_typed_data comes back with a GTK_ARG_POINTER type,
which is probably of no use to the interpreter.  When there are
important cases for the interpreter, where it needs to access untyped
data, it has to special-case them.

Data set with gtk_object_set_typed_data cannot be retrieved with
gtk_object_get_data, because the type information will be lost.

--
To unsubscribe: mail -s unsubscribe gtk-list-request@redhat.com < /dev/null


home help back first fref pref prev next nref lref last post