OpenCores
URL https://opencores.org/ocsvn/or1k/or1k/trunk

Subversion Repositories or1k

[/] [or1k/] [trunk/] [insight/] [tix/] [docs/] [FAQ.txt] - Blame information for rev 1765

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 578 markom
 
2
                        TIX FREQUENTLY ASKED QUESTIONS
3
 
4
  TABLE OF CONTENTS
5
 
6
   Legal Issues
7
 
8
          + [L.1] Is Tix free software?
9
 
10
   General Questions About Using The Tix Library
11
 
12
          + [G.1] What does the "-disablecallback" option do?
13
          + [G.2] How do I set the width of the entry subwidget inside
14
            the tixControl widget?
15
          + [G.3] What is the "setslient" method?
16
          + [G.4] Is there a Tix interface builder in the works?
17
          + [G.5] Can you tell me about the syntax of tixForm
18
          + [G.6] I am not using the tixForm geometry manager, but it is
19
            giving me errors about TixForm. What happened?
20
          + [G.7] How do I generate the tclIndex file for Tix?
21
          + [G.8] Can I ignore the default arguments passed by the
22
            various -command and -broeswcmd options?
23
          + [G.9] What does tixWidgetDoWhenIdle do?
24
          + [G.10] Why isn't such a feature in Tix? Will it be
25
            implemented?
26
          + [G.11] Who are using Tix in their software?
27
          + [G.12] I am using a DirList widget. When the user clicks on
28
            an item, the procedure of my -browsecmd gets called twice.
29
            However, I just want it to be called once.
30
          + [G.13] I get an error "can't read data(-value): no such
31
            element in array" when I use the tixExFileSelectDialog.
32
 
33
   Question About Porting to Specific Platforms/Software
34
 
35
          + [P.1] The configure script gave me strange errors.
36
          + [P.2] Does Tix 4.1 work with Tk 4.1
37
          + [P.3] Does Tix work with Incr Tcl 2.0?
38
          + [P.4] How do I get Tix to work with Expect?
39
          + [P.5] Solaris 2.4: Filenames in FileSelectBox are chopped
40
            off.
41
          + [P.6] Do I still need libXpm?
42
          + [P.7] I get a coredump as soon as tixwish starts up.
43
 
44
   Porting from Tix 3.6 to Tix 4.x
45
 
46
          + [X.1] What happened to the tixInit command?
47
          + [X.2] How do I set the schemes and fontsets in Tix 4.x?
48
          + [X.3] How do I choose the default TK color schemes and
49
            fontsets? Tix is messing up the colors of my existing
50
            programs.
51
          + [X.4] I want the old bisque look of Tk 3.6. tk_bisque doesn't
52
            work.
53
 
54
     _________________________________________________________________
55
 
56
  LEGAL ISSUES
57
 
58
   [L.1] Is Tix free software?
59
 
60
          ANSWER: Tix is distributed under the same license as Tcl/Tk
61
          (a.k.a. BSD style license). Application developers can freely
62
          redistribute Tix along with their products.
63
 
64
          We will continue to provide free technical support and
65
          maintainence for Tix. However, to recover the development
66
          costs, we would appreciate financial supports for the Tix user
67
          community. If you like Tix and would like to make a donation to
68
          the Tix Project, please send mail to xpi@xpi.com.
69
 
70
     _________________________________________________________________
71
 
72
  GENERAL QUESTIONS ABOUT USING THE TIX LIBRARY
73
 
74
   [G.1] What does the "-disablecallback" option do?
75
 
76
          ANSWER: Many Tix widgets have both a -value option and a
77
          -command option. Any modification of the -value will cause the
78
          -command callback to be executed. Sometimes this is
79
          undesirable. For example, calling "config -value" inside the
80
          callback procedure will cause the callback to be re-entered and
81
          thus an infinite recursion.
82
 
83
          The -disablecallback can be used to advoid this problem. When
84
          this option is set, the -command callback will not be executed
85
          even if the -value of a widget is changed. Therefore, if you
86
          need to modify the -value of a widget inside its callback, do
87
          this:
88
 
89
    proc my_callback {w} {
90
        $w config -disablecallback true
91
        $w config value blah
92
        $w config -disablecallback false
93
    }
94
 
95
   If you find this too troublesome, you can call the command
96
          tixSetSilent:
97
 
98
    proc my_callback {w} {
99
        tixSetSilent $w blah
100
    }
101
 
102
   [G.2] How do I set the width of the entry subwidget inside the
103
          tixControl widget?
104
 
105
          ANSWER: You can use the option database or the -options flag to
106
          set the configuration options of the subwidgets. E.g:
107
 
108
option add *TixControl*entry.width 10
109
 
110
   OR
111
 
