/******************************************************************************* Name: PrintChangedFocus Description: Update the Focus window Arguments: None Returns: *******************************************************************************/ int PrintChangedFocus() { void *theEnv = GetCurrentEnvironment(); void *FocusPtr; int n; char *buffer; /* Clear the old contents */ n = 0; XtSetArg(TheArgs[n],XtNstring,"");n++; XtSetValues(focus_text,TheArgs,n); XawAsciiSourceFreeString(XawTextGetSource(focus_text)); /* Print the new focus list */ FocusPtr = EnvGetNextFocus(theEnv,NULL); while(FocusPtr != NULL) { buffer = EnvGetDefmoduleName(theEnv,((struct focus*)FocusPtr)->theModule); EnvPrintRouter(theEnv,"xfocus",buffer); EnvPrintRouter(theEnv,"xfocus","\n"); FocusPtr = EnvGetNextFocus(theEnv,FocusPtr); } return 0; }
static int CountFocus( void *theEnv) { int count = 0; void *Ptr = NULL; while ((Ptr = EnvGetNextFocus(theEnv,Ptr)) != NULL) { count++; } return count; }