Lisp HUG Maillist Archive

Bypassing CAPI entirely

I've been using LWM for a bit now, and I'd really rather not use CAPI 
for the Mac OS X GUI - I won't belabor the issues with CAPI's HIG 
non-conformance.

In brief, I'm trying to eliminate the LispWorks menubar entirely, and 
replace it with a menubar from a .nib file. I know that there is an 
example that allows one to load a .nib. However, when this runs, it is 
still possible to access the Tools menu, which will cause the LispWorks 
menu bar to reappear.

1. It would seem that I need to eliminate the LispWorks IDE main menu 
bar entirely. How would I do this?

2. Would it be possible to have, for example, a Listener window, 
without the associated menus? Part of the problem seems to be  that 
CAPI's notion of a menu is something associated with a view, but on the 
Mac platform, menus and views are entirely orthogonal - it's possible, 
and desirable, to have a menubar and no views, and the reverse as well 
- a view with no associated menubar.

Thanks for any insights,

Ralph



Raffael Cavallaro, Ph.D.
raffaelcavallaro@mac.com

______________________________________________________________________
This email has been scanned by the MessageLabs Email Security System.
For more information please visit http://www.messagelabs.com/email 
______________________________________________________________________

Re: Bypassing CAPI entirely

On Jan 6, 2005, at 9:11 PM, Raffael Cavallaro wrote:

> 2. Would it be possible to have, for example, a Listener window, 
> without the associated menus? Part of the problem seems to be  that 
> CAPI's notion of a menu is something associated with a view, but on 
> the Mac platform, menus and views are entirely orthogonal - it's 
> possible, and desirable, to have a menubar and no views, and the 
> reverse as well - a view with no associated menubar.

Maybe it would be much easier just to make your own interfaces rather 
than trying to manipulate the menus of the existing LispWorks 
interfaces. It is fairly simple to make a listener interface (and 
editor interface) with your own menus. Below is a simple listener  
interface I use when I compile my application in "debug" mode.

In LispWorks, I assume you will still get the standard Window menu. 
You'll probably need to do a little FLI programming to get rid of that.

Best,

John DeSoi, Ph.D.
http://pgedit.com/
Power Tools for PostgreSQL

=====

(defun debug-interface ()
   (display (make-instance 'debug-interface) :screen (or (second 
(screens)) (convert-to-screen))))

(define-interface debug-interface ()
   ()
   (:panes
    (lisp-pane
     listener-pane
     :reader lisp-pane
     :echo-area t
     :visible-min-width '(character 40)
     :visible-min-height '(character 20))
    (result-pane
     collector-pane
     :reader result-pane
     :buffer "Background Output" ;gets *standard-output* with this name
     :visible-min-width '(character 40)
     :visible-min-height '(character 20)))
   (:layouts
    (main
     tab-layout
     nil
     :items '(lisp-pane result-pane)
     :print-function #'(lambda (x) (ecase x (lisp-pane (localize 
"Lisp")) (result-pane (localize "Output"))))
     :visible-child-function #'identity
     :reader main-pane))
   (:menus
    (file-menu "File"
               (("Close" :callback 'quit-interface :accelerator #\w))
                :callback-type :interface)
    (edit-menu (localize "Edit")
               ((:component
                 (("Undo" :callback 'edit-undo :accelerator #\z)))
                (:component
                 (("Cut" :callback 'edit-cut :accelerator #\x)
                  ("Copy" :callback 'edit-copy :accelerator #\c)
                  ("Paste" :callback 'edit-paste :accelerator #\v)
                  ("Clear" :callback 'edit-clear))))
               :callback-type :interface))
   (:menu-bar file-menu edit-menu)
   (:default-initargs
    :title "Debug Delivery"
    :best-x 0
    :best-y 0
    :best-width '(character 120)
    :best-height 600))


(editor:bind-string-to-key "(" #\[ :mode "Lisp")
(editor:bind-string-to-key ")" #\] :mode "Lisp")
(editor:bind-string-to-key "[" #\control-\[ :mode "Lisp")
(editor:bind-string-to-key "]" #\control-\] :mode "Lisp")


(defmethod current-tab ((ed debug-interface))
   (if (eq (tab-layout-visible-child (main-pane ed)) (result-pane ed)) 
;test like this because we don't really get the edit-pane object
     'result-pane
     'lisp-pane))

(defmethod current-tab-pane ((ed debug-interface))
   (slot-value ed (current-tab ed)))

(defmethod current-tab-buffer ((ed debug-interface))
   (editor-pane-buffer (current-tab-pane ed)))


(defmethod edit-undo ((ed debug-interface))
   (call-editor (current-tab-pane ed) "Undo"))

(defmethod edit-cut ((ed debug-interface))
   (call-editor (current-tab-pane ed) "Kill Region"))

(defmethod edit-copy ((ed debug-interface))
   (call-editor (current-tab-pane ed) "Save Region Preserving 
Selection"))

(defmethod edit-paste ((ed debug-interface))
   (call-editor (current-tab-pane ed) "Un-Kill"))

(defmethod edit-clear ((ed debug-interface))
   (call-editor (current-tab-pane ed) "Delete Region"))


______________________________________________________________________
This email has been scanned by the MessageLabs Email Security System.
For more information please visit http://www.messagelabs.com/email 
______________________________________________________________________


Updated at: 2020-12-10 08:53 UTC