GET CHOICE(3P) — SUNPHIGS LIBRARY
NAME
GET CHOICE − retrieve the CHOICE measure from the PHIGS current event report
SYNOPSIS
C Syntax
void
pgetchoice ( choice )
Pchoice∗choice;OUT choice
FORTRAN Syntax
SUBROUTINE pgtch ( STAT, CHNR )
INTEGERSTATOUT status (POK, PNCHOI)
INTEGERCHNROUT choice number
Required PHIGS Operating States
(PHOP, WSOP, ∗, ∗)
DESCRIPTION
Purpose
Use GET CHOICE to retrieve the measure (logical input value) of the CHOICE device from the current event report in the PHIGS state list.
A CHOICE device measure consists of a status and a choice number. Status indicates whether or not one of the possible choice values on the device was selected. The choice number indicates the value selected, if any.
C Output Parameters
choiceA pointer to a Pchoice structure in which to store the CHOICE measure. Pchoice is defined in phigs.h as follows:
typedef struct {
Pchoicestatus status;
Pintchoice;
} Pchoice;
status contains the measure’s choice status. Pchoicestatus is defined in phigs.h as:
typedef enum {
PCH_OK,
PCH_NOCHOICE
} Pchoicestatus;
choice contains the measure’s choice number. This field is undefined if the status returned is PCH_NOCHOICE.
FORTRAN Output Parameters
STATThe measure’s choice status. Valid values as defined in phigs77.h are:
• POK(OK)
• PNCHOI(NO CHOICE)
CHNRThe measure’s choice number. This value is undefined if the status returned is PNCHOI.
Execution
The GET CHOICE function retrieves the measure of a CHOICE device from the current event report in the PHIGS state list. If NO CHOICE is returned as the status, choice number is undefined. If OK is returned as the status, choice number contains the measure’s choice number.
When an input device that is set to EVENT mode is triggered by the operator, an event report is added to the input event queue. The event report contains the identity and current measure of the device. AWAIT EVENT moves the measure of the oldest event in the input queue to the current event report in the PHIGS state list. If the event was a CHOICE event, GET CHOICE is used to retrieve the measure from the current event report.
See INITIALIZE CHOICE 3 for a description of the available CHOICE devices and how their measure values are determined.
ERRORS
003Ignoring function, function requires state (PHOP, WSOP, ∗, ∗)
259Ignoring function, the input device class of the current input report does not match the class being requested
SEE ALSO
INITIALIZE CHOICE (3P)
INITIALIZE CHOICE 3 (3P)
AWAIT EVENT (3P)
Sun Release 4.0 — Last change: 1 August 1989