next up previous contents index
Next: Interactive Up: Classes and Methods Previous: Group

Input

  (subclass of 9.1.3.14 Interactive)

An input allows to view and edit int-, float-, double- and char *-variables.

typedef enum declaration_format{
  dfInt,
  dfFloat,
  dfDouble,
  dfString,
  dfRegexp
} DECLARATION_FORMAT;
   GRAPE(Input, "new-instance")(var, name, type, max_size)
CLASS *Input
void *var
char *name
DECLARATION_FORMAT type
int max_size
Create a new Input instance: this one will edit the variable var of type type, in a max_size-1 characters long string. The instance name is name.

   GRAPE(input, "set-keyactive")()
INPUT *Input
Make input the active Input field, if none was set before.

   GRAPE(input, "set-max-size")(max_size)
INPUT *Input
int max_size
Change the maximum string size of input to be max_size-1.

   GRAPE(input, "set-print-format")(format)
INPUT *input
char *format
Set the printf-format-string, which is used from the input to show its value, if the input is not waiting for keyboard events.

When the input calls sprintf the label of the Input is passed as a second argument. To display name and (int) value of the Input you can use the format string "%2$s: %1$d" for example. Normally only SGI's C-library understand formats containing $, but it is emulated on other machines.

   GRAPE(input, "set-tab-action")(tab_action)
INPUT *input
char *tab_action
Change the tab action to tab_action. This is the method the input will send to itself if the tab-key is pressed.

   GRAPE(input, "set-type")(type)
INPUT *input
DECLARATION_FORMAT type
Set the type of controlled the variable.

   GRAPE(input, "set-var-and-type")(var, type)
INPUT *input
void *var
DECLARATION_FORMAT type
Set the variable pointer to a new variable, together with setting its type.

   GRAPE(input, "set-variable")(var)
INPUT *input
void *var
Set the variable pointer to a new variable. Don't forget to set the correct type of the variable.


next up previous contents index
Next: Interactive Up: Classes and Methods Previous: Group

SFB 256 Universität Bonn and IAM Universität Freiburg

Copyright © by the Sonderforschungsbereich 256 at the Institut für Angewandte Mathematik, Universität Bonn.