[Pythonmac-SIG] disabling menus in FrameWork/W?

Joseph J. Strout joe@strout.net
Wed, 3 Mar 1999 12:41:19 -0800


I'm trying to find a simple way to disable menus in a FrameWork app when my
custom window is frontmost.  I thought I knew what was going on when I
found FrameWork.MenuBar.fixmenudimstate; it's looking for somebody to have
a domenu_whatever method defined, and enables the menu item if so, else
disables it.

"Aha!" thought I, "we just need to check whether the domenu_whatever member
is actually something other than None; if it's None, then we'll ignore it."
The trouble is that it didn't work.   In fact no amount of changes I make
to fixmenudimstate seem to have any effect at all; but I can't figure out
what in the IDE might be overriding it, or how the menu states might be
getting updated.

What I'd really like is to be able to do something like this:

>>> import W
>>> w = W.Window( (40,40,200,200), "spam")
>>> w.open()
>>> w.domenu_close = None	# disable "close" for this window!

...but I'm stumped.  Any ideas?

Thanks,
-- Joe

,------------------------------------------------------------------.
|    Joseph J. Strout           Biocomputing -- The Salk Institute |
|    joe@strout.net             http://www.strout.net              |
`------------------------------------------------------------------'