Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!sun-barr!apple!voder!nsc!amdahl!JUTS!duts!gjf00 From: gjf00@duts.ccc.amdahl.com (Gordon Freedman) Newsgroups: comp.windows.x Subject: Re: Does the Athena Form widget work under X11/R3 Keywords: Athena Form widget Message-ID: <242C02cp02mH01@JUTS.ccc.amdahl.com> Date: 25 Aug 90 01:19:08 GMT References: <28738@netnews.upenn.edu> Sender: netnews@ccc.amdahl.com Reply-To: gjf00@DUTS.ccc.amdahl.com (PUT YOUR NAME HERE) Organization: Amdahl Corporation, Sunnyvale CA Lines: 59 In article <28738@netnews.upenn.edu> joe@retina.anatomy.upenn.edu (Joe Panico) writes: >Have been yet unable to coerce the Athena Form widget into properly >placing its children relative to >one another. A simple representative example of the problem follows: > >-------- some source code delete > > pressme = XtCreateManagedWidget( > "pressme", /* widget name */ > commandWidgetClass, /* widget class */ > form, /* parent widget*/ > NULL, /* argument list*/ > 0 /* arglist size */ > ); > > quit = XtCreateManagedWidget( > "quit", /* widget name */ > commandWidgetClass, /* widget class */ > form, /* parent widget*/ > NULL, /* argument list*/ > 0 /* arglist size */ > ); > > XtAddCallback(quit, XtNcallback, Quit, 0); > XtAddCallback(pressme, XtNcallback, PressMe, 0); > > XtRealizeWidget(topLevel); > > XtMainLoop(); >} > >---------------------end xt source----------------- >---------------------begin app-defaults----------------- > >*pressme*label: Press Me >*quit*label: Quit >*Command*background: orange >*pressme*fromHoriz: quit >!*quit*fromHoriz: pressme >---------------------end app-defaults----------------- > >This is the error message above program produces: > >X Toolkit Warning: Cannot convert string "quit" to type Widget > The problem is you haven't created the "quit" widget before you create the "pressme" widget. As part of the XtCreateManagedWidget call for "pressme", something somewhere goes out and looks for "pressme"'s resources. The "*pressme*fromHoriz: quit" wants to place "pressme" next to the "quit" widget, only there isn't any "quit" widget at this point. Call XtCreateManagedWidget for "quit" before "pressme". I'm not sure but it looks like there can be lots of "catch-22" situations with respect to widget creation and resources. I think I've always been able to find a way to do it by the order of widget creation. -- Gordon Freedman: gjf00@duts.ccc.amdahl.com Disclaimer: My opinions! Not my employers!