tips
[Top] [All Lists]

Make your code that enables menu items easier to read

To: "REALbasic Tips" <realbasic-tips at lists dot realsoftware dot com>
Subject: Make your code that enables menu items easier to read
From: Geoff Perlman <geoff at realsoftware dot com>
Date: Thu, 24 Aug 2000 14:47:14 -0500
If your REALbasic projects enabled menu items at various times, they
probably do it by setting the Enabled property of the menu item to True in
the appropriate enableMenuItems event. So for example, if you had a menu
item called EditPreferences, that should always be enabled, you would have
an app class in your project and in its enableMenuItems event, you would
have the following line of code:

EditPreferences.enabled = true

It turns out that the menuItem class in REALbasic v2 has an undocumented
method called "Enable" which does the same job.

EditPreferences.enable

I recommend using this method rather than accessing the property as it makes
the code easier to read.
--

Geoff Perlman
President & CEO
REAL Software, Inc.
http://www.realsoftware.com
mailto:geoff at realsoftware dot com
Phone: 512-263-1233 x711
Fax:   512-263-1441



 - - - - - - - - - -
Got a useful tip to share? Send it to us at:
REALbasic-tips at lists dot realsoftware dot com dot
For list commands, send "Help" in the body of a message to
<requests at lists dot realsoftware dot com>



<Prev in Thread] Current Thread [Next in Thread>
  • Make your code that enables menu items easier to read, Geoff Perlman <=