112
tixControl .c -options {
113
   entry.width  10
114
}
115
 
116
   [G.3] What is the "setslient" method?
117
 
118
          ANSWER: This is an obsolete method. You could use it to achieve
119
          the same effect as the -disablecallback option. selsilent used
120
          to be a widget command for the ComboBox, Control, etc. It has
121
          been removed since Tix 4.0a4 and replaced by the tixSetSilent
122
          command. Please note that tixSetSilent is not a widget command
123
          but an external procedure.
124
 
125
   [G.4] Is there a Tix interface builder in the works?
126
 
127
          ANSWER: Yes. But I don't know when it will be finished.
128
          (probably in 96).
129
 
130
   [G.5] Can you tell me about the syntax of tixForm
131
 
132
          ANSWER: Please see the file man/Form.html or man/Form.n.
133
 
134
   [G.6] I am not using the tixForm geometry manager, but it is giving me
135
          errors about TixForm. What happened?
136
 
137
          ANSWER: When you get error messages like this:
138
 
139
 (TixForm) Error:Trying to use more than one geometry
140
           manager for the same master window.
141
           Giving up after 50 iterations.
142
 
143
   Most likely, the problem is when using tixLabelFrame widgets, you
144
          packed to the wrong frame:
145
 
146
          This is WRONG:
147
 
148
   tixLabelFrame .d
149
        button .d.b
150
        pack .d.b
151
 
152
   This is the correct way:
153
 
154
   tixLabelFrame .d
155
        set f [.d subwidget frame]
156
        button $f.b
157
        pack $f.b
158
        pack .d
159
 
160
   Remember you don't pack directly into a TixLabelFrame widget. Instead,
161
          you should pack into its frame subwidget.
162
 
163
   [G.7] How do I generate the tclIndex file for Tix?
164
 
165
          ANSWER: Tix tclIndex files cannot be generated using the
166
          standard auto_mkindex procedure. You must use the tixindex
167
          program in the tools/ subdirectory in the Tix distribution. The
168
          syntax is
169
 
170
 tixindex *.tcl
171
 
172
   [G.8] Can I ignore the default arguments passed by the various
173
          -command and -broeswcmd options?
174
 
175
          ANSWER: You can use the tixBreak command. For example:
176
 
177
 tixFileSelectDialog .c -command "puts foo; tixBreak"
178
 
179
   [G.9] What does tixWidgetDoWhenIdle do?
180
 
181
          ANSWER: It does the same thing as tixDoWhileIdle (and "after
182
          -idle"). The difference is it takes its second argument as the
183
          name of a widget and executes this command only if the widget
184
          exists: i.e.:
185
 
186
  tixWidgetDoWhenIdle tixComboBox::Update $w blah blah ..
187
 
188
   will execute tixComboBox::Update only if $w exists. $w may be
189
          destroyed after tixWidgetDoWhenIdle is called but before an
190
          idle event happens.
191
 
192
   [G.10] Why isn't such a feature in Tix? Will it be implemented?
193
 
194
          ANSWER: Generally requests for new features are welcomed. You
195
          can send your requests to tix@xpi.com and we'll be happy to
196
          hear from you.
197
 
198
          We can't guarantee to implement the requested features
199
          immediately. Usually it depends on how important the features.
200
          If the feature is requested by more people, it will usually get
201
          done faster. However, some frequently requested features
202
          probably won't be imlemented. Usually these features are
203
          cosmetic changes and:
204
 
205
          + they do not add new capability to the widgets
206
          + they are not universally liked
207
          + they confuse the user.
208
 
209
          Some examples are:
210
 
211
          + Different foreground and background colors for the NoteBook
212
            tabs: having a lot of colors may antagonize the users that
213
            are "color haters"; also, the different colors don't make it
214
            easier for the user to locate the desired tab.
215
          + Ring-binder metaphore for the NoteBook widget: a waste of
216
            screen real estate.
217
          + Rows of tabs for the NoteBook widget: the user may be
218
            confused when the rows of tabs are switched. If you need to
219
            have a lot of tabs for the notebook, use the ListNoteBook
220
            widget instead.
221
 
222
   [G.11] Who are using Tix in their software?
223
 
224
          ANSWER: I have compiled a list of softwares that use Tix. See
225
          http://www.xpi.com/tix/software.html. (These are only the
226
          ones that I have heard of, either from the authors themselves
227
          or from the TCL FAQ. There should be more of them).
228
 
229
   [G.12] I am using a DirList widget. When the user clicks on an item,
230
          the procedure of my -browsecmd gets called twice. However, I
231
          just want it to be called once.
232
 
233
          ANSWER: The -browsecmd procedure is triggered by three types of
234
          events: <1>, , and . When the user
235
          clicks on an entry, a <1> and a  event will
