/* 01 */ #include /* 02 */ #include /* 03 */ #include /* 04 */ #include /* 05 */ #include /* 06 */ /* 07 */ #include"sample2.xpm" /* 08 */ /* 09 */ int main(int argc, char **argv) /* 10 */ { /* 11 */ XtAppContext app; /* 12 */ Widget top,label; /* 13 */ Display *disp; /* 14 */ Window root; /* 15 */ Pixmap pix; /* 16 */ int err; /* 17 */ /* 18 */ top = XtVaAppInitialize(&app,"Sample",NULL,0,&argc,argv,NULL,NULL); /* 19 */ disp = XtDisplay(top); /* 20 */ root = DefaultRootWindow(disp); /* 21 */ /* 22 */ err = XpmCreatePixmapFromData(disp,root,sample2_xpm,&pix,NULL,NULL); /* 23 */ if( err ){ /* 24 */ fprintf(stderr,"%s: %s\n",argv[0],XpmGetErrorString(err)); /* 25 */ return 1; /* 26 */ } /* 27 */ /* 28 */ label = XtVaCreateManagedWidget("label",labelWidgetClass,top, /* 29 */ XtNlabel,"", /* 30 */ NULL); /* 31 */ XtVaSetValues(label,XtNbitmap,pix,NULL); /* 32 */ XtRealizeWidget(top); /* 33 */ XtAppMainLoop(app); /* 34 */ return 0; /* 35 */ }