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

defpup Subroutine

Purpose

Defines a pop-up menu.

Libraries

Graphics Library

C (libgl.a)

FORTRAN (libfgl.a)

C Syntax

Int32 defpup(Char8 *string [, Int32 arguments ...] )

FORTRAN Syntax

None: available only in C.

Description

The defpup subroutine defines a pop-up menu and returns a menu identifier.

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

Parameters

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 arguments 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.
%f Invokes a routine when this particular menu item is selected. You must specify the invoked routine in the arguments 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.
%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 arguments 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.
%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 parameter. Do not use the arguments parameter to specify the numeric value.
arguments Specifies an optional set of arguments. Each argument expects the command or submenu to be assigned to this menu item. The arguments parameter can be used as many times as necessary.

Return Value

The menu identifier of the menu just defined.

Example

The example C language program curved.c uses the defpup subroutine to define a pop-up menu.

Implementation Specifics

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

File

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

Related Information

Adding an item to an existing pop-up menu with the addtopup 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 ]