File: FAQ.txt

package info (click to toggle)
tix 8.4.3-4
  • links: PTS
  • area: main
  • in suites: squeeze, wheezy
  • size: 8,448 kB
  • ctags: 6,844
  • sloc: ansic: 28,077; tcl: 22,774; python: 7,577; makefile: 332; cs: 253; sh: 185; perl: 128
file content (342 lines) | stat: -rw-r--r-- 12,824 bytes parent folder | download | duplicates (6)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
$Id: FAQ.txt,v 1.4 2004/12/24 01:27:22 hobbs Exp $


                        TIX FREQUENTLY ASKED QUESTIONS

  TABLE OF CONTENTS

   Legal Issues 

          + [L.1] Is Tix free software?

   General Questions About Using The Tix Library 

          + [G.1] What does the "-disablecallback" option do?
          + [G.2] How do I set the width of the entry subwidget inside
            the tixControl widget?
          + [G.3] What is the "setslient" method?
          + [G.4] Is there a Tix interface builder in the works?
          + [G.5] Can you tell me about the syntax of tixForm
          + [G.6] I am not using the tixForm geometry manager, but it is
            giving me errors about TixForm. What happened?
          + [G.7] How do I generate the tclIndex file for Tix?
          + [G.8] Can I ignore the default arguments passed by the
            various -command and -broeswcmd options?
          + [G.9] What does tixWidgetDoWhenIdle do?
          + [G.10] Why isn't such a feature in Tix? Will it be
            implemented?
          + [G.11] Who are using Tix in their software?
          + [G.12] I am using a DirList widget. When the user clicks on
            an item, the procedure of my -browsecmd gets called twice.
            However, I just want it to be called once.
          + [G.13] I get an error "can't read data(-value): no such
            element in array" when I use the tixExFileSelectDialog.

   Question About Porting to Specific Platforms/Software 

          + [P.1] The configure script gave me strange errors.

     _________________________________________________________________

  LEGAL ISSUES 

   [L.1] Is Tix free software? 

          ANSWER: Tix is distributed under the same license as Tcl/Tk
          (a.k.a. BSD style license). Application developers can freely
          redistribute Tix along with their products.

     _________________________________________________________________

  GENERAL QUESTIONS ABOUT USING THE TIX LIBRARY 

   [G.1] What does the "-disablecallback" option do? 

          ANSWER: Many Tix widgets have both a -value option and a
          -command option. Any modification of the -value will cause the
          -command callback to be executed. Sometimes this is
          undesirable. For example, calling "config -value" inside the
          callback procedure will cause the callback to be re-entered and
          thus an infinite recursion.

          The -disablecallback can be used to advoid this problem. When
          this option is set, the -command callback will not be executed
          even if the -value of a widget is changed. Therefore, if you
          need to modify the -value of a widget inside its callback, do
          this:

    proc my_callback {w} {
        $w config -disablecallback true
        $w config value blah
        $w config -disablecallback false
    }

   If you find this too troublesome, you can call the command
          tixSetSilent:

    proc my_callback {w} {
        tixSetSilent $w blah
    }

   [G.2] How do I set the width of the entry subwidget inside the
          tixControl widget? 

          ANSWER: You can use the option database or the -options flag to
          set the configuration options of the subwidgets. E.g:

option add *TixControl*entry.width 10

   OR

