*nix Documentation Project
·  Home
 +   man pages
·  Linux HOWTOs
·  FreeBSD Tips
·  *niX Forums

  man pages->IRIX man pages -> buttonfly (6)              



NAME    [Toc]    [Back]

     buttonfly - a pretty user interface for Silicon Graphics demos

SYNOPSIS    [Toc]    [Back]

     buttonfly [ menufile ]

DESCRIPTION    [Toc]    [Back]

     Buttonfly is a user reconfigurable, hierarchical, graphical menu system.

     Buttonfly opens up	a window and displays one or more buttons, each	with
     its own title.  Moving the	mouse pointer over a button and	pressing the
     left mouse	button selects that button, and	will cause it to either	execute
 UNIX commands	(such as running a program) or fly forward and flip
     over, exposing one	or more	new buttons.  Each of the newly	exposed	buttons
 may also be selected to either execute UNIX commands or expose a new
     level of buttons, and so on.

     To	go back	to the previous	set of buttons move the	mouse pointer so it
     isn't over	any of the buttons, and	press the left mouse button (i.e.
     select the	background). The buttons will flip over	backwards to bring up
     the previous set.	Selecting the background at the	top level does nothing.

     Using the middle mouse button instead of the left mouse button causes the
     new menu to be displayed immediately, instead of flipping it in to	view.

     Pressing the right	mouse button will bring	up a different pop-up menu
     depending on which	button the mouse pointer is over. Each menu has	at
     least a 'Do It' entry; selecting this entry has the same effect that
     pressing the left mouse button while it is	over the background would.

     Pressing the space	bar will toggle	between	a full-screen version of but-
     tonfly and	the window version.  The full-screen version is	useful for
     presentations to large audiences, where visibility	is important.

     To	exit from buttonfly, press the escape key.


     Buttonfly's menus were designed to	be simple to change with any UNIX text
     editor (such as vi	).  When it is run with	no arguments, it looks for
     button descriptions in a file called '.menu' in the current directory.
     If	it is given one	argument, it will look in that file for	button definitions

     Buttonfly uses a very simple format to describe its buttons.  The format
     has four different	kinds of lines:	comments, titles, actions, and commands.

     Any line beginning	with a '#' character is	considered a comment and is

									Page 1


     Button titles, like comments, always start	in the first column of the
     file, and may be anything not starting with a '#'.	 Titles	may be a maximum
 of 36	characters long; buttonfly will	automatically separate the title
 into a	maximum	of three lines of twelve characters, separating	words
     in	the title at spaces.

     Action lines start	with a tab and end with	a newline, and may be any UNIX
     command.  Multiple	actions	may be specified for a button by listing them
     after the button one per line, each starting with a tab.  Actions may not
     span more than one	line, but may be any length.  If no actions are	specified
 for a	button,	the button is displayed, but nothing will happen when
     it	is selected.

     Commands, like actions, start with	a tab character.  Currently, the commands
 recognized are '.menu.', '.popup.', '.cd.', '.color.',
     '.backcolor.', and	'.highcolor.'.	Everything else	is assumed to be an
     action and	will be	executed as a UNIX command in a	shell (see sh(1)).

     The special action	called '.menu.'	is used	to specify a button that has
     several buttons attached to the back of it.  When buttonfly sees '.menu.
     filename' it will create a	new set	of buttons from	the descriptions in
     'filename'.  If it	cannot find 'filename' in the current directory, then
     nothing happens.  If 'filename' is	'-', then the new set of buttons is
     created from the standard output of the previous actions (see example
     below).  Note that	any 'cd' commands in an	action list do not affect the
     directory in which	buttonfly looks	for the	filenames specified in
     '.menu.' commands,	becuase	actions	are executed in	a sub-shell (see the
     '.cd.' command below).

     Another special actions is	'.popup.'.  It is used to define a pop-up menu
     entry attached to a button.  When buttonfly sees '.popop. title' it adds
     an	entry 'title' to the button's pop-up menu.  The	actions	following a
     .popup. command will be executed when that	menu entry is chosen.  But-
     tonfly automatically provides a 'Do It' entry, which has the same effect
     as	pressing the left mouse	button.

     The '.cd.'	action is used to change buttonfly's idea of the current working
 directory.  When the button containing	the .cd. command is pressed,
     buttonfly will chdir into that directory before executing that button's
     actions, and all buttons underneath that button will also be executed in
     that directory (unless they also have .cd.	commands).  Note that executing
 the regular 'cd' shell	command	in a button does not affect
     buttonfly's idea of the current working directory,	since all button actions
 are executed	in their own shell environment.

     The command '.color.' followed by three numbers in	the range 0.0 ...  1.0
     specifies the red,	green and blue components of a button's	color, and
     '.highcolor' does the same	for the	color of the button as it is being
     selected.	'.backcolor.' changes the color	of the back of the button,
     which becomes the background color	of the next set	of buttons (displayed
     when the button flips over).  Note	that using color commands at the top
     of	a file,	before any buttons have	been defined, causes the default

									Page 2


     colors to be changed for all subsequent buttons.  To change the background
 color to red for the first button and all subsequent buttons you
     would specify:

	  .backcolor. 1.0 0.0 0.0

     in	the menu description file before any buttons are defined.