236
          happen in rapid session, which causes your -browsecmd procedure
237
          to be called twice.
238
 
239
          A crude fix for this problem is to ignore all the
240
           events. You can find out the event that
241
          triggers the -browsecmd procedure by the tixEvent command. Here
242
          is an example:
243
 
244
    tixDirList .c -browsecmd Browse
245
 
246
    proc Browse {args} {
247
        if {[tixEvent type] == ""} {
248
            return
249
        }
250
        # ....
251
    }
252
 
253
   However, the above solution is not perfect. For example, if the user
254
          clicks down the button at entry one, drags it over entries two
255
          and three and release it on top of entry three, the following
256
          events may be caused:
257
 
258
         1. <1> on entry one.
259
         2.  on entry two.
260
         3.  on entry three.
261
 
262
          Therefore, if you use the above method, the browse event on
263
          entry three will be lost!
264
 
265
          To devise a better solution, it's better to understand the
266
          basic design conventions of a Tix-based GUI. Suppose we have a
267
          list of entries displayed in a listbox (or DirList, or HList).
268
          When the user clicks on an entry, the GUI usually responds by
269
          displaying a "detailed view" of the entry. For example, if we
270
          put a list of file names in a listbox, when the user clicks on
271
          a file name, we display the contents of the file in a text
272
          window. If the user then clicks on another file name, the text
273
          window will load in the contents of the new file.
274
 
275
          Now what happens if the user clicks on the same entry twice? Do
276
          we reload the contents of the file into the text window? This
277
          is usually unnecessary, inefficient and probably not what the
278
          user wants to do. The Tix convention is, when the user clicks
279
          on the same entry again, the detail view is not updated. If the
280
          user wants to force an update (e.g, the user knows the file's
281
          contents has been changed and wants to see the new version), he
282
          or she can double-click on the entry and the application will
283
          respond by redisplaying the detail view (reloading the file).
284
 
285
          To implement this policy, the Browse procedure should be
286
          modified as the following:
287
 
288
    proc Browse {args} {
289
        global currentView
290
 
291
        set ent [tixEvent value]
292
        if {$ent == $currentView} {
293
            # We have already displayed the detailed view of $ent.
294
            #
295
            return
296
        } else {
297
            set currentView $ent
298
            DisplayDetail $ent
299
        }
300
    }
301
 
302
   [G.13] I get an error "can't read data(-value): no such element in
303
          array" when I use the tixExFileSelectDialog.
304
 
305
          ANSWER: If you use tixExFileSelectDialog like this:
306
 
307
        tixExFileSelectDialog .f -command foo
308
 
309
        foo {filename} {
310
            destroy .f
311
            do some other stuff ...
312
        }
313
 
314
   it will cause a Tcl error because the dialog assumes that it still
315
          exists after calling your command. This usually result in
316
          errors like this:
317
 
318
        can't read "data(-value)": no such element in array
319
            while executing
320
        "set data(-selection) $data(-value)..."
321
            (procedure "tixComboBox::SetValue" line 30)
322
 
323
   This "feature" is built into many Tix widgets and can't be fixed
324
          easily. To work around the problem, never destroy widgets
325
          inside -command calls. Usually you should unmap toplevel
326
          windows instead. If you must destroy widgets, do it with an
327
          "after" command. For example, the foo procedure should be
328
          rewritten as:
329
 
330
        foo {filename} {
331
            wm withdraw .f
332
            do some other stuff ...
333
 
334
            after idle {if [winfo exists .f] {destroy .f}}
335
        }
336
 
337
   Execute the "after" command at the very end of the -command. Otherwise
338
          the idle handler may be activated by some "update" calls.
339
 
340
     _________________________________________________________________
341
 
342
  QUESTION ABOUT PORTING TO SPECIFIC PLATFORMS/SOFTWARE
343
 
344
   [P.1] The configure script gave me strange errors.
345
 
346
          ANSWER: The problem may be you have several operating systems
347
          sharing the same file system. Some people encounter error
348
          messages like this:
349
 
350
# ./configure --prefix=/usr/vendor/tcl
351
loading cache ./config.cache
352
checking for a BSD compatible install... /usr/bin/installbsd -c
353
checking for ranlib... ranlib
354
checking how to run the C preprocessor... cc -E
355
checking for unistd.h... ./configure[603]: "${ac_cv_header_$ac_safe+set}": bad
356
substitution
357
 
358
   The problem is at line 2, configure loaded in ./config.cache, which
359
          may have been created by a different operating system, with
360
          settings only usuable for that operating system. To get around
361
          this, you should type
362
 
363
make distclean
364
./configure
365
make all
366
 
367
   [P.2] Does Tix 4.1 work with Tk 4.1
368
 
