Portable GUI levels (was: Re: [GUI] Re: Gtk and Object I/O)

Glynn Clements glynn.clements@virgin.net
Tue, 28 Jan 2003 00:40:53 +0000


Nick Name wrote:

> BTW, I 've seen many people mention the "just one menubar per
> application in aqua" problem.
>=20
> Can someone give me an example of a famous application under linux wi=
ch
> uses two different menubars in two different windows? Nothing comes t=
o
> my mind.

Netscape uses different menubars for different types of window.

If the OS allows the application to change the menubar dynamically,
then you can change it whenever the "active" window (e.g. the one with
the keyboard focus) changes. This is what Tk does for MacOS:

MENUBARS                                                          |
       Any menu can be set as a menubar  for  a  toplevel  window |
       (see toplevel command for syntax). On the Macintosh, when=AD |
       ever the toplevel is in front, this menu's  cascade  items |
       will appear in the menubar across the top of the main mon=AD |
       itor. On Windows and Unix, this menu's items will be  dis=AD |
       played  in  a menubar accross the top of the window. These |
       menus will behave according to the interface guidelines of |
       their  platforms. For every menu set as a menubar, a clone |
       menu is made. See the CLONES section for more information.

The main factor for ensuring portability is not to assume that a
menubar is just another widget. IOW, you should have a specific
interface for creating a menubar. Similarly, menu items should be
assumed to be distinct from normal widgets, even if most backends
don't actually make a distinction.

--=20
Glynn Clements <glynn.clements@virgin.net>