EXAMPLES    [Toc]    [Back]

     The following are example buttonfly .menu files, with descriptions	of
     what they do.

     This is a very simple button called 'First' that has the buttons defined
     in	the file '.menu_second'	on the back of it.

	       .menu. .menu_second

     Here are three buttons.  The 'Parent' button is purple and	will flip over
     and display the other two buttons when pressed (they will be displayed on
     a purple background, since	that is	the color on the back of the first
     button).  The 'Demonstrate...' button changes directories and then	runs a
     program when pressed, and 'Recurse' flips over and	shows the first	button
     again, this time on a blue	background since the '.backcolor.' command
     changes the background color to blue.

	  #Save	this in	a file called '.menu'
	       .color. .89 .10 .89
	       .backcolor. .89 .10 .89
	       .highcolor. 1.0 .5 1.0
	       .menu. child

	  #Save	the following buttons in a file	called 'child'
	  Demonstrate GL/NeWS Interface
	       cd /usr/NeWS/demo
	       .backcolor. 0.0 0.0 1.0
	       .menu. .menu

     Here is a very complicated	button,	which builds a button file based on
     the files it finds	in a directory full of files.  When pressed, it	builds
     the file and then uses .menu.  to flip over, exposing entries for all the
     files it found.  Note that	this allows you	to delete or add image files,
     and the buttons will always be accurate.  It also has a pop-up menu on it
     giving help; the first .popup command specifies the title of the menu using
 the %t	feature	of Silicon Graphics menus.

									Page 3


	  Show An Image
	       cd /usr/demos/data/images
	  # The	following two lines must all be	on the
	  # same line in the .menu file
	       /bin/ls *.rgb | awk 'BEGIN{FS="."}{print	"Show "	$1
	  "\n\tipaste /usr/demos/data/images/" $0 "\n"}'
	       .menu. -
	       .popup. ShowImage Menu %t
	       .popup. Ipaste Man Page
	       wsh -c man ipaste

BUGS    [Toc]    [Back]

     Buttonfly will not	work if	the first character of a file is a TAB followed
 by anything other than .color., .backcolor.,	or .highcolor.	It is
     safest to eliminate any blank lines from the files	you create.

     Buttonfly may crash if given an arbitrary file as input.

     The maximum number	of buttons on any level	of the hierarchy is 32.

     If	a program fails	to run,	nothing	happens-- no error messages or warnings
 are given.  This can be considered either a feature or a bug.

     Specifying	%F, %f,	%x, or %m as part of a .popup. title will give bad
     results, and may crash the	program.  Using	%t to specify a	title works,
     but any actions specified for that	entry will never be executed (since it
     is	impossible to select a title entry).

ADDENDA    [Toc]    [Back]

     AUDIO With	the release of IRIX 6.3, audio was added to buttonfly.	When
     the buttons fly forward or	back, the system will play corresponding audio
     files located in /usr/demos/Demo_Interfaces/Buttonfly.

     If	the middle mouse option	is used	to move	through	the buttons without
     flight, the audio will not	play.  The audio option	can be toggled off by
     running buttonfly -a


     With the release of IRIX 6.3, we have added a web-based interface to the
     demos.  Since this	interface already sorts	demos based on categories, we
     were able to use a	perl script ( mkmenu ) to access the sorted lists of
     demos and create buttonfly	heirarchies dynamically.  When buttonfly is
     started now, by default, it will have the categories from the web UI:
     Features, Industries, and Hardware.
       The sub-categories which	fall beneath these are viewable	from the
     Search page of the	web-based interface.  This is accessible from the system
 toolchest FindDemos menu option, or by	typing http://localhost/Demos
     from your local web browser.

									Page 4


     Although these demos do not require the traditional structure, this
     structure is still	supported, particularly	since these changes were made
     via scripts, not in the buttonfly source code.

     To	use buttonfly for accessing demos from the web-based interface (located
	in /usr/demos/General_Demos ) and demos	with the traditional heirarchy,
 just install or link the traditional heirarchy into
     /usr/demos/Buttonfly.  The	mkmenu script automatically adds a button
     based on the menu file located in the new directory beneath

AUTHOR    [Toc]    [Back]

     Thant Tessman and Gavin Bell Audio	support: Diana Starr Perl scripts: David
 (Sprout) Anderson

FILES    [Toc]    [Back]

	  .menu		      -	custom menu file which supports
			   the display of demos	from the web-based
			   interface and any demos in
	  Times-Italic.bw     -	font file
	  buttonfly	 - executable
	  buttonfly.sh	      -	script to process input	for buttonfly
	  buttonflyAudio - script to process input for buttonfly, includes audio
	  demofind	 - script that finds demos
	  in.aiff	      -	audio for buttons flying in
	  manwsh	 - script: launches shell with man page
	  mkmenu	 - script: dynamically creates
			   buttonfly menu files	for demos
			   installed in	web interface
	  out.aiff	 - audio for buttons flying out
	  sea.rgb	 - texture
	  redirect	 - script: redirects output of demo

	  buttonfly	      -	for convenience, this is a link	to the above buttonfly.sh script
	  buttonflyAudio - for conveniece, this	is a link to the above buttonflyAudio script
	  Additional Demo Trees	   - Traditionally structured buttonfly	heirarchies
			      can be installed in this directory


     Must have at least	24 bitplanes.

									PPPPaaaaggggeeee 5555
[ Back ]
 Similar pages
Name OS Title
t3270 IRIX Silicon Graphics 3270 interface card
gse IRIX Silicon Graphics 5080 workstation interface card
sgihelp IRIX The Silicon Graphics Help Viewer
syssgi IRIX Silicon Graphics Inc. system call
alIntro IRIX Introduction to the Silicon Graphics Audio Library (AL)
dmColor IRIX The Silicon Graphics Color Space Library (CSL)
rgb IRIX Silicon Graphics rgb image file format
DTintro IRIX Introduction to the Silicon Graphics DAT Audio Library (DT)
CDintro IRIX Introduction to the Silicon Graphics CD Audio Library (CD)
stereo IRIX stereo viewing on Silicon Graphics systems
Copyright © 2004-2005 DeniX Solutions SRL
newsletter delivery service