How to Disable the Preference and About Box Items

David Burgun dburgun at dsl.pipex.com
Fri Dec 2 07:37:32 EST 2005


>David Burgun wrote:
>>>>Yes, but this isn't an Apple/Mac problem. I don't care if the 
>>>>preference menu is enabled or disabled, but I want it's visible 
>>>>status to reflect it's state, which is not what happens. I 
>>>>disable then Edit Menu, but the preferences item remains enabled, 
>>>>BUT it won't generate a menuPick event.
>>>>
>>>>This effectively mean that you cannot disable the edit or help 
>>>>menu's under MacOS X!
>>>
>>>Under what circumstances would you want to remove the user's 
>>>access to Preferences or Help?
>>
>>I don't!
>>
>>I want the Edit Menu Disabled, the Preference item isn't in the 
>>Edit menu! It shows as enabled in the Applications Menu, but, 
>>disabling the edit menu stops the menuPick message from being sent 
>>(to either the Edit or Help Buttons), so whe you select preferences 
>>it does nothing!
>
>You're in luck: Apple says you shouldn't disable the entire menu, 
>only the items within the menu:
>
>     ADC Home > Reference Library > Documentation > User Experience
>     > Apple Human Interface Guidelines > Menus > Menu Behavior:
>
>     Even if all of the items in a menu or submenu are unavailable,
>     the menu or submenu title is not dimmed. The user can still
>     open the menu, but all of its items are dimmed to indicate
     that these items are not available in the present context
>
><http://developer.apple.com/documentation/UserExperience/Conceptual/OSXHIGuidelines/XHIGMenus/chapter_16_section_2.html#//apple_ref/doc/uid/TP30000356-TPXREF119>
>

This is what happens anyway if you just disable the button, the 
"Edit" text remains un-dimmed, but each item is dimmed.

>Since you never wanted to prevent the user from accessing 
>Preferences anyway, this will get you want you want for the low cost 
>of a couple milliseconds:
>
>   on DisableEditItems
>     repeat with i = 1 to (the number of lines of btn "Edit"-1)
>       disable menuitem i of btn "Edit"
>     end repeat
>   end DisableEditItems
>
>Instant HIG-compliant Edit menu for all supported platforms in one move.

This causes the Preferences Item in the Apps menu to be un-dimmed but 
unselectable, or rather nothing happens when you select it. The only 
way I can see of doing this is to use the above loop but check for an 
Item starting with "Preferences", which is a tad horrid! Same for the 
about box.

All the Best
Dave



More information about the use-livecode mailing list