CLIM mail archive
[Prev][Next][Index][Thread]
Re: setting a frame's position
Date: Tue, 17 May 94 15:26:40 PDT
From: Bruce Seely <bss@jupiter.risc.rockwell.com>
I have some frames in a resource that act as dialog boxes. Before a
frame is exposed, it is initialized. As part of the initialization, I
would like to position the frame reltive to its `host-frame'. I am
currently doing it like this:
(defmethod REINITIALIZE-INSTANCE :after ((frame my-frame-type) &key host-frame)
...
(multiple-value-bind (host-x host-y)
(frame-position host-frame)
(setf (getf (CLIM-INTERNALS::FRAME-GEOMETRY frame) :left) host-x)
(setf (getf (CLIM-INTERNALS::FRAME-GEOMETRY frame) :top) host-y))
...)
Is there a better way of setting the position of the frame (i.e. that
doesn't rely on functions in the CLIM-INTERNALS package)?
Yes - don't specify any geometry arguments when you initially create the
application-frame and then use POSITION-SHEET-CAREFULLY on the top level
sheet prior to calling RUN-FRAME-TOP-LEVEL to launch the frame.
There is one caveat which is only an issue for X windows - some window
managers decide to ignore program specified position hints and it is
necessary to use user specified hints. On Allegro CLIM you can use the
keyword arg :USER-SPECIFIED-POSITION-P when you initially make the
application-frame. I don't know if this is an issue for other
implementations.
-----
Colin Meldrum, Franz Inc. 1995 University Avenue, Suite 275
colin@Franz.COM (internet) Berkeley, CA 94704
uunet!franz!colin (uucp) Phone: (510) 548-3600; FAX: (510) 548-8253
References:
Main Index |
Thread Index