From mboxrd@z Thu Jan 1 00:00:00 1970 From: Marius Vollmer To: Russell McManus Cc: guile-gtk@sourceware.cygnus.com Subject: Re: getting the size and origin of a GtkWindow Date: Mon, 29 Jan 2001 15:36:00 -0000 Message-id: <87puh6x7mw.fsf@zagadka.ping.de> References: <200101292106.QAA10520@hqsmh3.ms.com> X-SW-Source: 2001-q1/msg00007.html Russell McManus 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... ]