Path: utzoo!utgpu!watmath!att!dptg!rutgers!sun-barr!decwrl!shlump.nac.dec.com!riscy.dec.com!fuel.dec.com!graham From: graham@fuel.dec.com (kris graham) Newsgroups: comp.windows.x Subject: Re: Dec Toolkit PIXMAP/Label question Message-ID: <1459@riscy.dec.com> Date: 31 Aug 89 01:45:42 GMT References: <5840022@wdl1.UUCP> Sender: news@riscy.dec.com Lines: 77 > > I'm trying to do something very simple: make a label widget with > > a pixmap label. > > [excerpts of code] > > > middle = XCreatePixmapFromBitmapData(display,rootwin,confirm_right_bits, > > confirm_middle_width,confirm_middle_height,1); > > > produces the following semi-useless garbage: > > > > X Protocol error: BadValue, integer parameter out of range for operation > > Major opcode of failed request: 53 (X_CreatePixmap) > > Minor opcode of failed request: 0 > > Resource id in failed request: 0x0 > > Serial number of failed request: 29 > > Current serial number in output stream: 41 > > > > What's going on here? What's the bad value? Huh? > > Wrong number of arguments to XCreatePixmapFromBitmapData. If your width or > height are 0 that would produce the BadValue error. But it is probably the > depth argument, which is missing, which is resulting in the BadValue error. > > > P.S. What the hell is a drawable? What does the line: > > "Specifies the drrawable that indicates the screen." > > mean? > > The glossary defines drawable. The server uses the drawable argument to > determine on which screen to create the pixmap; pixmaps can only be used > on the screen on which they were created. > > > Donna Converse > converse@expo.lcs.mit.edu I don't write that much DECwindows toolkit code.......however......... Mark K Gerolimatos' statement in the base article caught my attention ;-) > Ever tried to use the Dec toolkit? Without pulling your hair out? > I'm trying to do something very simple: make a label widget with > a pixmap label....... Overall, Donna is correct. The following is a sample of how to create pixmaps with the DECwindows toolkit. /* routine to make a pixmap */ static Pixmap MakePixmap(dpy, root, data, width, height) Display *dpy; Drawable root; short *data; Dimension width, height; { Pixmap pid; unsigned long ScreenNumber; ScreenNumber = XDefaultScreen (dpy); pid = XCreatePixmapFromBitmapData (dpy, root, data, (Dimension) width, (Dimension) height, (unsigned long) BlackPixel (dpy, ScreenNumber), (unsigned long) WhitePixel (dpy, ScreenNumber), (unsigned int) DefaultDepth (dpy, ScreenNumber)); return(pid); } -- Christopher Graham Digital Equipment Corp Ultrix Resource Center New York City