Hi,
I'm trying to use the place manager but am running into a problem.
LTk implements the optional width and height parameters to the place manager through the use of keyword arguments and a conditional in the format-wish call. However, the two calls to tk-number are made without a check to see if the relevant parameter was supplied.
Am I right in thinking this is a bug or am I just mis-using this method?
Many thanks!
A bug, the code should be:
(defmethod place (widget x y &key width height) (format-wish "place ~A -x ~A -y ~A~@[ -width ~a~]~@[ -height ~a~]" (widget-path widget) (tk-number x) (tk-number y) (and width (tk-number width)) (and height (tk-number height))) widget)
(will be fixed in the next LTk release too)
Peter
On Tue, Sep 9, 2008 at 12:59 AM, Phil Armitage philip.armitage@gmail.com wrote:
Hi,
I'm trying to use the place manager but am running into a problem.
LTk implements the optional width and height parameters to the place manager through the use of keyword arguments and a conditional in the format-wish call. However, the two calls to tk-number are made without a check to see if the relevant parameter was supplied.
Am I right in thinking this is a bug or am I just mis-using this method?
Many thanks!
-- Phil Armitage http://phil.nullable.eu/ _______________________________________________ ltk-user site list ltk-user@common-lisp.net http://common-lisp.net/mailman/listinfo/ltk-user
* "Peter Herth" 5921d57c0809090026l73b0ea27qae5e8544082a667e@mail.gmail.com : Wrote on Tue, 9 Sep 2008 09:26:15 +0200:
| A bug, the code should be: | | (defmethod place (widget x y &key width height) | (format-wish "place ~A -x ~A -y ~A~@[ -width ~a~]~@[ -height ~a~]" | (widget-path widget) | (tk-number x) (tk-number y) | (and width (tk-number width)) | (and height (tk-number height))) | widget) | | (will be fixed in the next LTk release too)
[I may have mentioned this a few years ago, but since it is going to be changed now, I would suggest replacing this signature completely.]
Tk's `place configure window' is pretty powerful (See man place(n)) but the power is not available through LTK, through this method.
The current method's signature is too restrictive, and it also prevents one from extending it with &rest so you can pass the other options directly to Tk.
i.e. I'd suggest changing it to
place (widget x y &rest rest)
where REST could contain :width <width> :height <height> :relx <relx> :rely <rely> etc where each keyword maps to a corresponding option which is accepted by the place configure command.
-- Madhu