Newsgroups: comp.windows.news
Subject: Pie menus & Tab windows for TNT
Distribution: comp
--text follows this line--
Here's an implementation of pie menus and tab windows the the NeWS
toolkit, version TNT2.0fcs or TNT3.0beta. (TNT2.0 runs under OpenWindows
2.0 and is a separately distributed product.)  This distribution includes
the files "pie.ps", "tab.ps", and "winit.ps". Put them in a directory
somewhere, adjust the file names in "winit.ps", and put something like:

(tnt/win/winit.ps) LoadFile pop

into your ".user.ps" file. This will take effect next time you start
another window server. If you want to try them out right now, you can
simply "psh" the files "pie.ps" and "win.ps" in that order. 

For a demo, just type the following (if you're running V3, you'll also
have to do the beginpackage stuff):

psh
/demo ClassTabBaseWindow send

When you get some tab windows on the screen, try pressing the menu (right)
button over them and play around with the various functions. You can press
the point (left) or adjust (middle) buttons over the tab, and move the tab
or the window around in various ways. Try dragging the window by the
header, and stretching the resize corners of course. Don't forget to see
what happens while you're moving or resizing, when you press down the meta
key, the alt key, and even the shift key (if you have cycles to burn)! 

When you get sick of the spiffy animation of pie menus spinning and
flipping and flying out of the screen, there is an easy way to supress it.
When your muscles can remember the direction of the item you want, you can
mouse ahead into the menu, and the display will be supressed -- you won't
even see the menu at all! To mouse ahead, press and hold the menu button,
drag in the direction you want, then release, in a smooth quick gesture.
You don't have to drag very far, but the further out you move, the better
your control of the direction!  You can even quickly select from nested
submenus this way. You will know you're doing the right thing when you see
just the outline of the wedge that you're mousing ahead into. 

The spiffy special effects you see when you don't mouse ahead are actually
negative reinforcement designed to make you *want* to mouse ahead to avoid
seeing the menu display, which is the whole point of using pie menus!
Pretty soon you will be totally sick of the spiffy animation but it will
not matter because you will mouse ahead all the time and never see it! But
if you really want to turn it off, so the menus pop up fast, you can set
the /Spiffy? flag to false. Or if you want them to animate even longer,
there's a variable you can frob for that, too.

TNT programmers can use ClassTabBaseWindow and ClassTabPopupWindow just
like ClassBaseWindow and ClassPopupWindow to manage any TNT application.
ClassPieMenuCanvas is a canvas subclass that allows you to pop up a
pie menu with the right button. You can mix it in with other canvas
subclasses you want to be "piemenuable". ClassPieMenu is pretty much like
ClassMenu in its application programmer interface, but not its user
interface!

Please send any comments and suggestions to "hopkins@sun.com". 

Take a look and feel free!

	-Don
