Museum

Home

Lab Overview

Retrotechnology Articles

Online Manuals

⇒ addtopup(3G) — GL2 W3.6

Media Vault

Software Library

Restoration Projects

Artifacts Sought

addtopup(3G)  —  Silicon Graphics

NAME

addtopup − adds items to an existing pop-up menu

SPECIFICATION

C
addtopup(pup, str, args)
long pup;
char *str;
long args;

FORTRAN
subroutine addtop(pup, str, length,  args)
integer pup
character* str(*)
integer*4 length
integer*4 args

Pascal
procedure addtopup(pup: longint; str: pstring128;
args: longint);

DESCRIPTION

addtopup adds items to an existing pop-up menu.  str specifies the menu items; pup identifies the menu.  addtopup appends the new menu items to the bottom of the existing menu.  pup is the identifier returned by newpup or defpup.  args is a single argument that matches the argument str specifies.  In FORTRAN and Pascal, menus are built by a call to newpup followed by a call to addtopup (addtop in FORTRAN) for each menu item that requires an argument, i.e., a function address or a menu identifier.  The following code segments construct the same pop-up menu using C and FORTRAN.

In C:
submenu = defpup("rotate %f | translate %f | scale %f ",
dorotate, dotranslate, doscale);
menu = defpup("sample %t | persp | xform %m | greset %f ",
submenu, greset);
In FORTRAN:
submenu = newpup()
call addtop(submen, "rotate %f", 9,  dorota)
call addtop(submen, "translate %f", 12, dotran)
call addtop(submen, "scale %f", 8, doscal)
menu = newpup()
call addtop(menu, "sample %t | persp | xform %m", 28,
+                  submenu)
call addtop(menu, "greset %f", 8, greset)

For a complete description of menu formats, see defpup. 

SEE ALSO

defpup, dopup, freepup, newpup Using mex, Chapter 3, Making Pop-Up Menus

NOTE

This routine is available only in immediate mode under the window manager. 

Version 3.6  —  December 20, 1987

Typewritten Software • bear@typewritten.org • Edmonds, WA 98026