Re: Submenu navigation



Nils Barth wrote:
> 
> Thus spake David Santiago:
> On the Mac, when you leave a menuitem that has an active submenu, the
> UI draws an invisible right triangle given by:
> p0 = (x0, y0) - the point you left the menuitem
> p1 = (x1, y1) - the lower left corner of the submenu
> p2 = (x1, y0) - the corner where the menuitem runs into the submenu
> (see attached picture -- I've also drawn the case where you exit the
> top of the menuitem, in which case p1 is the upper left corner)
> 
> Now so long as the mouse stays inside the triangle, the submenu stays
> up, until there's a timeout.
>
> Phrased differently, the submenu stays up until the timeout, so long
> as you are inside this triangle.

No, there is no triangular area overlaying Macintosh's menus.
If there were, then there would be a noticable delay when moving the cursor
downwards over the items in the parent menu, and there is no such delay.

The "triangle" is only relative to the cursor's previous position, i.e.
for as long as the mouse motion is towards the submenu and the timeout
has not expired the submenu will remain open.

> Implementation notes:
> I was thinking of implementing that behaviour thus:
> when mouse leaves menuitem, popup a rectangular window/region/widget
> with corners p0, p1.
> This window would be invisible, inactive, and would only serve to stop
> mouse events from going through to different menuitems (so the
> menuitem with the submenu would stay active).

Or, you could call "gdk_pointer_grab()" for the menu item's window and
only the menu item will recieve events until you call "gdk_pointer_ungrab()".

While we are at it discussing improvements to GTK's menus, I have a couple
of other suggestions:

* Scrolling when the menu becomes too large.
  Macintosh has arrows at the tops and/or bottoms of large menus, indicating
that
  there is more to see. However, Macintosh's menus don't show how many items
there are.

  Motif (or is it just Netscape?) has the worst solution to this problem: the
last menu
  item is a submenu item with the title "More ...".
  When there are many menus they stack themselves up on top of one-another in
the
  bottom-right corner of the screen, which makes it very difficult to select a
menu item.

  Maybe we would like something like a GtkCombo, i.e. a menu with a scrollbar
inside it.

* Move tear-off menus up a notch in the default position function:

   from:	                      to:  +--------------+
  ------------+			-----------|= = = = = = = |
  Menu item >+--------------+	Menu item >|Submenu item 1|
  -----------+= = = = = = = |	-----------|Submenu item 2|
	     | Submenu item |		   :              :
	     :              :

Regards.
/ Johan
  -- johan@tiq.com -- http://www.obsession.se/johan/ --




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]