Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!zaphod.mps.ohio-state.edu!caen!ox.com!math.fu-berlin.de!unidui!unido!ztivax!ap542!david From: david@ap542.uucp Newsgroups: comp.windows.x.motif Subject: Re: Setting Widget Resources Message-ID: <1991Apr29.104406.9049@ap542.uucp> Date: 29 Apr 91 10:44:06 GMT References: <1991Apr18.003956.6310@latcs2.lat.oz.au> <49576@seismo.CSS.GOV> Sender: news@ap542.uucp (News Admin) Distribution: comp.windows.x.motif Organization: Siemens-Nixdorf AG, AP 341 Lines: 39 bonnett@seismo.CSS.GOV (H. David Bonnett) writes: >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 >|> >|> and the error I get is: >|> >|> X Toolkit Warning: Cannot convert string "bottom_widget" to type Widget > >The problem with this is that the attachment argument for BottomWidget >expects to get a Widget Pointer, not the Name of the widget. Sounds like you should get the Widget Creation Library. It provides a CvtStringToWidget converter so you can do this type of stuff in resource files. It also provides a CvtStringToCallback converter so you can bind callbacks in resource files. And of course it also provides CvtStringToClass and CvtStringToConstructor converters which allow you to delete every line in your source which looks like this: XtCreateWidget( ... ) XtManageWidget(... ) XmCreate....(...) XtManageChildren(...) All that sort of thing then gets put into your resource file(s) and your C code ends up being nothing but very simple initialization code and your callbacks and action procedures which actually implement the application. Get Wcl via ftp from most any achive server, including export.lcs.mit.edu in contrib/Wcl1.05 and devvax.jpl.nasa.gov in pub/Wcl1.05 David E. Smyth david@ap542.uucp