#include static char *Strings[] = { "We few, we happy few, we band of brothers; ", "For he to-day that sheds his blood with me ", "Shall be my brother; be he ne'er so vile, ", "This day shall gentle his condition: ", "And gentlemen in England now a-bed ", "Shall think themselves accursed they were not here, ", "And hold their manhoods cheap whiles any speaks ", "That fought with us upon Saint Crispin's day. ", "\tHenry V, Act IV Scene 3, William Shakespeare." }; #define NUM_STRINGS (sizeof(Strings)/sizeof(char *)) #define WINDOW_PIXMAP "window.bmp" #define LIST_PIXMAP "list.bmp" static void SetWidgetColor( Widget w, char *color ) { Display *display; Colormap colormap; XColor newcolor; XColor unused; Arg Args[MAX_ARGS]; int n; display = XtDisplay(w); colormap = DefaultColormapOfScreen(XtScreen(w)); XAllocNamedColor( display, colormap, color, &newcolor, &unused ); n = 0; XtSetArg(Args[n], XmNbackground, newcolor.pixel ); n++; XtSetValues( w, Args, n ); return; } static void PrintValues( Widget window, char *label ) { int n; Arg Args[MAX_ARGS]; Widget VerticalSB; Pixel SBbackground, SWbackground; Pixel SBbottomShadowColor, SWbottomShadowColor; Pixel SBtopShadowColor, SWtopShadowColor; Pixmap SBbackgroundPixmap, SWbackgroundPixmap; Pixmap SBbottomShadowPixmap, SWbottomShadowPixmap; Pixmap SBtopShadowPixmap, SWtopShadowPixmap; (void)printf( "%s\n", label ); VerticalSB = XtNameToWidget( window, "VertScrollBar" ); n = 0; XtSetArg( Args[n], XmNbackground, &SBbackground ); n++; XtSetArg( Args[n], XmNbottomShadowColor, &SBbottomShadowColor ); n++; XtSetArg( Args[n], XmNtopShadowColor, &SBtopShadowColor ); n++; XtSetArg( Args[n], XmNbackgroundPixmap, &SBbackgroundPixmap ); n++; XtSetArg( Args[n], XmNbottomShadowPixmap, &SBbottomShadowPixmap ); n++; XtSetArg( Args[n], XmNtopShadowPixmap, &SBtopShadowPixmap ); n++; XtGetValues( VerticalSB, Args, n ); n = 0; XtSetArg( Args[n], XmNbackground, &SWbackground ); n++; XtSetArg( Args[n], XmNbottomShadowColor, &SWbottomShadowColor ); n++; XtSetArg( Args[n], XmNtopShadowColor, &SWtopShadowColor ); n++; XtSetArg( Args[n], XmNbackgroundPixmap, &SWbackgroundPixmap ); n++; XtSetArg( Args[n], XmNbottomShadowPixmap, &SWbottomShadowPixmap ); n++; XtSetArg( Args[n], XmNtopShadowPixmap, &SWtopShadowPixmap ); n++; XtGetValues( window, Args, n ); #define CompareValue(desc) \ (void)printf( "\tScrollBar " #desc " is %s\n", \ (SW ## desc == SB ## desc) ? "identical" : "different" ) CompareValue(background); CompareValue(bottomShadowColor); CompareValue(topShadowColor); CompareValue(backgroundPixmap); CompareValue(bottomShadowPixmap); CompareValue(topShadowPixmap); #undef CompareValue (void)printf( "\n" ); return; } int main( int argc, char *argv[] ) { int n; Arg Args[MAX_ARGS]; int i; XmString Items[NUM_STRINGS]; Widget List; Widget Window; Pixmap WindPixmap; Pixmap ListPixmap; CommonTestInit(argc, argv); /* Turn text strings into Motif strings */ for ( i=0; i