Print a widget
void PpPrintWidget( PpPrintContext_t *pc,
PtWidget_t *widget,
PhPoint_t const *trans,
PhRect_t const *clip_rect,
ulong_t resize );
ph
This function prints the specified widget using the provided print context. The widget doesn't need to be realized in order to be printed.
The arguments to PpPrintWidget() are:
![]() |
This isn't implemented yet; set clip_rect to NULL. |
#include <Ph.h>
#include <Pt.h>
main()
{
int n;
PhArea_t area, sev_area = {0,0,400,400};
PpPrintContext_t *pc;
PtInit( NULL );
pc = PpCreatePC();
PpStartJob( pc );
PtSetArg( &args[0], Pt_ARG_AREA, &sev_area, 0 );
PtRealizeWidget(
PtCreateWidget( PtWindow, Pt_NO_PARENT, 1, args ) );
n = 0;
PtSetArg( &args[n++], Pt_ARG_AREA, &sev_area, 0 );
PtSetArg( &args[n++], Pt_ARG_FILL_COLOR, Pg_BLUE, 0);
button = PtCreateWidget( PtButton, Pt_DEFAULT_PARENT,
n, args );
PpContinueJob( pc );
PtWidgetArea( button, &area);
PpPrintWidget( pc, button, &area.pos, NULL, 0 );
PpEndJob( pc );
PtMainLoop();
}
Photon
| Safety: | |
|---|---|
| Interrupt handler | No |
| Signal handler | No |
| Thread | No |
PhPoint_t, PhRect_t, PpContinueJob(), PpCreatePC(), PpEndJob(), PpGetPC(), PpPrintNewPage(), PpReleasePC(), PpSetPC(), PpStartJob(), PpSuspendJob()
Printing in the Photon Programmer's Guide