mcclim: redisplay-frame-panes where application-pane contains a gadget fails
Daniel Kochmański
daniel at turtleware.eu
Sat Nov 12 20:43:29 UTC 2022
Hey,
the thing is that with-output-as-gadget is specified to return the gadget and not the output record containing it - that's really not useful, but that's what it is. That is the reason why you had to also manually specify the offset x0 y0 when drawing and add the bounding rectangle size.
I don't know how this should be handled in LW CLIM, but McCLIM returns two values and the second value is the created output record. In other words, this will give you the desired result disregarding whether the display is incremental or not:
(defun v-pane-df (frame pane)
(declare (ignore frame))
(multiple-value-bind (gadget gadget-output-record)
(with-output-as-gadget (pane :x 20 :y 20)
(declare (ignore pane))
(make-pane 'label-pane :label "A Label"
:background +green+))
(declare (ignore gadget))
(with-bounding-rectangle* (x1 y1 x2 y2) gadget-output-record
(draw-rectangle* pane x1 y1 x2 y2
:ink +red+ :filled nil :line-thickness 1))))
Best regards,
Daniel
--
Daniel Kochmański ;; aka jackdaniel | Przemyśl, Poland
TurtleWare - Daniel Kochmański | www.turtleware.eu
"Be the change that you wish to see in the world." - Mahatma Gandhi
------- Original Message -------
On Saturday, November 12th, 2022 at 16:03, Paul Werkowski <pw at snoopy.qozzy.com> wrote:
> Hi Daniel,
>
> I wonder if you could tell me what is happening. Not a bug, I think,
> because Lispworks CLIM does the same thing.
>
> If you still have that example I sent, change :incremental-redisplay to
> T and run the program.
> Note the blue border is does not surround the label but is size 100x100
> which is a default size somewhere.
>
> If I stuff the value of g into a global symbol (setq g g) and take the
> bounding rectangle size I get the correct value. I'm wondering if the
> problem is somehow related to dynamic-extent. Is there a correct way to
> use the gadget dimensions that works both settings of
> :incremental-redisplay?
>
> Thanks for any information you can share.
>
> Paul
More information about the mcclim-devel
mailing list