[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Specializing WINDOW-MENU-ITEMs

Hello. I'd like to use the Clear menu item for my own subclass of
WINDOW. This subclass has different kinds of editable objects whose
contents can be Cut, Cleared, etc. The docs say WINDOW-MENU-ITEMs
(which is what the Clear menu item is an instance of) are updated
based on whether the front window has a method for CLEAR. My subclass
of window does have a method so the item is always enabled. The
problem is this: I want to *selectively* enable the Clear menu item
based on my window's current selection, much like FRED windows do
based on if there's selected text. (I have more than just text that
can be selected so I can't do exactly what FRED does.)

I inspected the Clear menu item to find it is its update-function that
does the refined updating. Disassebly shows this (anonymous) update
function calls CCL::EDIT-MENU-ITEM-UPDATE which does the realy work,
it seems.

So I'm not sure how to do what I want. I don't want to replace the
default Clear menu item because others depend on it. Similarly I don't
want to change the item's update function. And I don't want to have a
separate special set of editing menu items...

I'd be grateful to anyone who knows a good way to do this.