[Openmcl-devel] NSApplication run method does not seem to work quite right
Willem Rein Oudshoorn
woudshoo at xs4all.nl
Sat Mar 8 11:59:25 PST 2014
I am trying to use the objc bridge to create a GUI using the cocoa
framework. However the way I try it does not seem to work quite right.
In Objective C I can do the following:
main (int argn, char *argv)
NSApplication* app = [NSApplication sharedApplication];
NSWindow* window = [[NSWindow alloc] initWithContentRect: NSMakeRect (100, 100, 300, 300)
styleMask: NSTitledWindowMask | NSClosableWindowMask | NSResizableWindowMask
When running this I get a resiable window which does work, I can resize
If I do the equivalent in CCL with the objc bridge:
(defparameter *app* nil)
(defun make-app ()
(defparameter *window* nil)
(defun make-window ()
(ns:with-ns-rect (frame 0 600 300 300)
:style-mask (logior #$NSTitledWindowMask
(defun start-run-loop ()
(defun test ()
(#/makeKeyAndOrderFront: *window* nil)
(process-interrupt ccl::*initial-process* #'start-run-loop))
It seems to work at first glance, however, I cannot resize the window
and I get the beach ball.
So it seems that something goes wrong with handling events. But I
cannot figure out what.
If someone has any hints where I can look, that is appreciated.
Note, I can get it to work by using (require :COCOA) and use the
infrastructure setup by the IDE. (Not suprisingly :-)).
However I slightly prefer playing with cocoa without the CCL IDE.
More information about the Openmcl-devel