[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
New and Open menu items
- To: info-macl@cambridge.apple.com
- Subject: New and Open menu items
- From: lynch@aristotle.ils.nwu.edu
- Date: Fri, 25 Oct 91 10:35:51 CDT
The save, save-as, close, save-copy-as, revert, and print menu-items and
their corresponding functions are a delight.
I was hoping to not have to make my own file menu at all in a quick little
application I was writing. OK, call me lazy.
Unfortunately, open and new are rather close-minded, if I may
anthropomorphize.
I am currently altering the (menu-item-action-function...) slot of these
menu-items. This is offensive, natch.
A crude solution, off the top of my head, would be to have some global
variables: (sorry Mike).
*new-and-open-file-type*, initialized to :text
*open-file-type-alist* , initialized to ((:text . #'edit-select-file))
*new-file-type-alist*, initiailize to ((:text . #'(lambda () (make-instance
'fred-window))
[Perhaps :text above should be replaced with :fred?]
The New and Open menu-items would then (funcall (assoc
*new-and-open-file-type* *<open/new>-file-type-alist*))
Programmers could push new cons cells onto the latter two, and alter the
first to easily change the behavior of the New and Open file-menus.
I heartily support the coincidental request that a generic window-hardcopy
be written (I'll even try it!!!), and further suggest that it be made the
default.
"TANSTAAFL" Rich lynch@ils.nwu.edu