[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Too many menus ?
- To: email@example.com
- Subject: Too many menus ?
- From: firstname.lastname@example.org (Jeff Lind)
- Date: Wed, 09 Mar 1994 14:57:25 -0600
- Followup-to: comp.lang.lisp.mcl
- Newsgroups: comp.lang.lisp.mcl
- Organization: Institute for the Learning Sciences
In one of my programs I have noticed that when I have a large number of pop
up menus on the screen, some of the last ones created never appear, or,
when pulled-down, turn out to contain the menu items of another menu
entirely. I had thought that this was a low-memory problem, but increasing
heap size and total allocation haven't stopped the problem. Here's some
code that produces this behavior on a couple of machines here:
(defparameter *num-menus* 7)
(defparameter *submenus-per-level* 6)
(defparameter *max-depth* 2)
(defun build-submenus (root-num depth)
(if (>= depth *max-depth*)
(list (make-instance 'menu-item
:menu-item-title (format nil "root #~s, depth ~s"
:menu-item-action #'(lambda ()
(message-dialog (format nil "root #~s, depth ~s"
(dotimes (j *submenus-per-level* menus)
(format t "making submenus for root ~s, menu ~s, depth
~s~%" root-num j depth)
(push (make-instance 'menu
:menu-title (format nil "menu #~s" j)
:menu-items (build-submenus root-num (1+
(setf *w* (make-instance 'window
:view-size #@(150 250)
:window-title "menu test"))
(dotimes (i *num-menus*)
(add-subviews (find-window "menu test")
:menu-title (format nil "menu #~s" i)
:menu-items (build-submenus i 0)
:view-position (make-point 20 (* 25 i))
Run this code and then take a look at the menus produced. On my machine,
the first four are OK, the fifth is mostly OK, except for some of the items
in menu #0, and the sixth is almost completely screwed up.
Inspecting the resulting objects makes them all seem to be valid. All the
menus are there and have non-zero mac handles.
Any ideas anyone?