tixControl .c -options {
   entry.width  10
}

   [G.3] What is the "setslient" method? 

          ANSWER: This is an obsolete method. You could use it to achieve
          the same effect as the -disablecallback option. selsilent used
          to be a widget command for the ComboBox, Control, etc. It has
          been removed since Tix 4.0a4 and replaced by the tixSetSilent
          command. Please note that tixSetSilent is not a widget command
          but an external procedure.

   [G.4] Is there a Tix interface builder in the works? 

          ANSWER: Yes. But I don't know when it will be finished.
          (probably in 96).

   [G.5] Can you tell me about the syntax of tixForm 

          ANSWER: Please see the file man/Form.html or man/Form.n.

   [G.6] I am not using the tixForm geometry manager, but it is giving me
          errors about TixForm. What happened? 

          ANSWER: When you get error messages like this:

 (TixForm) Error:Trying to use more than one geometry
           manager for the same master window.
           Giving up after 50 iterations.

   Most likely, the problem is when using tixLabelFrame widgets, you
          packed to the wrong frame:

          This is WRONG:

   tixLabelFrame .d
        button .d.b
        pack .d.b

   This is the correct way:

   tixLabelFrame .d
        set f [.d subwidget frame]
        button $f.b
        pack $f.b
        pack .d

   Remember you don't pack directly into a TixLabelFrame widget. Instead,
          you should pack into its frame subwidget.

   [G.7] How do I generate the tclIndex file for Tix? 

          ANSWER: Tix tclIndex files cannot be generated using the
          standard auto_mkindex procedure. You must use the tixindex
          program in the tools/ subdirectory in the Tix distribution. The
          syntax is

 tixindex *.tcl

   [G.8] Can I ignore the default arguments passed by the various
          -command and -broeswcmd options? 

          ANSWER: You can use the tixBreak command. For example:

 tixFileSelectDialog .c -command "puts foo; tixBreak"

   [G.9] What does tixWidgetDoWhenIdle do? 

          ANSWER: It does the same thing as tixDoWhileIdle (and "after
          -idle"). The difference is it takes its second argument as the
          name of a widget and executes this command only if the widget
          exists: i.e.:

  tixWidgetDoWhenIdle tixComboBox::Update $w blah blah ..

   will execute tixComboBox::Update only if $w exists. $w may be
          destroyed after tixWidgetDoWhenIdle is called but before an
          idle event happens.

   [G.10] Why isn't such a feature in Tix? Will it be implemented? 

          ANSWER: Generally requests for new features are welcomed. You
          can submit your requests to http://tix.sourceforge.net forums
	  and we'll be happy to hear from you.

          We can't guarantee to implement the requested features
          immediately. Usually it depends on how important the features.
          If the feature is requested by more people, it will usually get
          done faster. However, some frequently requested features
          probably won't be imlemented. Usually these features are
          cosmetic changes and:

          + they do not add new capability to the widgets
          + they are not universally liked
          + they confuse the user.

          Some examples are:

          + Different foreground and background colors for the NoteBook
            tabs: having a lot of colors may antagonize the users that
            are "color haters"; also, the different colors don't make it
            easier for the user to locate the desired tab.
          + Ring-binder metaphore for the NoteBook widget: a waste of
            screen real estate.
          + Rows of tabs for the NoteBook widget: the user may be
            confused when the rows of tabs are switched. If you need to
            have a lot of tabs for the notebook, use the ListNoteBook
            widget instead.

   [G.11] Who are using Tix in their software? 

          ANSWER: See http://tix.sourceforge.net

   [G.12] I am using a DirList widget. When the user clicks on an item,
          the procedure of my -browsecmd gets called twice. However, I
          just want it to be called once. 

          ANSWER: The -browsecmd procedure is triggered by three types of
          events: <1>, <ButtonRelease-1>, and <B1-Motion>. When the user
          clicks on an entry, a <1> and a <ButtonRelease-1> event will
          happen in rapid session, which causes your -browsecmd procedure
          to be called twice.

          A crude fix for this problem is to ignore all the
          <ButtonRelease-1> events. You can find out the event that
          triggers the -browsecmd procedure by the tixEvent command. Here
          is an example:

    tixDirList .c -browsecmd Browse

    proc Browse {args} {
        if {[tixEvent type] == "<ButtonRelease-1>"} {
            return
        }
        # ....
    }

   However, the above solution is not perfect. For example, if the user
          clicks down the button at entry one, drags it over entries two
          and three and release it on top of entry three, the following
          events may be caused:

         1. <1> on entry one.
         2. <B1-Motion> on entry two.
         3. <ButtonRelease-1> on entry three.

          Therefore, if you use the above method, the browse event on
          entry three will be lost!

          To devise a better solution, it's better to understand the
          basic design conventions of a Tix-based GUI. Suppose we have a
          list of entries displayed in a listbox (or DirList, or HList).
          When the user clicks on an entry, the GUI usually responds by
          displaying a "detailed view" of the entry. For example, if we
          put a list of file names in a listbox, when the user clicks on
          a file name, we display the contents of the file in a text
          window. If the user then clicks on another file name, the text
          window will load in the contents of the new file.

          Now what happens if the user clicks on the same entry twice? Do
          we reload the contents of the file into the text window? This
          is usually unnecessary, inefficient and probably not what the
          user wants to do. The Tix convention is, when the user clicks
          on the same entry again, the detail view is not updated. If the
          user wants to force an update (e.g, the user knows the file's
          contents has been changed and wants to see the new version), he
          or she can double-click on the entry and the application will
          respond by redisplaying the detail view (reloading the file).

          To implement this policy, the Browse procedure should be
          modified as the following:

    proc Browse {args} {
        global currentView

        set ent [tixEvent value]
        if {$ent == $currentView} {
            # We have already displayed the detailed view of $ent.
            #
            return
        } else {
            set currentView $ent
            DisplayDetail $ent
        }
    }

   [G.13] I get an error "can't read data(-value): no such element in
          array" when I use the tixExFileSelectDialog. 

          ANSWER: If you use tixExFileSelectDialog like this:

        tixExFileSelectDialog .f -command foo

        foo {filename} {
            destroy .f
            do some other stuff ...
        }

   it will cause a Tcl error because the dialog assumes that it still
          exists after calling your command. This usually result in
          errors like this:

        can't read "data(-value)": no such element in array
            while executing
        "set data(-selection) $data(-value)..."
            (procedure "tixComboBox::SetValue" line 30)

   This "feature" is built into many Tix widgets and can't be fixed
          easily. To work around the problem, never destroy widgets
          inside -command calls. Usually you should unmap toplevel
          windows instead. If you must destroy widgets, do it with an
          "after" command. For example, the foo procedure should be
          rewritten as:

        foo {filename} {
            wm withdraw .f
            do some other stuff ...

            after idle {if [winfo exists .f] {destroy .f}}
        }

   Execute the "after" command at the very end of the -command. Otherwise
          the idle handler may be activated by some "update" calls.

     _________________________________________________________________

  QUESTION ABOUT PORTING TO SPECIFIC PLATFORMS/SOFTWARE 

   [P.1] The configure script gave me strange errors. 

          ANSWER: The problem may be you have several operating systems
          sharing the same file system. Some people encounter error
          messages like this:

# ./configure --prefix=/usr/vendor/tcl
loading cache ./config.cache
checking for a BSD compatible install... /usr/bin/installbsd -c
checking for ranlib... ranlib
checking how to run the C preprocessor... cc -E
checking for unistd.h... ./configure[603]: "${ac_cv_header_$ac_safe+set}": bad
substitution

   The problem is at line 2, configure loaded in ./config.cache, which
          may have been created by a different operating system, with
          settings only usuable for that operating system. To get around
          this, you should type

make distclean
./configure
make all