Path: utzoo!utgpu!news-server.csri.toronto.edu!mailrus!tut.cis.ohio-state.edu!snorkelwacker!spdcc!tauxersvilli!alphalpha!nazgul From: nazgul@alphalpha.com (Kee Hinckley) Newsgroups: comp.windows.x Subject: Re: UIL or NOT to UIL Message-ID: <1990Mar19.161533.13651@alphalpha.com> Date: 19 Mar 90 16:15:33 GMT References: <777@auto-trol.UUCP> Organization: asi Lines: 88 In article <777@auto-trol.UUCP> marbru@auto-trol.COM () writes: > definition by replacing UIL. I am posting an overview of this "POOR > MAN'S UIL" here to get some feedback on. If there is enough > interest, I can post the code, which has been tested with Motif and > other widgets on SPARC, Ultrix/RISC and VMS/VAX, on comp.sources.x. ... A couple concerns. 1) The major thing which keeps me from totally dumping UIL is compound string support. In fact however, UIL doesn't even provide the kind of support that I need (how do I use UIL to put up the message: Sorry, there is no mail from John. Where "John" is English and everything else is Farsi?). I think the real solution there is a message-catalog-style UIL interface. Presumbably you could do something like this in the Xresources file using some kind of character encoding for the international strings, and special escape sequences for program input strings, but I don't know how easy it would be, and it probably wouldn't be useful without a program to construct them. This isn't really specific to your UIL replacement of course, just a general concern. 2) Consider the following (somewhat fragmented) XmForm code, how would your solution handle it. /* * The first issue here is that we have massive references to other * widgets. That presumbably can be handled? */ SETARG(XmNtopAttachment, XmATTACH_FORM); SETARG(XmNleftAttachment, XmATTACH_FORM); leftWidget = XmCreateLabelGadget(form, "Name:", args, i); XtManageChild(leftWidget); SETARG(XmNleftAttachment, XmATTACH_WIDGET); SETARG(XmNleftWidget, leftWidget); SETARG(XmNrightAttachment, XmATTACH_FORM); rightWidget = XmCreateForm(form, "name", args, i); XtManageChild(rightWidget); /* ATTACH_OPPOSITE is a misnomer. It actually means ALIGN_EDGES. */ SETARG(XmNtopAttachment, XmATTACH_WIDGET); SETARG(XmNtopWidget, rightWidget); SETARG(XmNrightAttachment, XmATTACH_OPPOSITE_WIDGET); SETARG(XmNrightWidget, leftWidget); leftWidget = XmCreateLabelGadget(form, "Address:", args, i); XtManageChild(leftWidget); /* * The second issue is with convenience routines which create widgets * behind your back. Note here that the widget pointer I have to use * to set the constraint resources is a hidden parent of ScrollText. * * By the by. Does anyone know how this works in UIL? I haven't tested * it yet. My guess is that it either doesn't work, or is hard-coded into * the UIL code (let's hear it for extensibility!). There is actually * a way to do it without hardcoding - namely you check to see if the * parent of a widget is the same as the parent you gave it, if not you * keep moving up the widget ree until you find the parent pointer, then * use the one just below it. That way works even if the implementation * changes, whereas the code below would probably break. */ SETARG(XmNeditMode, XmMULTI_LINE_EDIT); rightWidget = XmCreateScrolledText(form, "address", args, i); SETARG(XmNtopAttachment, XmATTACH_OPPOSITE_WIDGET); SETARG(XmNtopWidget, leftWidget); SETARG(XmNleftAttachment, XmATTACH_WIDGET); SETARG(XmNleftWidget, leftWidget); SETARG(XmNrightAttachment, XmATTACH_FORM); XtSetValues(XtParent(rightWidget), args, i); XtManageChild(rightWidget); Incidentally. OSF did at one point consider using an extended Xresources form as an alternative to UIL, but was convinced (I forget the exact reasons) that it wasn't appropriate (too hacky?). -kee -- +-----------------------------------------------------------------------------+ | Alphalpha Software, Inc. | Voice/Fax: 617/646-7703 | Home: 617/641-3805 | | 148 Scituate St. | Smart fax, dial number. | | | Arlington, MA 02174 | Dumb fax, dial number, | BBS: 617/641-3722 | | nazgul@alphalpha.com | wait for ring, press 3. | 300/1200/2400 baud | +-----------------------------------------------------------------------------+