[Openmcl-devel] Mid-course correction

Ralf Stoye stoye at stoye.com
Mon Nov 5 14:02:55 PST 2007


Am 05.11.2007 um 19:40 schrieb Ron Garret:

> ns-window doesn't inherit from ns-view so it seems this little  
> jigjog is necessary.  Is that right?

yes, but every window has a content-view created, so you could use  
that one:

(defmethod initialize-instance :after ((w test-window) &rest args)
   (ccl::with-autorelease-pool
    (let* ((rect (ns:make-ns-rect 0 0 300 300))
	  (nsw (make-instance 'ns:ns-window
		            :with-content-rect rect
		            :style-mask (logior #$NSTitledWindowMask
					       #$NSClosableWindowMask
					       #$NSMiniaturizableWindowMask
					       #$NSResizableWindowMask)
			    :backing #$NSBackingStoreBuffered
			    :defer t)))     (setf (slot-value w 'ns-window) nsw)
      (setf (slot-value w 'ns-view) (#/contentView nsw))
      (#/setTitle: nsw #@"Test")
      (#/center nsw)
      (#/orderFront: nsw nil)
      (#/contentView nsw))))


have a look at
http://developer.apple.com/documentation/Cocoa/Conceptual/WinPanel/ 
Concepts/HowWindowsWork.html

How Windows Work
...
When it’s created, a window automatically creates two views: An  
opaque frame view that fills the frame rectangle and draws the  
border, title bar, other peripheral elements, and background, and a  
transparent content view that fills the content rectangle.
...


btw. you will see the real power of cocoa when you start to use table- 
views, a very clean Framework giving you many features that were  
rather difficult to archive in MCL (eg. connecting datasources  
tocolumns, drag&drop of columns, resizing,.......)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.clozure.com/pipermail/openmcl-devel/attachments/20071105/9ac7b60d/attachment.htm>


More information about the Openmcl-devel mailing list