Warning: main(/www/www/htdocs/style/globals.php) [function.main]: failed to open stream: No such file or directory in /www/www/docs/6.4.1/photon/lib_ref/pt/ptsetarg.html on line 1
Warning: main() [function.include]: Failed opening '/www/www/htdocs/style/globals.php' for inclusion (include_path='.:/www/www/common:/www/www/php/lib/php') in /www/www/docs/6.4.1/photon/lib_ref/pt/ptsetarg.html on line 1
Warning: main(/www/www/htdocs/style/header.php) [function.main]: failed to open stream: No such file or directory in /www/www/docs/6.4.1/photon/lib_ref/pt/ptsetarg.html on line 8
Warning: main() [function.include]: Failed opening '/www/www/htdocs/style/header.php' for inclusion (include_path='.:/www/www/common:/www/www/php/lib/php') in /www/www/docs/6.4.1/photon/lib_ref/pt/ptsetarg.html on line 8
Build argument lists for widgets
PtSetArg( PtArg_t *arg,
long type,
long value,
long len );
ph
This macro builds argument lists to be used with
PtCreateWidget(),
PtSetResources(),
and
PtGetResources().
|
- If the values don't need to be calculated at runtime, you might be able
to use Pt_ARG()
instead to initialize the argument list.
- A common mistake is to think that this macro actually sets the
resources. It doesn't; be sure to call
PtCreateWidget(),
PtSetResources(), or PtGetResources().
- If you're setting or getting one resource, it's easier to call
PtSetResource()
or
PtGetResource().
|
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, Pt_DEFAULT_PARENT, 3, args );
Photon
Safety: | |
Interrupt handler |
No |
Signal handler |
No |
Thread |
No |
PtArg_t,
Pt_ARG(),
PtCreateWidget(),
PtGetResources(),
PtSetResources()
Manipulating Resources
in Application Code chapter
of the Photon Programmer's Guide.
Warning: main(/www/www/htdocs/style/footer.php) [function.main]: failed to open stream: No such file or directory in /www/www/docs/6.4.1/photon/lib_ref/pt/ptsetarg.html on line 161
Warning: main() [function.include]: Failed opening '/www/www/htdocs/style/footer.php' for inclusion (include_path='.:/www/www/common:/www/www/php/lib/php') in /www/www/docs/6.4.1/photon/lib_ref/pt/ptsetarg.html on line 161