Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!zaphod.mps.ohio-state.edu!swrinde!elroy.jpl.nasa.gov!decwrl!adobe!asente From: asente@adobe.com (Paul Asente) Newsgroups: comp.windows.x Subject: Re: Question on using XmuCvtStringToBitmap converter Message-ID: <16259@adobe.UUCP> Date: 10 Jun 91 19:36:14 GMT References: <9106071800.AA22343@teccb1.TFS> Sender: news@adobe.COM Organization: Adobe Systems Inc. Lines: 40 In article <9106071800.AA22343@teccb1.TFS> jason@tfs.COM (Jason P. Venner) writes: > > >I tried arranging a call of the form > > XtConvertArgRec arg[1] > Screen *screen; > Widget tmp; > > screen = XtScreen(tmp); > arg[0].address_mode = XtImmediate; > arg[0].address_id = &screen; > arg[0].size = sizeof(Sceen**); > XtSetTypeConverter( XtRString, XtRBitmap, XmuCvtStringToBitmap, > args, 1, XtCacheNone, (XtDestructor) NULL ); > >I tried various address_mode's, and the results varied from >a core dump, to > Error: String to pixmap conversion needs screen argument Try static XtConvertArgRec screenConvertArg[] = { {XtWidgetBaseOffset, (caddr_t) XtOffset(Widget, core.screen), sizeof(Screen *)} }; XtSetTypeConverter(XtRString, XtRBitmap, XmuCvtStringToBitmap, screenConvertArg, 1, XtCacheNone, (XtDestructor) NULL); You want the converter to use the string from the widget that you are converting for. -paul asente asente@adobe.com ...decwrl!adobe!asente Ratz put a bucket of liquid in front of me. "I wanted a glass of docs, Ratz. What the hell is this?" I barked. "Motif don't fit in a glass anymore," he barked back. I looked at the liquid. It was totally opaque to me.