Circa 2002-May-12 09:52:25 -0700 dixit Sean 'Shaleh' Perry:

: the menu says "send to" it makes no sense to send a window to the
: workspace it is on.  The code actually does a noop if you try.
: 
: The only reason it is there now is because it has to be, there is no
: other obvious, efficient, clean way to code it.
: 
: The code does "what is the index of the item in the menu you
: clicked? ok getWorkspace(index)".  So if we were to try to show only
: say 1,2,4 out of [1,2,3,4] clicking on 4 would send you to 3.  In
: fact all of the menu code in blackbox works by looking at the index
: of the menu item in the menu and keying off of that.  So we have
: ugly things like loops where we give each window a unique number
: based on their location in the menu.

From a user-interaction perspective, what really ought to happen is
that the current workspace should still appear in the 'Send To' menu,
but it should be grayed out (i.e., disabled).  If menu items appear and
disappear based on context, it can only be confusing for users.

Turns out this also makes it easier to program:

  for index values from first-workspace to last-workspace do
    put an item in the 'Send To' menu for this workspace index
  end for
  disable-menu-item(send-to-menu-item[current-workspace])
  show 'Send To' menu

and:

  on-send-to-menu-item-click {
    new-workspace = get-workspace-for-index(menu-item-index)
    goto-workspace(new-workspace)
  }

And now the menu items don't move around in a confusing way.

-- 
jim knoble  |  [EMAIL PROTECTED]  |  http://www.pobox.com/~jmknoble/
(GnuPG fingerprint: 31C4:8AAC:F24E:A70C:4000::BBF4:289F:EAA8:1381:1491)

Attachment: msg06689/pgp00000.pgp
Description: PGP signature

Reply via email to