Path: utzoo!censor!geac!jtsv16!uunet!wuarchive!decwrl!elroy.jpl.nasa.gov!ames!amdcad!sun!turnpike!argv From: argv%turnpike@Sun.COM (Dan Heller) Newsgroups: comp.windows.x Subject: Toolkit decisions (was: XView v. other toolkits, advice wanted) Message-ID: <132173@sun.Eng.Sun.COM> Date: 23 Feb 90 01:35:13 GMT References: <22697@mimsy.umd.edu> Sender: news@sun.Eng.Sun.COM Reply-To: argv@sun.UUCP (Dan Heller) Distribution: usa Lines: 108 this message attempts to answer a general question rather than the person's specific questions. however, I do reference his message for clarity. In article <22697@mimsy.umd.edu> folta@tove.umd.edu (Wayne Folta) writes: > At work, we have to make a decision as to which way to go: move our > Sun 3 SunView operations to xnews and XView, or move to X11R4 and use > other toolkits. They are not mutually exclusive -- you can run XView on X11R4 as well as R3. You don't need xnews, but you probably shouldn't attempt XView without an Open Look window manager. If you are having problems getting XView running under R4, there are solutions -- followup in a separate article. > Questions: > 1. Is it really advantageous to stay with Sun on the move to X or > is MIT's X11R4 generic tape a viable option? (e.g. is the fact that > Open Windows is supported by Sun a big advantage over the more generic > X11R4?) This is strictly my humble opinion -- If you are a sun user and are planning on using lots of Sun-provided products, then I recommend you stick with xnews because of the support for the postscript apps. They are nice, convenient, *written*, and interact well in your general user environment. xnews doesn't have to use be used, but you don't lose anything by using it. With respect to R4 -- yes, it's faster and nicer than R3, but it is the common denominator, so to speak --you're not going to get anything from R4 that xnews won't give you. Which you use depends on your application. If you are going to sell xnews specific software, then there's your answer, but if you are going to develop generic X applications, then you can choose one or the other without it affecting the outcome of your program. > 2. Do most toolkits (other than XView) allow mixing and matching > among themselves are they mostly exclusive? (I am thinking particularly > of Xcu.) You should never mix and match toolkits. At least well written ones. You see, a toolkit is supposed to implement a particular "look and feel". If you mix in elements from other toolkits, you will break that look and feel paradigm and potentially confuse the user. You can mix Xt-based toolkits only because they all depend on Xt to act as the base layer for widget creation and manipulation. That doesn't mean they were intended to be merged. You should *choose an interface* and then go with the toolkit that supports it. Or even better yet, you should develop your applications such that multiple toolkits could be integrated in easily. In other words, a well designed application should allow you to plug in a Motif module or a Open Look module or an XCu toolkit module without having to change the baseline design of the product. For example, you shoul.d call higher level functions like: InitToolkit(&argc, argv); CreateTopLevelWindows(); MainLoop(); This portion of the code shoud never change. However, if you're going to use XView, then the "XView module" should have the function InitToolkit(argc, argv) int *argc; char *argv[]; { xv_init(XV_INIT_ARGC_PTR_ARGV, &argc, argv, NULL); } whereas the XCu or other Xt-based toolkits would have a module that looked like: InitToolkit(argc, argv) int *argc; char *argv[]; { top_level = XtInitialize(argv[0], argv[0], options, XtNumber(options), &argc, argv); } Of course, this is somewhat trickier than it looks, but at least if you attempt to -design- your software openmindedly, then your life will be much nicer when you suddenly get a new client that wants your software to run under the "foobar" toolkit. the point is, all "toolkits" have certain fundamental elements that are predictable -- there are going to be scrollbars, pushbuttons, menus, labels, and callback routines. And all applications have certain properties to them -- they have command line arguments (resources of some kind), require some sort of IO with the usert( and have to "compute" something. Make as much effort as necessary to separate all these fundamental building blocks of an application so you can modify any one particular part of it without affecting the other parts. > 3. Do most toolkits (other than XView) have an object-orientation with > inheritence? Xt does as well as any others I've seen. > 4. Will a mixture (Sun's server, other people's X11R4 toolkits) be possible now > or in the near future? Possible now.. dan ----------------------------------------------------------- O'Reilly && Associates argv@sun.com / argv@ora.com 632 Petaluma Ave, Sebastopol, CA 95472 800-338-NUTS, in CA: 800-533-NUTS, FAX 707-829-0104