Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!zaphod.mps.ohio-state.edu!mips!smsc.sony.com!dce From: dce@smsc.sony.com (David Elliott) Newsgroups: comp.windows.x.motif Subject: Re: Setting Widget Resources Message-ID: <1991Apr22.164910.12494@smsc.sony.com> Date: 22 Apr 91 16:49:10 GMT References: <1991Apr18.003956.6310@latcs2.lat.oz.au> Sender: dce@smsc.sony.com (David Elliott) Distribution: comp.windows.x.motif Organization: Sony Microsystems, San Jose, CA Lines: 42 In article <1991Apr18.003956.6310@latcs2.lat.oz.au>, arthur@latcs2.lat.oz.au (Arthur Proestakis) writes: |> Can all the resources of a widget be set in a resource file? |> |> I am trying to do the following in a resource file: |> |> app*widget.bottomAttachment: ATTACH_WIDGET |> app*widget.bottomWidget: bottom_widget |> From all the replies to this, maybe my code should become part of the FAQ (or better yet, part of Motif 1.2!). This code, which was basically stolen from the Athena Form widget, adds a String to Window converter. I wrote it as a general routine that I call at the beginning of all of my programs, and made it so I could add other converters as needed (like String to Unit Type ;-). #include #include #include #include #include #include void setupConverters() { static XtConvertArgRec parentCvtArgs[] = { {XtBaseOffset, (caddr_t)XtOffset(Widget, core.parent), sizeof(Widget)} }; XtAddConverter(XmRString, XmRWindow, XmuCvtStringToWidget, parentCvtArgs, XtNumber(parentCvtArgs)); } -- ...David Elliott ...dce@smsc.sony.com | ...!{uunet,mips}!sonyusa!dce ...(408)944-4073 ..."Once a head-crusher, always a head-crusher" - Mark M.