void UIDialogFormPopup (Widget widget) { Dimension actionHeight; if (!XtIsManaged (XtNameToWidget (widget,UIDialogBulletinName))) { Widget *children; int numChildren; XtVaGetValues (XtNameToWidget (widget,UIDialogPaneName), XmNchildren, &children, XmNnumChildren, &numChildren, NULL); XtManageChild (XtNameToWidget (widget,UIDialogBulletinName)); while (numChildren-- > 0) if (XmIsTraversable (children [numChildren])) XtVaSetValues (children [numChildren],XmNtraversalOn, false, NULL); XtVaGetValues (XtNameToWidget (widget,UIDialogActionFormName),XmNheight, &actionHeight, NULL); XtVaSetValues (XtNameToWidget (widget,UIDialogActionFormName),XmNpaneMaximum, actionHeight, XmNpaneMinimum, actionHeight, NULL); } XtPopup (widget,XtGrabNone); UILoop (); }
void dumpWidgetTree( Widget w ) { WidgetList list = NULL; Cardinal num_children = 0; int i; static int n = 0; Widget child; XmNavigationType NavTyp; char TextNavigationType[5]="NTSEU"; static char* indent = "-----------------------------------------------------------------------------"; char tmp[256]; int w_class; *tmp = 0; if ( n == 0 ) { printf ( "Widget tree dump. Abbreviations in order of appearance:\n"); printf ( " M: Mananged widget, m: Unmanaged widget\n"); printf ( " T: Traversable, t: non traversable\n"); printf ( " Navigation type: N NONE, T TAB, S STICKY, E EXCLUSIVE\n"); printf ( " U Undefined for the widget\n"); } if ( n >= strlen( indent ) +1 ) { printf( "ERROR:Widget tree is too deep, not enough indent string ( < %d )!\n", n ); n = 0; return; } strncpy( tmp, indent, n ); tmp[n] = 0; XtVaGetValues(w, XmNnavigationType, &NavTyp, NULL); switch (NavTyp) { case XmNONE: i=0; break; case XmTAB_GROUP: i=1; break; case XmSTICKY_TAB_GROUP: i=2; break; case XmEXCLUSIVE_TAB_GROUP: i=3; break; default: i=4; break; } w_class = (int)XtClass(w); printf( "%s> %s %s %c %d wdgt %s - %#x, class %d", tmp, XtIsManaged(w) ? "M" : "m", XmIsTraversable(w) ? "T" : "t", TextNavigationType[i], NavTyp, XtName( w ), w, w_class ); if ( ! XtIsComposite( w ) ) { printf( " no children\n"); return; } XtVaGetValues( w, XmNchildren, &list, XmNnumChildren, &num_children, NULL ); printf( " %d %s\n", num_children, num_children == 1 ? "child" : "children" ); for ( i = 1; i <= num_children; i++ ) { child = list[i-1]; n += 3; dumpWidgetTree( child ); n -= 3; } }