menu problems
menu problems
- Subject: menu problems
- From: email@hidden
- Date: Mon, 28 May 2001 18:20:39 -0500
hello everyone. i am having a bit of a problem with menus. i want to
disable the 'Save', 'Save As...', 'Open...', and 'Open Recent' menu
items and be able to re-enable them at will. i've tried setting the
autoenablesItems variable for the main menu and then tried to disable
them using setEnabled and setState. but that doesn't work. i've tried
adding a -validateMenuItem: method to my window controller class, which
didn't work (i'm thinking because it isn't the target of the menu). the
point of this is that i want to be able to prevent the user from being
able to save or open documents (based on registration info). i want to
either disable the menu items (seems the most user friendly solution) or
disable the document from being able to save or restore data (no clue
how to do thist) and then throw up a sheet when someone tries to save or
open.
my current solution works but is not how i want it to work (and it's bad
UI design). currently, my window controller checks (in the
windowDidLoad: method) a condition in my data object and if it detects
loaded data it calls a sheet (which ends up being detached from the
window, probably because the window hasn't been created yet) telling the
user they can't do that. ick. horrible.
any help or suggestions concerning either possible solution (menu or
data loading) would be great. thanks in advance.
Jason M.
ps - i know disabling menus has been discussed here before (i've read
all of that), but my problem seems different in that the menu items i
want to disable don't respond to -validateMenuItem: