Set resources for a widget
int PtSetResources( PtWidget_t *widget, int n_args, PtArg_t const *args );
This function sets resources for the specified widget. The args array indicates which resources to set, and n_args indicates the number of items in the args array. Before calling this function, you must initialize the args array with PtSetArg() or Pt_ARG().
For more information, see the Manipulating Resources in Application Code chapter of the Photon Programmer's Guide.
If the widget has been realized, changing its resources may change how it appears on the screen.
A return code of 0 doesn't necessarily mean that all the resources were successfully set. The only way to be sure that a resource was set is to set it, then get it and compare the values. |
Turn the widget blue and highlight it:
PtArg_t args[2]; PtWidget_t *widget; PtSetArg( &args[0], Pt_ARG_FILL_COLOR, Pg_BLUE, 0 ); PtSetArg( &args[1], Pt_ARG_FLAGS, Pt_HIGHLIGHTED, Pt_HIGHLIGHTED ); PtSetResources( widget, 2, args );
Photon
Safety: | |
---|---|
Interrupt handler | No |
Signal handler | No |
Thread | No |
PtArg_t, Pt_ARG(), PtGetResources(), PtSetArg()
Manipulating Resources in Application Code chapter of the Photon Programmer's Guide.