addtopup(3G) addtopup(3G)
NAME
addtopup - adds items to an existing pop-up menu
SPECIFICATION
C addtopup(pup, str, arg)
long pup;
char *str;
long arg;
FORTRAN subroutine addtop(pup, str, length, arg)
integer pup
character* str(*)
integer*4 length
integer*4 arg
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.
arg is a single argument that matches the argument str
specifies. In FORTRAN, menus are built by a call to newpup
followed by a call to addtop 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, newpup, dopup, freepup
Page 1 (printed 8/20/87)
addtopup(3G) addtopup(3G)
Using mex, Chapter 3, Pop-Up Menus
NOTE
This routine is available only in immediate mode.
Page 2 (printed 8/20/87)