Re: Can't invoke gp functions on output panes
"Karim Haddad (as karim dot haddad at ircam dot fr)" <[email protected]>
| Newsgroups | gmane.lisp.lispworks.general |
|---|---|
| Message-ID | <[email protected]> |
Dear Yuri, Of what i know, on macosx since big sur and LW8, all drawings to an output-pane should be donw from within the display-callback. On Linux and win it's always ok to do so. (see release notes LW8 (12.6) Best Karim On Sun, Feb 02, 2025 at 03:31:45PM +0100, Yuri Davidovsky (as work at disclosure dot ie) wrote: > I may be doing something wrong, but not sure what it could be. For some reason calling functions from the graphics-ports package does not seem to work on output panes on my machine. This is the boilerplate functionality that I have used many times before (although it has been a while since and it was on windows), but suddenly it is not working on macos. Have a look at a quick screencast I made (it may be difficult to believe otherwise): > > https://www.disclosure.ie/public/draw-line.mp4 > > Basically, what happens is that I am trying to create an empty output pane in a fresh instance of LW, store it in a variable and then try to do something with it, like drawing a line. > > > CL-USER 5 > (setf a (capi:contain (make-instance 'capi:output-pane))) > #<CAPI:OUTPUT-PANE 80101A14DB> > > CL-USER 6 > (gp:draw-line a 0 0 100 100) > > > At that stage it bales out with an error similar to > > > Error: Invoking a method "graphicsPort" on a null pointer. > 1 (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. > > CL-USER 7 : 1 > :b > Call to INVOKE-DEBUGGER > Call to ERROR > Call to OBJC::INVOKE-INTO* > Call to GRAPHICS-PORTS::SET-GP-COCOA-NSCONTEXT > Call to GRAPHICS-PORTS::ENSURE-GP-REPRESENTATION-CGCONTEXT > Call to (METHOD GRAPHICS-PORTS::%LOAD-GRAPHICS-STATE-WITH-ARGS (GRAPHICS-PORTS::GP-COCOA-MIXIN T T T T)) > Call to GRAPHICS-PORTS:DRAW-LINE > Call to EVAL > Call to CAPI::CAPI-TOP-LEVEL-FUNCTION > Call to CAPI::INTERACTIVE-PANE-TOP-LOOP > Call to MP::PROCESS-SG-FUNCTION > > > What could the problem be? It appears to happen with other gp functions too, like draw-text. Seems like it could be an issue with calling into the OS graphic shell library? The OS used is Sequoia 15.1.1 (24B91) > > A strange part is that I also tried to load one of the capi examples > > (cached-display.lisp in "/Applications/LispWorks 8.0 (64-bit)/Library/lib/8-0-0-0/examples/capi/output-panes/cached-display.lisp”) > > and it worked fine, meaning it displayed a pane with a grid in the background and the arrow could be drawn in it when dragging the mouse, however when I tried to do the same with the pane that was created by this example code (meaning, drawing a line from the listener), it produced the same outcome as above. Very puzzling. > > Any ideas? > -- Karim Haddad Music Representations Team, IRCAM Research and development manager. email : [email protected] webpage : http://karim.haddad.free.fr _______________________________________________ Lisp Hug - the mailing list for LispWorks users [email protected] http://www.lispworks.com/support/lisp-hug.html