menu paradigm of Rev/MC and other goofiness

Richard Gaskin ambassador at fourthworld.com
Mon Feb 24 17:55:01 EST 2003


Graham Samuel wrote:

> On Mon, 24 Feb 2003 08:17:58 -0500 "Ivers, Doug E" <Doug_Ivers at lord.com>
> wrote:
> 
>> 
>> Does anyone else besides me think that the way menuItems are
>> implemented is goofy?
>> 
>> [...]
> 
> Yes, coming from SuperCard I thought it was fairly goofy not to have
> a proper 'menu' object type, but I find with practice it doesn't
> worry me any more and it seems pretty flexible. However your second
> point

I think this may be a case of "different" more than one way being necesarily
"better" than another.  If you look up my early posts to the MC list in '98,
you'll find me kicking and screaming about these differences, but over time
I've learned the reasoning behind them and today I generally like the MC/Rev
engine as lot.

Back when I could still afford to deploy apps for Mac OS exclusively, of
course SuperCard was my tool of choice and I can't count the number of times
I wanted a way to dynamically modify a whole set of menus on the fly without
having to walk through a list of objects, with all the supporting data
structures that go along wih them.

And here's where I got excited about this more HC-like way of doing things
in MC: 

I was building a tool palette that uses a cascade menu to display a list of
stack files in a folder.  In SuperCard you'd want to build the menu in
advance, since the time to delete all menu items and rebuild them fresh
isn't something you'd want to do on mousedown, even with lockMenus on. ;)

It was working really well and I began to wonder if I could remove my
"Rebuild Menu" menu item by having the contents built on the fly.  I figured
with setting the directory, getting the file list, filtering the list for
"*.mc", sorting it, restoring the directory and stuffing the list into the
button, it would be prohibitive in terms of performance, but the being
benchmarking nut that I am I couldn't resist at least seeing how bad it was.

Well, I must have been tired that day, because when I opened the script
again I found that I'd already coded it that way -- the entire menu was
being rebuilt on the fly in a couple milliseconds on mousedown.

My only complaint with the text-base menus is that they are not currently
available for use as contextual menus, requiring making a relatively complex
widget if you want them to refect the exact system font settings across
platforms.

But if you're willing to get away with a modest deviation from HIGs, 12
points is the nearest match to Mac Classic, Win32, Red Hat Linux 8, and only
one point down from the recommended setting for OS X.

Just the same, I look forward to the speed and ease of using a textlist for
CMs as soon as possible.

But overall, the biggest challenge in working with Rev/MC's menus is when
porting from SC.  If porting from HC or building from scratch they're a kick
to work with.


>> Second, the use of character codes in the text of a menu item to
>> create checkmarks and hot keys seems particularly archaic and
>> problematic.
> 
> Yes, this has proved a bit of an irritation for me because I want to
> be able to have multilingual menu items, with the actual item text
> created at setup time according to the language of the environment,
> and it turns out that the parameter passed with 'menuPick' when a
> menu item is selected is a text which **doesn't** contain these extra
> character codes even though they have to be present in the button
> (menu) contents. This means that for each language I have to keep two
> texts per item, one for putting into the button as a menu item and
> one for putting into the menuPick handler as the text of the item as
> seen by the user. Still, once you've understood it, it ain't so bad.

With case statements it shouldn't be too hard.

Does the menuhistory works for pull-downs?

-- 
 Richard Gaskin 
 Fourth World Media Corporation
 Developer of WebMerge 2.2: Publish any database on any site
 ___________________________________________________________
 Ambassador at FourthWorld.com       http://www.FourthWorld.com
 Tel: 323-225-3717                       AIM: FourthWorldInc




More information about the use-livecode mailing list