Changeset 15030


Ignore:
Timestamp:
Oct 20, 2011, 6:58:05 PM (8 years ago)
Author:
gz
Message:

Add new-listener convenience function

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/source/cocoa-ide/cocoa-utils.lisp

    r14895 r15030  
    158158  (first-window-satisfying-predicate #'(lambda (w) (typep (#/windowController w) controller-type))))
    159159
     160
     161(defun new-listener ()
     162  (let ((wptr (execute-in-gui (lambda ()
     163                                (declare (special hemlock-listener-document))
     164                                (#/newListener: (#/delegate *NSApp*) (%null-ptr))
     165                                (let ((doc (#/topListener hemlock-listener-document)))
     166                                  (unless (%null-ptr-p doc)
     167                                    (#/window (#/lastObject (#/windowControllers doc)))))))))
     168    (when wptr (hemlock-view wptr))))
     169
    160170;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
    161171;;
Note: See TracChangeset for help on using the changeset viewer.