Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!wuarchive!uunet!mcsun!ukc!mucs!cns!umaida!jf From: jf@ap.co.umist.ac.uk (John Forrest) Newsgroups: comp.windows.x Subject: Re: MOTIF vs Athena. Practical to conditionalize? Message-ID: <1990Dec14.164540@ap.co.umist.ac.uk> Date: 14 Dec 90 16:45:40 GMT References: <3132@gazette.bcm.tmc.edu> <7036@mitech.com> <3165@gazette.bcm.tmc.edu> Sender: usenet@cns.umist.ac.uk (News System) Reply-To: jf@ap.co.umist.ac.uk (John Forrest) Organization: UMIST Computation dept, Manchester, UK Lines: 50 In article <3165@gazette.bcm.tmc.edu>, etaylor@wilkins.iaims.bcm.tmc.edu (Eric Taylor) writes: |> |> |> |> Here is a question. How difficult is it to conditionalize or |> |> abstract ones code such that different widget sets can be used |> |> depending on the local configuration/availability? |> |> |> |> Then if somebody has the MOTIF set on his system your application |> |> could look 3d/MOTIF, and if *not* then you would use Athena |> |> (and the person would probably not notice the difference, not being |> |> *used* to the 3d look, since he doesn't have it on his machine). |> |> |> |> -gjc |> |> |> |> p.s. Just a suggestion in the form of a question. |> |> |> Sometimes it is not too hard. It your application is nothing |> but a bunch of buttons then it is a snap. |> |> However, sometimes it is not so easy. For instance, toggle |> widgets are handled completely differently in Athena Widgets |> than they are in MOTIF (when using mutually exclusive toggles). |> |> Mutually exclusive toggles in MOTIF code must all be children |> of the same widget. The Athena analog can be spread out all over |> creation. |> |> Layout widgets are also fairly different from toolkit to toolkit. |> |> I have my own layout widget that I use to exclusion in which I |> have MOTIF flags. That helps some, but not always. |> |> MOTIF is awfully dependent upon itself. It is very easy to use |> Athena widgets in any other Xt-based toolkit, but not MOTIF. |> MOTIF widgets do all sorts of different things based upon the class |> of its parent. If you use the Widget Layout Manager from the Xcu toolkit, you are able to migrate from one toolkit to another. This is because the widget tree is described in a config file rather than the actual source, and also the config file can cope with first level ``callback handling''. Whether the toggle widgets are under one parent or spread out is thus in the config file, and not in the program itself. The program is thus ``reduced'' to providing the main functions of the application, and it would appear that most functions can be written in ways that are independent of the widget set. John Forrest Dept of Computation UMIST