This is the mail archive of the
guile-gtk@sources.redhat.com
mailing list for the Guile project.
Re: getting the size and origin of a GtkWindow
- To: Russell McManus <russell dot mcmanus at msdw dot com>
- Subject: Re: getting the size and origin of a GtkWindow
- From: Marius Vollmer <mvo at zagadka dot ping dot de>
- Date: 30 Jan 2001 00:26:15 +0100
- Cc: guile-gtk at sourceware dot cygnus dot com
- References: <200101292106.QAA10520@hqsmh3.ms.com>
Russell McManus <russell.mcmanus@msdw.com> writes:
> I'd like to get and set the origin and size of a GtkWindow, that I've
> created in guile-gtk. Is this possible?
Hmm, I don't think so. How would you do this from C? It is probably
easy to add the missing things to guile-gtk once it is clear in what
way the Gtk+ API wants to be used.
Hmm^2, the right way probably involves GtkAllocation which doesn't
exist in guile-gtk yet. I don't think we want to add support for it
because it is too similar to a rectangle.
Hmm^3, [time passes] I just added a `cname' field option to
build-guile-gtk. You can now say things like
(define-object GtkWidget (GtkObject)
(fields
(uint requisition-width (cname requisition.height))
(uint requisition-height (cname requisition.width))
(int allocation-x (cname allocation.x))
(int allocation-y (cname allocation.y))
(uint allocation-width (cname allocation.width))
(uint allocation-height (cname allocation.height))
(GtkStyle style)
(GdkWindow window)))
in the defs files and access the allocation.x field of a GtkWidget w
like so
(gtk-widget-allocation-x w)
Nice and esay, eh? :)
Please update from CVS to get this change. But I guess this is not
really what you want to have, right?
[ Maybe we should automatically translate dashes to dots in field
names. Dashes are illegal in C identifiers anyway... ]