[Openmcl-devel] Core Animation demo fails under OSX 10.6

Raffael Cavallaro raffaelcavallaro at mac.com
Thu Aug 26 00:45:54 UTC 2010


On Aug 25, 2010, at 6:55 PM, Neil Baylis wrote:

> I simply inserted the call to #/setWantsLayer at line 84. This causes Ron's demo to behave similarly to mine, in that the view is no longer rendered. All you get is a blank window. Comment out that line, and it works as expected. My demo is structured similarly to Ron's and at the corresponding point, I have the same call. 
> 
> I do see that the mouse events are honored, and the drawRect delegate is called, but nothing appears on the screen.
> 
> I have no idea what that means yet.


After reading the stack overflow response, I tried changing the order in which things happen. The stack overflow answer suggests that layers will not render properly if they are configured *before* the window is drawn to the screen.

If you call #/setWantsLayer *after*
1. putting the window on screen
2. setting the view as the window's content view

then it does work. i.e. change your xxx.lisp's make-scribble-window function to look like this:

(defun make-scribble-window ()
  (let ((w (make-ns-window 300 300 "Scribble"))
        (v (make-instance 'scribble-view)))
    (#/makeKeyAndOrderFront: w nil) ;; this is important!
    (#/setAlphaValue: v 0.5)
    (#/setContentView: w v)
    (#/setWantsLayer: v #$YES) ;; do this last
    w))

 So maybe you should rework your CA demos so that the #/setWantsLayer, etc happens *after*

1. calling #/makeKeyAndOrderFront: or the equivalent on the window
2. calling #/setContentView

Let us know if this helps.

warmest regards,

Ralph


Raffael Cavallaro
raffaelcavallaro at me.com








More information about the Openmcl-devel mailing list