[Openmcl-devel] Window ownership, association and other subtleties

Didier Verna didier at lrde.epita.fr
Sun Feb 3 13:41:21 PST 2008

       Hi again,

I have a custom window-controller initialized as follows, from a method
in the application delegate:

  (objc:defmethod (#/browser: :void) ((self app-delegate) sender)
    (let ((mwc (or (main-window-controller self)
            (setf (main-window-controller self)
                  (make-instance main-window-controller
                                :with-window-nib-name "MainWindow")))))

and later, (#/showWindow mwc).

For some reason, anyplace I try (#/window mwc), I get a null foreign
pointer. On the other hand, my window controller does receive
notifications such as the following prints a non null pointer:

(objc:defmethod (#/windowShouldClose: :<BOOL>)
    ((self main-window-controller) window)
  (princ window)(terpri))

There seem to be some subtleties in the Apple's doc about window
controllers. For instance, #/window is documented as returning the
window "owned" by the receiver whereas #/showWindow is said to display
the window "associated" with the receiver. This makes me worried... :-)

So how do I make #/window actually return something ?

Thanks !

Resistance is futile. You will be jazzimilated.

Didier Verna, didier at lrde.epita.fr, http://www.lrde.epita.fr/~didier

EPITA / LRDE, 14-16 rue Voltaire   Tel.+33 (0)1 44 08 01 85
94276 Le Kremlin-Bicêtre, France   Fax.+33 (0)1 53 14 59 22  didier at xemacs.org

More information about the Openmcl-devel mailing list