pinit_choice(3g) — Subroutines
Name
pinit_choice − Sets the choice device to application-required values.
Operating States: PHOP, WSOP, ∗, ∗
PHIGS standard function
Syntax
void pinit_choice (
Pint wsid, /∗ (I) Workstation identifier ∗/
Pint dev_num, /∗ (I) Choice device number ∗/
Pin_status status, /∗ (I) Initial choice status ∗/
Pint init, /∗ (I) Initial choice ∗/
Pint pet, /∗ (I) Prompt and echo type ∗/
const Plimit ∗echo_area, /∗ (I) Echo area, in device
coordinates ∗/
const Pchoice_data ∗record /∗ (I) Choice data record ∗/
)
Data Structures
typedef enum {
PIN_STATUS_NONE,
PIN_STATUS_OK, /∗ Use this value if you are supplying an initial
choice ∗/
PIN_STATUS_NO_IN /∗ Use this value if you are not supplying an
initial choice ∗/
} Pin_status;
typedef struct {
Pfloat x_min; /∗ x minimum ∗/
Pfloat x_max; /∗ x maximum ∗/
Pfloat y_min; /∗ y minimum ∗/
Pfloat y_max; /∗ y maximum ∗/
} Plimit;
typedef struct { /∗ choice data record ∗/
union Pchoice_pets {
struct Pchoice_pet_u1 {
Pint num_strings; /∗ number of choice strings ∗/
char ∗∗strings; /∗ array of choice strings ∗/
char ∗title_string; /∗ title string for the device ∗/
} pet_u1;
struct Pchoice_pet_r1 {
Pint num_strings; /∗ number of choice strings ∗/
char ∗∗strings; /∗ array of choice strings ∗/
char ∗title_string; /∗ title string for the device ∗/
} pet_r1;
struct Pchoice_pet_r2 {
Pint num_prompts; /∗ number of alternatives ∗/
Ppr_switch ∗prompts; /∗ array of prompts ∗/
} pet_r2;
struct Pchoice_pet_r3 {
Pint num_strings; /∗ number of choice strings ∗/
char ∗∗strings; /∗ array of choice strings ∗/
char ∗title_string; /∗ title string for the device ∗/
} pet_r3;
struct Pchoice_pet_r4 {
Pint num_strings; /∗ number of choice strings ∗/
char ∗∗strings; /∗ array of choice strings ∗/
char ∗title_string; /∗ title string for the device ∗/
} pet_r4;
struct Pchoice_pet_r5 {
Pint struct_id; /∗ structure identifier ∗/
Pint num_pick_ids; /∗ number of alternatives ∗/
Pint ∗pick_ids; /∗ array of pick identifiers ∗/
} pet_r5;
} pets;
} Pchoice_data;
typedef enum {
PPR_OFF, /∗ prompt off ∗/
PPR_ON /∗ prompt on ∗/
} Ppr_switch;
Description
pinit_choice sets the choice device to application-required values. This function accepts the initial choice status, initial choice value, and the echo area. The initial choice status indicates whether Digital PHIGS selects a choice item by default. The echo area is a 4-component list of x- and y-coordinates, in device coordinates. The order of the list is XMIN < XMAX, YMIN < YMAX. The z-components of a previously specified echo volume remain unchanged.
When the application calls pinit_choice, the workstation surface cannot contain the choice device’s prompt. To remove an existing prompt from the surface, call the pset_choice_mode function and place the device in request mode.
The size and contents of the data record depend on the prompt and echo type you specify. If the size or contents of the data record does not match the requirements of your chosen prompt and echo type, Digital PHIGS generates an error.
See Choice-Class PETs for information on choice-class prompt and echo types.
See Also
pget_choice
pinit_choice3
pinq_choice_st
pinq_def_choice_data
preq_choice
psample_choice
pset_choice_mode