Build argument lists for widgets
PtSetArg( PtArg_t *arg, long type, long value, long len );
This macro builds argument lists to be used with PtCreateWidget(), PtSetResources(), and PtGetResources().
|
The arg argument is normally part of an array of PtArg_t data structures. The type argument contains the resource manifest and value contains the value of the argument being passed. The way the len argument is used depends on the resource type.
For information on getting and setting resources, see the Manipulating Resources in Application Code chapter of the Photon Programmer's Guide.
PtArg_t args[4]; PhPoint_t pos = { 100, 100 }; /* Position the widget at (100,100) */ PtSetArg( &args[0], Pt_ARG_POS, &pos, 0 ); /* Make its primary color blue; in this case, blue text */ PtSetArg( &args[1], Pt_ARG_COLOR, Pg_BLUE, 0 ); /* Set the string drawn with the widget */ PtSetArg( &args[2], Pt_ARG_TEXT_STRING, "Button", 0 ); /* Place the button widget in the widget hierarchy */ PtCreateWidget( PtButton, NULL, 3, args );
Photon
Safety: | |
---|---|
Interrupt handler | No |
Signal handler | No |
Thread | No |
PtArg_t, Pt_ARG(), PtGetResources(), PtSetResources(), PtCreateWidget()
Manipulating Resources in Application Code chapter of the Photon Programmer's Guide.