[GUI] idea regarding mac menubar issue

Wolfgang Thaller wolfgang.thaller@gmx.net
Wed, 7 May 2003 08:54:14 +0200


Glynn Clements wrote:
> David Roundy wrote:
>
>> So to summarize, the idea is that by giving each menu command some 
>> kind of
>> unique identifier and at the beginning of the code giving enough
>> information to allow it to assemble those menu commands either into 
>> one
>> global menu bar or into individual menu bars for each wndow, I think 
>> it
>> should be possible to write portable menu code that obeys the user
>> interface guidelines on both platforms (probably also all platforms, 
>> but I
>> only really have experience with two) without writing extensive 
>> special
>> cases.
>
> This sounds as if it might boil down to only allowing that which is
> allowed on all platforms, which is too restrictive. While there may be
> cases where such a facility might be practical, it would need to be an
> alternative to a lower-level API, and not a replacement for it.

What we have to discuss on this mailing list is the lowest level that 
works on all platforms.
The lowest-level API that works on all platforms _will_ be a little 
restrictive. Nobody says there won't be platform-specific lower-level 
APIs, but that's not the point of this discussion.

Allowing only what is "allowed" on all platforms is simple: define one 
menu bar for the application, and that's it. Very limiting. But that's 
not what David was proposing. We're talking about an abstraction here 
that tries to represent the logical structure of the menus and generate 
the appropriate platform-specific layout automatically. Very ambitious, 
it might or might not work.

If it doesn't work out, then we will probably have to specify 
platform-specific menu bar layouts; but still, we have to do so at 
program initialization time, and we'll have to have some scheme for 
handling menu commands (as I said, simple callbacks attached to menu 
items don't do the trick).
If we're unable to find any common abstraction for the menu bar issue 
that works for "normal" applications, then the CGA will be "incomplete" 
--- either it won't be cross-platform or the look&feel on some 
platforms will be just wrong... unless you write platform-specific code.

Nobody has ever doubted that platform-specific code should be allowed; 
but please don't discount this scheme yet because it doesn't support 
some kinds of menu layouts that are not possible on all platforms, and 
perhaps not common on any platform.

> I suspect that this sort of issue really is best dealt with by having
> platform-specific code.

Many X apps have document windows that all have the same menu bar, plus 
dialog windows that don't have any menu bar at all. At least this 
common situation can definitely be mapped to a common abstraction; at 
most we'd have to provide platform-specific layouts (i.e. where does 
the Preferences command go?), but no platform-specific code.
We should think about how this can be done for more complex situations 
(e.g. more than one document type, non-document windows etc.).

Cheers,

Wolfgang