369
          ANSWER: Yes, just enable the "Tk 4.1 ..." option in the setup
370
          program. It will also compile Tix in a dynamic lobrary.
371
 
372
   [P.3] Does Tix work with Incr Tcl 2.0?
373
 
374
          ANSWER: Yes just enable the "Itcl 2.0 ..." option in the setup
375
          program. Make sure you have ITcl 2.0 installed. Beta versions
376
          will *NOT* work. Also make sure you have installed the source
377
          tree of ITcl 2.0 in the same directory where you install the
378
          Tix source tree.
379
 
380
   [P.4] How do I get Tix to work with Expect?
381
 
382
          ANSWER: From Paul Schmidt (kuato@netcom.com):
383
 
384
     I have integrated Tcl7.4, Tk4.0, Expect-5.19 and Tix4.0 on Linux
385
     1.2.13 (ELF) and Solaris 2.4. It isn't too hard. For an expectk+Tix
386
     binary you need to add a call to Tix_Init in exp_main_tk.c. If you
387
     can find the call to Tk_Init then just cut&paste and replace it with
388
     Tix_Init. Do the same if you want a Tk+Tix window shell in
389
     TkAppInit.c. Worked like a charm. If you have any problems just
390
     holler.
391
 
392
   [P.5] Solaris 2.4: Filenames in FileSelectBox are chopped off.
393
 
394
          ANSWER: Problem:
395
 
396
     With Tix4.0a7 (and also with Tix4.0a6) on Solaris 2.4, when running
397
     the widget demo, in tixFileSelectBox, in the two scolling lists (for
398
     Files an Directories), some of the file and directory names have
399
     their first 2 letters chopped off. And some files are repeated.
400
 
401
   Solution: tixwish has some conflicts with /usr/ucblib/libucb.so.1 and
402
          you should not linke it tixwish (you don't need it). Here is a
403
          solution provided by Charles L Ditzel
404
          (charles@hanami.cyberspace.com):
405
 
406
     To fix the problem I was having, all I did was:
407
 
408
   unsetenv LD_LIBRARY_PATH
409
   set my PATH to something basic like:
410
     /usr/bin:/usr/ccs/bin:/bin:/usr/openwin/bin:/opt/SUNWspro/bin
411
   removed config.cache
412
   ./configure
413
   make clean
414
   make
415
 
416
     and now it works!! Must have been something in my old PATH or
417
     LD_LIBRARY_PATH that was causing it to pick up
418
     /usr/ucblib/libucb.so.
419
 
420
   [P.6] Do I still need libXpm?
421
 
422
          ANSWER: No, now Tix has its own XPM file reader. You no longer
423
          need libXpm.
424
 
425
   [P.7] I get a coredump as soon as tixwish starts up.
426
 
427
          ANSWER: Try to get a backtrace of the stack when the core dump
428
          happens (with a debugger, for example). If the core dump
429
          happens right inside the call to Tk_ConfigureWidget() inside
430
          the file tixInit.c, then the problem is because you compiled
431
          libtk.a and libtix.a with different versions of the Th header
432
          file tk.h. Delete all the .o files from the src directory of
433
          Tix, fix the Makefile so that now you can compile libtix.a with
434
          the same tk.h that you used to compile libtk.a.
435
 
436
     _________________________________________________________________
437
 
438
  PORTING FROM TIX 3.6 TO TIX 4.X
439
 
440
   [X.1] What happened to the tixInit command?
441
 
442
          ANSWER: You don't need to use it anymore. It is provided in Tix
443
          4.x only for backward compatibility.
444
 
445
   [X.2] How do I set the schemes and fontsets in Tix 4.x?
446
 
447
          ANSWER: You can set the color schemes and fontsets using the
448
          standard X resource database (.Xdefaults file). You can add
449
          these two lines in the user's .Xdefaults file:
450
 
451
        *TixScheme:   Gray
452
        *TixFontSet:  14Point
453
 
454
   If you want to switch color schemes and fontsets during run time, you
455
          can issue the following commands:
456
 
457
        tix config -scheme Gray -fontset 14Point
458
 
459
   Please read the tix manual page for more details
460
 
461
   [X.3] How do I choose the default TK color schemes and fontsets? Tix
462
          is messing up the colors of my existing programs.
463
 
464
          ANSWER: Add these two lines in your .Xdefaults:
465
 
466
        *TixScheme:   TK
467
        *TixFontSet:  TK
468
 
469
   [X.4] I want the old bisque look of Tk 3.6. tk_bisque doesn't work.
470
 
471
          ANSWER: The Tix widgets are not compatible with tk_bisque. If
472
          you want a bisque-ish look you can add to your .Xdefaults file
473
          the following line:
474
 
475
        *TixScheme:   Bisque
476
 

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.