Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!usc!apple!voder!zok!wattres!steve From: steve@wattres.UUCP (Steve Watt) Newsgroups: comp.windows.x Subject: Re: Does the Athena Form widget work under X11/R3 Summary: yes and no... Keywords: Athena Form widget Message-ID: <594@wattres.UUCP> Date: 23 Aug 90 05:06:27 GMT References: <28738@netnews.upenn.edu> Reply-To: steve@wattres.UUCP (Steve Watt) Organization: Steven Watt, Consultant Lines: 69 The Athena form widget does not work well, but this problem is easy... In article <28738@netnews.upenn.edu> you write: >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: [ app-defaults moved up here... ] >*pressme*label: Press Me >*quit*label: Quit >*Command*background: orange >*pressme*fromHoriz: quit >!*quit*fromHoriz: pressme [ some source deleted ] > 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 */ > ); [ some more source deleted ] The problem is that when the X toolkit goes to look up resources for creating the "pressme" widget, the "quit" widget does not exist. If you rearrange the creates so it looks like: quit = XtCreateManagedWidget("quit", commandWidgetClass, form, NULL, 0); pressme = XtCreateManagedWidget("pressme, commandWidgetClass, form, NULL, 0); It should work better (but still not well, the Athena form widget is generally quite stupid.) N.B.: If you do not actually need the widget IDs for quit and pressme, it is probably better to declare an XtCallbackRec, and point the argument list at it. For example: { ... XtCallbackRec cback[] = { { NULL, NULL }, { NULL, NULL } }; Arg arg[1]; cback[0].callback = quit; XtSetArg(arg[1], XtNcallback, cback); XtCreateManagedWidget("quit", commandWidgetClass, form, arg, 1); cback[0].callback = pressme; XtCreateManagedWidget("pressme", commandWidgetClass, form, arg, 1); ... } -- Steve Watt ...!claris!wattres!steve wattres!steve@claris.com also works Don't let your schooling get in the way of your education.