Lisp HUG Maillist Archive

OUTPUT PANE WOE

Message

The code fragment below results in an error when the interface window is minimized (to the task bar) and then Restored. The same error occurs if another pane or window covers the output pane.  The output pane is the culprit only when and if it contains any callback result.  The error occurs  both in running the source code and when the code is delivered.

The version is LWW professional 4.2.6 on Windows XP and the error reported in both situations was “UNDEFINED FUNCTION #:T called with arguments (#<:OUT 20687354>0 0 301 101).

 

 Any thoughts?

 

Cyril Fefer

 

 

(capi:define-interface test-output ()

              ()

              (:panes

                (push            capi:push-button

                                               

                                                :text "CLICK TO SEE."

                                                :callback-type :data

                                                :callback #'(lambda (text) (setf (capi:output-pane-display-callback op) (gp:draw-rectangle op 10  50  200  20 ))))

                (op   capi:output-pane  

                                     :min-width 300

                                     :min-height 100))

               (:layouts

               (default-layout

                        capi:grid-layout

                '(push op)))

                            (:default-initargs  :title "why?"))

Re: OUTPUT PANE WOE

Cyril Fefer wrote:

> 
>  Any thoughts?

> (text) (setf (capi:output-pane-display-callback op) (gp:draw-rectangle 
> op 10  50  200  20 ))))

You are setf'ing the display-callback to the result of gp:draw-rectangle
(which returns T).  The display-callback is called when exposing or showing the
window.  Since it is set to T, which is not a function, it bombs.

I am not sure what you are trying to do but,

(capi:define-interface test-output ()
   ()
   (:panes
    (push capi:push-button
          :text "CLICK TO SEE."
          :callback-type :interface
          :callback
          (lambda (interface)
            (gp:draw-rectangle (op interface)
                               10  50  200  20 )))
    (op capi:output-pane
        :accessor op
        :min-width 300
        :min-height 100))
   (:layouts
    (default-layout capi:grid-layout '(push op)))
   (:default-initargs  :title "why?"))

Wade


Updated at: 2020-12-10 08:55 UTC