%! % % Date: Thu, 7 Jul 88 19:58:03 EDT % To: NeWS-makers@brillig.umd.edu % Subject: Pull right menu modification % From: dennis@boulder.colorado.edu % % The Sun SunWindow menus have a special feature not found in the % NeWS 1.1 litemenu facility. % In SunWindows, if you pick a menu item that has an associated sub-menu, % but you do not move the cursor to pop-up that sub-menu, % then the first item on the sub-menu is chosen. % % I find this feature to be handy, so I have constructed a modified % menu class for NeWS that has this property. % -------------------------------------------------- % Define a new menu subclass that % automatically de-references menus as actions. /autopullmenu DefaultMenu [] classbegin %override /domenu { % - => - (execute action of menu) % get the menu action for self MenuValue getmenuaction dup type /dicttype eq { % if action is a menu, recurse and do its 0th action % fake to look like child is active /ChildMenu exch store ChildMenu /ParentMenu self put ChildMenu /MenuValue 0 put /domenu ChildMenu send % clean up self and lower level menus (should not be any) /popdown self send } { % else do the action cvx exec } ifelse } def classend def % autopullmenu /DefaultMenu autopullmenu store