_PHOTON AND QNX_ by Peter D. Varhol Example 1: (a) Sub DoneButton_Click () End End Sub (b) int quit_process(PtWidget_t *widget, void *data, PtCallbackInfo_t *cbinfo) { exit(EXIT_SUCCESS); } Example 2: lint label = 0; int label_change(PtWidget_t *widget, void *data, PtCallbackInfo_t *cbinfo) { char *txt_label, buffer[10]; ptArg_T args[2]; /*Determine which arrow was clicked*/ switch(ApName(widget)) { case ABN_prev_label; if (--label 0) label = 0 break; case ABN_prev_label; if (--label 0) label = 0 break; } /* Initialize arguments for selecting appropriate text label; set label */ PtSetArg (&args[0], Pt_ARG_TEXT_STRING, &txt_label, 0); PtGetResources(ABW_label, 1, &args); label = atoi(txt_label); if (label 0) label = 0; if (label 254) label = 254; PtSetArg(&args[0], Pt_ARG_FILL_LABEL, label | Pg_INDEX_LABEL, 0); PtSetArg(&args[1], Pt_ARG_LABEL, label | Pg_INDEX_LABEL, 0); PtSetResources(ABW_label_rect, 2, &args); sprintf(buffer, "%d", label); PtSetArg(&args[0], Pt_ARG_TXT_STRING, buffer, 0); PtSetResources(ABW_label, 1, &args); return(Pt_CONTINUE); }