1 | SccsID: @(#) README20 1.5 93/01/28 13:05:14 |
---|
2 | |
---|
3 | Widget Creation Library Version 2.0 Distribution |
---|
4 | ------------------------------------------------ |
---|
5 | |
---|
6 | The distribution contains files which make up the Widget Creation |
---|
7 | Library (Wcl or libWc.a), and resource interpreters and utility |
---|
8 | libraries (which include Table widgets) for each of the following |
---|
9 | widget sets: Athena, Cornell, Motif, and OpenLook. |
---|
10 | |
---|
11 | Wcl is completely widget set independent. It provides mechanisms to |
---|
12 | allow an entire user interface to be specified in resource files. |
---|
13 | Basically, this amounts to providing new resources for specifying the |
---|
14 | types of the widgets and the widget heirarchy. In addition, Wcl |
---|
15 | provides several callbacks and action functions whicc many programs |
---|
16 | need. |
---|
17 | |
---|
18 | New Features of Wcl |
---|
19 | ------------------- |
---|
20 | |
---|
21 | Mapping Agents - map arbitrary data to widgets. |
---|
22 | Templates - constructors defined in resource files. |
---|
23 | Argv Parsing - easier to set resource file, AppShell class. |
---|
24 | Error Database - all messages can be tailored. |
---|
25 | New WcCreate() - much faster, more consistent, better creation |
---|
26 | ordering, better creation time callbacks. |
---|
27 | UndefinedCB - Useful for prototypign and incremental development. |
---|
28 | WcInitialize() - so Wcl can be used even if it does not create the |
---|
29 | initial widget tree. |
---|
30 | Dynamic Creation- New functions: WcCreateChild(), WcCreatePopup() |
---|
31 | and WcCreateRoot() return new child Widget. |
---|
32 | Invoke*() - WcInvokeAction(), WcInvokeNamedAction(), and |
---|
33 | WcInvokeCallback() make it easy to implement |
---|
34 | application behaviors as either CB or Action |
---|
35 | procedures, yet make the behaviors available |
---|
36 | as both CB and Actions. |
---|
37 | WcSetValue - Multiple resource values can be set from String |
---|
38 | specifications. Three interfaces: WcSetValue(), |
---|
39 | WcSetValueFromString(), WcSetValueFromStringAndType(). |
---|
40 | Dynamic Binding - Callbacks and actions can be invoked from shared |
---|
41 | libraries on SVR4 and SunOS machines when you |
---|
42 | use the new WcDynamicAction() and WcDynamicCallback() |
---|
43 | actions and callbacks. |
---|
44 | New CBs & ACTs - WcMap(), WcUnmap(), WcInstallAccelerators(), |
---|
45 | WcInstallAllAccelerators(), WcCreateRoot(), |
---|
46 | WcSpawn(), WcPrintTree(), WcPositionTransient(), |
---|
47 | WcSetValues(*re-worked*), WcOnceOnly(), |
---|
48 | WcAddCallbacks(), WcRemoveCallbacks(), |
---|
49 | WcTranslations() |
---|
50 | |
---|
51 | |
---|
52 | The Future of Wcl |
---|
53 | ----------------- |
---|
54 | |
---|
55 | I am planning on a regular 3 month revision cycle. There are several |
---|
56 | capabilities and new widgets which are in development and scheduled for |
---|
57 | future releases: |
---|
58 | |
---|
59 | 1. The ability to specify resourceName, ResourceClass, ResourceType for |
---|
60 | resources of widgets which are not reported by XtGetResourceList() and |
---|
61 | XtGetConstraintResourceList(), such as TextSrc and TextSink resources |
---|
62 | of Athena derived text widgets like XmText. |
---|
63 | |
---|
64 | 2. SetState: The ability to change resources of many widgets in part of |
---|
65 | a widget tree. |
---|
66 | |
---|
67 | 3. The ability to set Wcl resources on widgets via editres. |
---|
68 | |
---|
69 | 4. Resource database consistency checking (like "lint") following widget |
---|
70 | tree creation, triggered by Wcl callbacks or actions. |
---|
71 | |
---|
72 | 5. Extension of the Dynamic Binding concept |
---|
73 | |
---|
74 | Documentation is currently being re-written. Viewgraphs, a tutorial, |
---|
75 | and an updated reference manual are well underway, but nor quite finished. |
---|
76 | |
---|
77 | |
---|
78 | Table Widget |
---|
79 | ------------ |
---|
80 | |
---|
81 | Two versions of the Table widget are provided: the XpTable widget which |
---|
82 | is derived from Xt base classes and therefore can be used by all the |
---|
83 | widget sets, and the XmpTable widget which is derived from the Motif |
---|
84 | XmBulletinBoard widget, and therefore can only be used with Motif. The |
---|
85 | XpTable implementation is shared via links by each of the Xp, Xcp, and |
---|
86 | Xop library subdirectories. |
---|
87 | |
---|
88 | This complete re-write of the Table widget provides some added |
---|
89 | functionality and more consistent behavior. Children widgets can now |
---|
90 | be easily, efficiently, and correctly placed at any col/row/span within |
---|
91 | the table. Margins (top/bottom and left/right) between the edge of the |
---|
92 | table and the children can now be specified. Primitive widgets now |
---|
93 | shrink! Several minor bugs in the original table which causes |
---|
94 | inconsistent behavior have been eliminated. |
---|
95 | |
---|
96 | |
---|
97 | Demonstration Resource Files |
---|
98 | ---------------------------- |
---|
99 | |
---|
100 | Demonstration application resource files are now installed in subdirectories |
---|
101 | of XAPPLOADDIR (usually /usr/X11R5/lib/X11/app-defaults) to keep from |
---|
102 | cluttering up this increasingly important directory. |
---|
103 | |
---|
104 | The Motif demonstration resource files are pre-processed by cpp to get |
---|
105 | rid of inconsistencies between Motif 1.0 and Motif 1.1 shell naming |
---|
106 | conventions. |
---|
107 | |
---|
108 | I use Mri for regression and path testing of Wcl, and so there are |
---|
109 | several specific resource files named Wc* in the Mri directory. These |
---|
110 | are not installed, and are normally interpreted by Mri/Test, which |
---|
111 | is a slightly modified version of Mri specifically for testing. |
---|
112 | |
---|
113 | I would be grateful if somebody would provide similar resource files and |
---|
114 | test programs for the other widget sets. |
---|
115 | |
---|
116 | |
---|
117 | For Athena |
---|
118 | ---------- |
---|
119 | |
---|
120 | This distribution provides Ari (the Athena Resource Interpreter), and |
---|
121 | the Xp library. The Xp library includes the table widget and a |
---|
122 | convenience procedure which registers all Athena widgets (including the |
---|
123 | new ones in R5). The same set of Athena demo resource files are |
---|
124 | provided, which now install in a subdirectory of |
---|
125 | .../lib/X11/app-defaults/Ari |
---|
126 | |
---|
127 | For Cornell |
---|
128 | ----------- |
---|
129 | |
---|
130 | The Cri and libXcp originally provided by Kim Gillies has been |
---|
131 | upgraded very slightly, but it is still the least mature. The Athena |
---|
132 | version of the Table widget (XpTable) is built into the Xcp library. |
---|
133 | |
---|
134 | For Motif |
---|
135 | --------- |
---|
136 | |
---|
137 | Xmp provides Motif specific functions and the Table widget derived from |
---|
138 | Motif manager widgets so it works nicely within Motif user interfaces. |
---|
139 | This version of Table is named XmpTable. |
---|
140 | |
---|
141 | Mri can be considered a prototype program for any Motif application. |
---|
142 | Many example resource files are provided which act as a tutorial to the |
---|
143 | use of Mri and Motif. There is also a program called Test along with |
---|
144 | some additional resource files. I use Test to do complete path testing |
---|
145 | and capability testing of this distribution. You can too in order to |
---|
146 | ensure everything works on your platform. |
---|
147 | |
---|
148 | For OpenLook (OLIT) Widgets |
---|
149 | --------------------------- |
---|
150 | |
---|
151 | If you have a Sun, you should have fun with Ori and libXop. Again, the |
---|
152 | Athena version of the Table widget (XpTable) is built into the Xop |
---|
153 | library. Kim Gillies has provided many very useful tutorials for |
---|
154 | using Ori. I like this stuff! |
---|
155 | |
---|
156 | |
---|
157 | Incompatible Changes With Earlier Versions of Wcl |
---|
158 | ------------------------------------------------- |
---|
159 | |
---|
160 | This is version 2.x not 1.x - there are things which are different, and |
---|
161 | you will have to change some of your C code and your resource files. |
---|
162 | |
---|
163 | |
---|
164 | CHANGED: The Creation Logic |
---|
165 | --------------------------- |
---|
166 | |
---|
167 | There is now a distinction between the resources which must be fetched |
---|
168 | before a widget can be created, and those resources which may be |
---|
169 | fetched afterwards. This may require you to change some resource |
---|
170 | specifications for widgets created using some of the Motif widget |
---|
171 | constructors which create additional widgets, like XmCreatePulldownMenu |
---|
172 | or XmCreateScrolledWindow. |
---|
173 | |
---|
174 | Also, there is now a new creation resource, wcPopups, which should be |
---|
175 | used to create popup children of widgets. |
---|
176 | |
---|
177 | Note that this will no longer work with Wcl 2.0: |
---|
178 | |
---|
179 | *foo.wcChildren: first second third |
---|
180 | |
---|
181 | *third.wcConstructor: XmCreatePulldownMenu |
---|
182 | *third.wcManaged: False |
---|
183 | *third.wcChildren: one two three |
---|
184 | |
---|
185 | The problem is that with Wcl 1.x the wcManaged and wcChildren resources |
---|
186 | were incorrectly fetched before the widget was created. This is no longer |
---|
187 | the case. You can either change the specification to be like this: |
---|
188 | |
---|
189 | *third.wcConstructor: XmCreatePulldownMenu |
---|
190 | *third*wcManaged: False |
---|
191 | *third*wcChildren: one two three |
---|
192 | |
---|
193 | Or more correctly, change them to look like this: |
---|
194 | |
---|
195 | *foo.wcPopups: first |
---|
196 | *foo.wcChildren: second third |
---|
197 | |
---|
198 | *third.wcConstructor: XmCreatePulldownMenu |
---|
199 | *third*wcChildren: one two three |
---|
200 | |
---|
201 | When using Motif, the symptom of this problem is seen if 10x10 shells |
---|
202 | show up on the screen which (usually) do not have window manager |
---|
203 | provided decoration, and which go away when you click the mouse |
---|
204 | anywhere. The symptom looks like this because the *foo.wcManaged and |
---|
205 | *foo.wcChildren resources are not seen. |
---|
206 | |
---|
207 | Note that the children named in wcPopups resources are created before |
---|
208 | children in wcChildren resources. |
---|
209 | |
---|
210 | |
---|
211 | ENHANCED: Creation Time Callbacks |
---|
212 | --------------------------------- |
---|
213 | |
---|
214 | There are now several creation time callbacks. The original wcCallback |
---|
215 | is still supported, and is still invoked before any children of the widget |
---|
216 | are created. The full set of creation time callbacks are listed below: |
---|
217 | |
---|
218 | *foo.wcCallback: Invoked after foo is created, but before |
---|
219 | any of its children are created. |
---|
220 | *foo.wcAfterPopups: Invoked only if foo has popup children, |
---|
221 | after the popup children are created. |
---|
222 | *foo.wcAfterChildren: Invoked only if foo has normal children, |
---|
223 | after the normal children are created. |
---|
224 | *foo.wcAfterManageChildren: Invoked only if foo has normal children, |
---|
225 | after the normal children have been managed, |
---|
226 | even if all of the normal children have their |
---|
227 | *wcManaged resource set false. |
---|
228 | |
---|
229 | Note that all of these callback resources are post-creation resources, |
---|
230 | so you need to be aware of phantom widgets which may be spliced into |
---|
231 | the widget tree when you use widget constructors like XmCreatePopupMenu. |
---|
232 | |
---|
233 | |
---|
234 | CHANGED: Include File Installation Location |
---|
235 | ------------------------------------------- |
---|
236 | |
---|
237 | Wcl include files should be installed in a subdirectory of the X11 |
---|
238 | include files, just like Xaw and Xmu include files. Therefore, |
---|
239 | you should change your include directives to look like this: |
---|
240 | |
---|
241 | #include <X11/Wc/WcCreate.h> |
---|
242 | #include <X11/Xmp/Xmp.h> |
---|
243 | |
---|
244 | This conforms to the X11R5 conventions. Note that many eariler |
---|
245 | versions of Wcl actually installed the include files in subdirectories |
---|
246 | of X11 already, so you probably already use compile flags to tell the |
---|
247 | compiler to look in .../X11 for Wcl includes. |
---|
248 | |
---|
249 | |
---|
250 | REMOVED: WcSetTypeValue |
---|
251 | ----------------------- |
---|
252 | |
---|
253 | WcSetTypeValue is not longer supported. Instead, use WcSetValue with a |
---|
254 | parenthesized type following the resource name and preceeding the `:' |
---|
255 | like this: |
---|
256 | |
---|
257 | WcSetTypeValue( *msgWindow.fontList: FontList, *courier-*--10-* ) |
---|
258 | |
---|
259 | should be replaced with |
---|
260 | |
---|
261 | WcSetValue( *msgWindow.fontList(FontList): *courier-*--10-* ) |
---|
262 | |
---|
263 | |
---|
264 | CHANGED: WcSetValue |
---|
265 | ------------------- |
---|
266 | |
---|
267 | WcSetValue now uses a more rational algorithm for converting values |
---|
268 | into widgets. The new scheme allows code to be cut and pasted from |
---|
269 | normal resource specifications into the arguments for WcSetValue. |
---|
270 | Specifically, I had to change this specification: |
---|
271 | |
---|
272 | *fileMenu.wcCallback: WcSetValue(*file.subMenuId: this) |
---|
273 | |
---|
274 | to be |
---|
275 | |
---|
276 | *fileMenu.wcCallback: WcSetValue(*file.subMenuId: ^*fileMenu) |
---|
277 | |
---|
278 | Why? Because in the previous version, the `this' widget implied the |
---|
279 | widget which invoked the callback. In all other cases of resource |
---|
280 | specifications, the `this' widget implies the widget whose resource |
---|
281 | value is being set. Therefore, I eliminated this inconsitency: now |
---|
282 | whenever `this' shows up in a resource specification value, it always |
---|
283 | means the widget whose resource is being specified. In the above case, |
---|
284 | it is now possible to cut and paste a resource specification from and |
---|
285 | to the WcSetValue arguments. |
---|
286 | |
---|
287 | |
---|
288 | ENHANCED: WcSetValue |
---|
289 | -------------------- |
---|
290 | |
---|
291 | As an enhancement, WcSetValue can now handle multiple specifications by |
---|
292 | parenthesizing each separate specification like this: |
---|
293 | |
---|
294 | WcSetValue( (*file.subMenuId: *fileMenu) (*help.subMenuId: *helpMenu) ) |
---|
295 | |
---|
296 | |
---|
297 | NO-OPS: WcAllowDuplicate*Registration |
---|
298 | ------------------------------------- |
---|
299 | |
---|
300 | Duplicate registrations are now always allowed: they always replace |
---|
301 | previous registrations. These functions are now all no-ops. |
---|
302 | |
---|
303 | |
---|
304 | CHANGED AND INCOMPATIBLE WITH 1.06: Templates |
---|
305 | --------------------------------------------- |
---|
306 | |
---|
307 | The entire principle and mechanism for templates has been re-done. |
---|
308 | Your existing templates will NOT work, but they can be made to work |
---|
309 | with minor edits. This implementation uses a Wcl library resource to |
---|
310 | identify a file which contains only resource specifications for |
---|
311 | templates. See the files Mri/PerTem, Mri/PT_DisplayBox, and |
---|
312 | Mri/PT_ColumnLable to see how I changed Mri/Periodic to use templates |
---|
313 | (also note the use of WcDynamicCallback and WcDynamicAction). |
---|
314 | |
---|
315 | Templates absolutely REQUIRE the X11R5 Xlib and Xt. You do not need |
---|
316 | anything else from X11R5. |
---|
317 | |
---|
318 | |
---|
319 | CHANGED: WcResFile now WclResFiles |
---|
320 | ---------------------------------- |
---|
321 | |
---|
322 | Intensive path coverage testing of Wcl 2.0 using Saber-C uncovered a |
---|
323 | serious bug in the concept of wcResFile. Some users of the data in |
---|
324 | the resource database do not make copies of values, but instead |
---|
325 | expect the resource database to remain constant. WcResFile causes |
---|
326 | resource values which change TO BE FREE'd, which of course is dangerous |
---|
327 | if anyone is using the storage (actually, Xrm does the freeing, and |
---|
328 | Wcl cannot avoit causing this to happen). |
---|
329 | |
---|
330 | Therefore, the wcResFile resource is no longer recognized as a widget |
---|
331 | instance resource. |
---|
332 | |
---|
333 | Instead, a new resource, WclResFiles, has been added. This resource |
---|
334 | allows all resource files to be loaded when Wcl is initialized (usually |
---|
335 | the first time WcWidgetCreation is called). This is a LOT safer. |
---|
336 | |
---|
337 | CHANGED: WcLoadResourceFiles() |
---|
338 | ------------------------------ |
---|
339 | |
---|
340 | This procedure should not be used to load widget resource values. It |
---|
341 | is still safe to use for application resources, but you need to be careful |
---|
342 | about the possibility of resource values being free'd if they are changed |
---|
343 | due to new resource specifications. |
---|
344 | |
---|
345 | Also, this procedure now takes a Widget, rather than a Display* as its |
---|
346 | argument. It can tell the difference, so this is actually a binary |
---|
347 | compatible, but strong-type-checking source level incompatibility! |
---|
348 | |
---|
349 | RENAMED: Motif Table now XmpTable |
---|
350 | --------------------------------- |
---|
351 | |
---|
352 | The Motif derived Table widget is now named XmpTable in order to allow |
---|
353 | both the Athena and Motif versions to co-exist in the same application, |
---|
354 | and to follow the de-facto naming conventions. This name change was |
---|
355 | done in Wcl 1.05, so you may have already incorporated the effects. |
---|
356 | |
---|
357 | RENAMED: Athena, Cornell, and OpenLook Tables now XpTable |
---|
358 | --------------------------------------------------------- |
---|
359 | |
---|
360 | |
---|
361 | ***** End of incompatibilities ***** |
---|
362 | |
---|
363 | |
---|
364 | README Files and Documentation |
---|
365 | ------------------------------ |
---|
366 | |
---|
367 | Postscript documentation is no longer distributed with Wcl due to the |
---|
368 | size of such files. The distribution now contains several useful |
---|
369 | man pages. The Postscript documentation is being re-worked, and |
---|
370 | will be available shortly via ftp from export, and via the other |
---|
371 | source archives. |
---|
372 | |
---|
373 | In addition, the resource files in the Ari, Cri, Mri, and Ori |
---|
374 | directories contain a lot of comments, and are intended to illuminate |
---|
375 | many subtle techniques which you will find useful. All of the C source |
---|
376 | files are also heavily commented. |
---|
377 | |
---|
378 | |
---|
379 | Imakefiles and MakeByHand Makefiles |
---|
380 | ----------------------------------- |
---|
381 | |
---|
382 | Both Imakefiles and hand-built (MakeByHand) Makefiles are provided. |
---|
383 | |
---|
384 | See the file README_BUILD for specific build instructions. |
---|
385 | |
---|
386 | |
---|
387 | |
---|
388 | Passing Wcl on to others |
---|
389 | ------------------------ |
---|
390 | |
---|
391 | As mentioned in the Wcl copyright (see the COPY include file) the entire |
---|
392 | Wcl distribution can be given to others. In order to make this easy, the |
---|
393 | hand-built Makefile has targets for making compressed tarfiles: |
---|
394 | |
---|
395 | % make -f MakeByHand tar.Z |
---|
396 | |
---|
397 | |
---|
398 | Acknowledgements |
---|
399 | ---------------- |
---|
400 | |
---|
401 | Martin Brunecky (marbru@auto-trol.com), at Auto-trol Technology |
---|
402 | Corporation, Denver, CO must be given alot of credit for any release of |
---|
403 | Wcl. He provided the original proof of concept, and has since provided |
---|
404 | many useful suggestions and criticisms. He filled in to support and |
---|
405 | boost Wcl when my network connectivity was virtually non-existent for |
---|
406 | several months. |
---|
407 | |
---|
408 | David Harrison originally developed the Table widget when he was at the |
---|
409 | University of California, Berkeley in 1989. Martin, Kee Hinckley |
---|
410 | (nazgul@alphalpha.com) and others have provided bug fixes and |
---|
411 | enhancements over the years. |
---|
412 | |
---|
413 | Many, many other people have provided ideas, fixes, feedback, and |
---|
414 | support during the life of Wcl. There is no way I could make a |
---|
415 | reasonably exhaustive list, but certainly Wcl would not be what it is |
---|
416 | without Andrew Peebles (peebles@mips.com), Andrew Wason |
---|
417 | (aw@bae.bellcore.com), Kim Gillies (gillies@noao.edu), Ronald P. Hughes |
---|
418 | (ron@xwind.com), Adrian Nye (adrian@ora.com), Richard Hesketh |
---|
419 | (rlh2@ukc.ac.uk), Ron Newman (rnewman@bbn.com), Bo Thide <bt@irfu.se>, |
---|
420 | Gary Gu (ggu@maxine.WPI.EDU), John Mackin (john@cs.su.oz.au), Jim |
---|
421 | Ludwig (jludwig@encore.com), Thomas Wolf (wolf@mink.att.com), Randy |
---|
422 | Brown (erik!randy@uunet.UU.NET), Art Poley <media!arthur@uunet.UU.NET>, |
---|
423 | Rod Whitby (rwhitby@research.canon.oz.au), David B. Lewis, Mike Yee, |
---|
424 | David Elliott, and Niels Mayer (mayer@hplabs.hp.com). |
---|
425 | |
---|
426 | And of course nothing would have been done without the encouragement, |
---|
427 | leeway, and funding by "Suits" including Joe Kahr, John Diehl, Steve |
---|
428 | Wright, and Dr. Andreas Wnuk. |
---|
429 | |
---|
430 | And of course, everyone currently or once with the X Consortium, |
---|
431 | especially Chris D. Peterson, Donna Converse (who saved my last |
---|
432 | vacation), Paul Asente, Ralph Swick, and Mark Ackerman, must be |
---|
433 | given credit: the best way to become great is to stand on the |
---|
434 | shoulders of giants. |
---|
435 | |
---|
436 | ------------------------------------------------------------ |
---|
437 | David E. Smyth David.Smyth@sniap.mchp.sni.de |
---|
438 | Object/X Researcher david@ap542.uucp |
---|
439 | Esprit Research david%ap542@ztivax.siemens.com |
---|
440 | Funding provided by: Siemens Nixdorf Informationssysteme AG |
---|
441 | AP 154, Carl-Wery-Str 22, Munich 83 Germany |
---|
442 | |
---|