mcclim: redisplay-frame-panes where application-pane contains a gadget fails

Daniel Kochmański daniel at turtleware.eu
Fri Nov 11 17:26:11 UTC 2022


Hey Paul,

sorry for taking so much time to respond. I'm answering your emails in batch.


> [two down one to go]

The issue was that (draw-rectangle* t 0 0 10 10 :filled nil) has the extent
[-.5 -.5 10.5 10.5], I've explained that the line thickness when filled is nil
is normally 1 (or 2 depending on the backend), so it extends beyond the
rectangle dimensions in question.

You've concured that LispWorks makes the bounding rectangle [0 0 11 11]
(proving that they take into account the line thickness), but I wonder why
they are doing that? If we draw a rectangle with line thickness 4 then the
bounding rectangle is [0 0 14 14] and not [-2 -2 12 12]? Does it mean that
drawing a border around the object may produce a result where the object is
not in the center, because it is "too close to the edge"?

Or does it mean that /after all drawing/ they move all output so it fits
inside the sheet region defined (by them) as [0 0 width height]? McCLIM allows
defining sheets with a region that is not aligned with 0X and 0Y, so perhaps
it is their limitation of the implementation?

> [follow up to previous convo]
>
> Please give the attached code a try. (clim-user::tryit)
> Keep left clicking in the pane. Expected behavior?

>From the file in question I think that you've mixed some other program after
the initial output (starting from the function ~test-draw-line~).

Either way the behavior I'm observing is expected. You take the sheet
dimensions to draw on a sheet and then the sheet dimensions are computed based
on the output (bar the fact that we seem to come beyond specified max-width -
this is most likely a bug).

> [with-radio-box]

Thank you for the kind words. CAPI backend sounds nice. I'm working on SDL2
backend on the other hand (in parallel with other things, i.e today I've
finished an initial port of ECL to emscripten, so it is possible to run CL in
the web browser (see turtleware.eu/static/ecl/ecl.html, open the js console).

Thanks for the code - it had an issue that "selected" toggle boxes did not
have a desired background. I've implemented this feature by hooking the
background directly in the local function MAKE-PANE (while still respecting
the background if the programmer explicitly supplied one). See the recent
commit if you are curious, here is the code for a simple test:

```
(define-application-frame with-boxes ()
  ()
  (:panes (app :application)
          (rad (with-radio-box (:background +light-blue+ :type :some-of)
                 "Daniel" "Ma"

                 (radio-box-current-selection "Kota")
                 (radio-box-current-selection "bata")

                 (make-pane :toggle-button :label "make-pane 1")
                 (radio-box-current-selection
                  (make-pane :toggle-button :label "make-pane 2"))

                 (make-pane :toggle-button :label "make-pane 1"
                                           :background +light-pink+)
                 (radio-box-current-selection
                  (make-pane :toggle-button :label "make-pane 2"
                                            :background +light-pink+))))))

(find-application-frame 'with-boxes)
```

> [mcclim: redisplay-frame-panes where application-pane contains a gadget
> fails]


Thanks for the report. Notice that if we define a redisplay command, then the
problem does not happen (when the command is activated) - that means that the
issue is caused by the fact that we try to redisplay the frame asynchronously

```
(define-v-frame-command (com-redisplay :menu t) ()
  (with-application-frame (frame)
    (redisplay-frame-panes frame)))
```

and indeed the issue is caused by the fact that the pane realizer is not
bound. REDISPLAY-FRAME-PANES works fine if we bind it:

```
(let ((fm (frame-manager *frame*)))
  (with-look-and-feel-realization (fm *frame*)
  (redisplay-frame-panes *frame*)))
```

That said asynchronous access is not safe unless you either call
EXECUTE-FRAME-COMMAND (safe!) and/or dispatch an event and handle it (safe and
low level). I hope that this is a satisfying answer.

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 Thursday, November 10th, 2022 at 19:38, Paul Werkowski <pw at snoopy.qozzy.com> wrote:


> LispWorks 8.0.1 Windows:
> McCLIM current source:
> Example attached
> 
> Paul
> 
> CLIM-USER 5 > (redisplay-frame-panes frame)
> 
> 
> Error: No applicable methods for #<STANDARD-GENERIC-FUNCTION MAKE-PANE-1
> 4160C3ACB4> with args (NIL #<CLIM-INTERNALS::DEFAULT-APPLICATION
> 
> 405047874B> LABEL-PANE :LABEL "A Label" :BACKGROUND
> 
> #<CLIM-INTERNALS::NAMED-COLOR "green">)
> 
> 1 (continue) Call #<STANDARD-GENERIC-FUNCTION MAKE-PANE-1 4160C3ACB4>
> 
> again
> 2 Clear the output history of the pane and reattempt forceful redisplay.
> 3 Clear the output history of the pane, but don't redisplay.
> 4 Skip this redisplay.
> 5 (abort) Return to top loop level 0.
> 
> Type :b for backtrace or :c <option number> to proceed.
> 
> Type :bug-form "<subject>" for a bug report template or :? for other
> 
> options.
> 
> CLIM-USER 6 : 1 >



More information about the mcclim-devel mailing list