[ Previous | Next | Contents | Glossary | Home | Search ]
GL3.2 for AIX: Graphics Library (GL) Technical Reference

addtopup Subroutine

Purpose

Adds items to an existing pop-up menu.

Libraries

Graphics Library

C (libgl.a)

FORTRAN (libfgl.a)

C Syntax

void addtopup
(Int32 popup,
Char8 * string,
Int32 argument)

FORTRAN Syntax

SUBROUTINE ADDTOP(popup, string, length, argument)

INTEGER*4 popup

CHARACTER*(*) string(*)

INTEGER*4 length

INTEGER*4 argument

Description

The addtopup subroutine adds items to the bottom of an existing pop-up menu. You can build a menu by using a call to the newpup subroutine to create a menu, followed by a call to the addtopup subroutine for each menu item that you want to add to the menu.

To activate and display the menu, submit the menu to the dopup subroutine.

Note: This subroutine cannot be used to add to a display list.

Parameters

popup Specifies the identifier of the menu to which to add. The menu identifier is the returned function value of the menu creation call to either the newpup or defpup subroutines.
string Specifies the pointer to the text to add as a menu item. There are seven menu item type flags for optional pairing with each menu item:
%t Marks item text as the menu title string.
%F Invokes a routine for every selection from this menu except those marked with a %n flag. You must specify the invoked routine in the argument parameter. The value of the menu item is used as a parameter of the executed routine. Thus, if you select the third menu item, the system passes 3 as a parameter to the function specified by the %F flag. Produces unpredictable results in FORTRAN.
%f Invokes a routine when this particular menu item is selected. You must specify the invoked routine in the argument parameter. The value of the menu item is passed as a parameter of the routine. Thus, if you select the third menu item, the system passes 3 as a parameter to the routine specified by the %f flag. If you have also used the %F flag within this menu, then the result of the %f flag is passed as a parameter of the %F flag. Produces unpredictable results in FORTRAN.
%l Adds a line under the current entry. This is useful in providing visual clues for grouping like entries together.
%m Pops up a menu whenever this menu item is selected. You must provide the menu identifier of the new menu in the argument parameter.
%n Like the %f flag, this flag invokes a routine when the user selects this menu item. However, the %n flag differs from the %f flag in that it ignores the routine (if any) specified by the %F flag. The value of the menu item is passed as a parameter of the executed routine. Thus, if you select the third menu item, the system passes 3 as a parameter to the function specified by the %f flag. Produces unpredictable results in FORTRAN.
%xn Assigns a numeric value to this menu item. This value overrides the default position-based value assigned to this menu item (third item=3). You must enter the numeric value as the part of the text string specified by the n flag. Do not use the argument parameter to specify the numeric value.
Notes:
  1. With the | (vertical bar) delimiter, you can specify multiple menu items in a text string. However, because there is only one argument parameter, the text string can contain no more than one item type that references the argument parameter.
  2. In FORTRAN programming language, there is no pointer to a function. This restriction causes the %f, %n, and %F flags to produce unpredictable results.
length Specifies the length of the text string (for FORTRAN syntax).
argument Specifies the command or submenu to assign to the menu item. There can be only one argument parameter for each call to the addtopup subroutine.

Implementation Specifics

This subroutine is part of GL in the AIXwindows Environment/6000 Version 1, Release 2 with AIXwindows/3D Feature.

Files

/usr/include/gl/gl.h Contains C language constant and variable type definitions for GL.
/usr/include/gl/fgl.h Contains FORTRAN constant and variable type definitions for GL.

Related Information

Defining a pop-up menu with the defpup subroutine.

Displaying a pop-up menu with the dopup subroutine.

Deallocating a pop-up menu and its data structures with the freepup subroutine.

Allocating and initializing a structure for a new pop-up menu with the newpup subroutine.

Enabling or disabling a given pop-up entry with the setpup subroutine.

AIX Graphics Library Overview and Creating and Managing Pop-Up Menus.


[ Previous | Next | Contents | Glossary | Home | Search ]