Unnamed Fossil Project

Check-in [4563a23aa9]
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:a lot of new code and fixes for treeview
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1:4563a23aa9ac9db7c26daa89cc5c3bb265df1613
User & Date: arnulf 2013-09-15 09:24:56
Context
2013-09-15
11:56
new code for treeview check-in: cfbbd6aa79 user: arnulf tags: trunk
09:24
a lot of new code and fixes for treeview check-in: 4563a23aa9 user: arnulf tags: trunk
09:02
initial version check-in: 89bb55d932 user: arnulf tags: trunk
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to Makefile.

42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
PKG_STUB_OBJECTS = 

#========================================================================
# PKG_TCL_SOURCES identifies Tcl runtime files that are associated with
# this package that need to be installed, if any.
#========================================================================

PKG_TCL_SOURCES =  library/ntkBaseElement.tcl library/ntkBackgroundElement.tcl library/ntkBorderElement.tcl library/ntkButtonBorderElement.tcl library/ntkFieldElement.tcl library/ntkFillElement.tcl library/ntkFocusElement.tcl library/ntkDiamondIndicatorElement.tcl library/ntkHighlightElement.tcl library/ntkImageElement.tcl library/ntkIndicatorElement.tcl library/ntkLabelElement.tcl library/ntkMenuIndicatorElement.tcl library/ntkPaddingElement.tcl library/ntkSeparatorElement.tcl library/ntkSizegripElement.tcl library/ntkSquareIndicatorElement.tcl library/ntkTextElement.tcl library/ntkTextareaElement.tcl library/ntkArrowElement.tcl library/ntkDownarrowElement.tcl library/ntkUparrowElement.tcl library/ntkLeftarrowElement.tcl library/ntkRightarrowElement.tcl library/ntkTreeitemIndicatorElement.tcl library/ntkTreerowElement.tcl library/ntkTreeareaElement.tcl library/ntkTroughElement.tcl library/ntkThumbElement.tcl library/ntkSashElement.tcl library/ntkSliderElement.tcl library/ntkDebug.tcl library/ntkUtils.tcl library/ntkBorder.tcl library/ntkLayout.tcl library/ntkTButtonBase.tcl library/ntkTButton.tcl library/ntkButton.tcl library/ntkTEntryBase.tcl library/ntkTEntry.tcl library/ntkEntry.tcl library/ntkTScrollbarBase.tcl library/ntkTScrollbar.tcl library/ntkScrollbar.tcl library/ntkTFrameBase.tcl library/ntkTFrame.tcl library/ntkTLabelframe.tcl library/ntkFrame.tcl library/ntkTPanedwindow.tcl library/ntkTTreeview.tcl library/ntkTCombobox.tcl library/ntkTLabel.tcl library/ntkTCheckbutton.tcl library/ntkTRadiobutton.tcl library/ntkTMenubutton.tcl library/ntkWidgetInfo.tcl library/ntkWidget.tcl library/ntkInit.tcl library/ntkManager.tcl library/ntkTheme.tcl library/ntkElements.tcl library/ntkLabel.tcl library/ntkPanedwindow.tcl library/ntkTreeview.tcl library/ntkImage.tcl library/ntkAltTheme.tcl library/ntkClassicTheme.tcl library/ntkClamTheme.tcl library/ntkPack.tcl library/ntkBind.tcl library/ntkFocus.tcl library/ntkButtonBindings.tcl library/ntkGenerateEvent.tcl library/tclIndex themedntk.tcl

#========================================================================
# This is a list of public header files to be installed, if any.
#========================================================================

PKG_HEADERS	= 








|







42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
PKG_STUB_OBJECTS = 

#========================================================================
# PKG_TCL_SOURCES identifies Tcl runtime files that are associated with
# this package that need to be installed, if any.
#========================================================================

PKG_TCL_SOURCES =  library/ntkBaseElement.tcl library/ntkBackgroundElement.tcl library/ntkBorderElement.tcl library/ntkButtonBorderElement.tcl library/ntkFieldElement.tcl library/ntkFillElement.tcl library/ntkFocusElement.tcl library/ntkDiamondIndicatorElement.tcl library/ntkHighlightElement.tcl library/ntkImageElement.tcl library/ntkIndicatorElement.tcl library/ntkLabelElement.tcl library/ntkMenuIndicatorElement.tcl library/ntkPaddingElement.tcl library/ntkSeparatorElement.tcl library/ntkSizegripElement.tcl library/ntkSquareIndicatorElement.tcl library/ntkTextElement.tcl library/ntkTextareaElement.tcl library/ntkArrowElement.tcl library/ntkDownarrowElement.tcl library/ntkUparrowElement.tcl library/ntkLeftarrowElement.tcl library/ntkRightarrowElement.tcl library/ntkTreeitemIndicatorElement.tcl library/ntkTreerowElement.tcl library/ntkTreeareaElement.tcl library/ntkTroughElement.tcl library/ntkThumbElement.tcl library/ntkSashElement.tcl library/ntkSliderElement.tcl library/ntkDebug.tcl library/ntkUtils.tcl library/ntkBorder.tcl library/ntkLayout.tcl library/ntkTButtonBase.tcl library/ntkTButton.tcl library/ntkButton.tcl library/ntkTEntryBase.tcl library/ntkTEntry.tcl library/ntkEntry.tcl library/ntkTScrollbarBase.tcl library/ntkTScrollbar.tcl library/ntkScrollbar.tcl library/ntkScroll.tcl library/ntkTFrameBase.tcl library/ntkTFrame.tcl library/ntkTLabelframe.tcl library/ntkFrame.tcl library/ntkTPanedwindow.tcl library/ntkTTreeview.tcl library/ntkTCombobox.tcl library/ntkTLabel.tcl library/ntkTCheckbutton.tcl library/ntkTRadiobutton.tcl library/ntkTMenubutton.tcl library/ntkWidgetInfo.tcl library/ntkWidget.tcl library/ntkInit.tcl library/ntkManager.tcl library/ntkTheme.tcl library/ntkElements.tcl library/ntkLabel.tcl library/ntkPanedwindow.tcl library/ntkTreeview.tcl library/ntkImage.tcl library/ntkAltTheme.tcl library/ntkClassicTheme.tcl library/ntkClamTheme.tcl library/ntkPack.tcl library/ntkBind.tcl library/ntkFocus.tcl library/ntkButtonBindings.tcl library/ntkGenerateEvent.tcl library/tclIndex themedntk.tcl

#========================================================================
# This is a list of public header files to be installed, if any.
#========================================================================

PKG_HEADERS	= 

Changes to configure.in.

118
119
120
121
122
123
124

125
126
127
128
129
130
131
library/ntkButton.tcl
library/ntkTEntryBase.tcl
library/ntkTEntry.tcl
library/ntkEntry.tcl
library/ntkTScrollbarBase.tcl
library/ntkTScrollbar.tcl
library/ntkScrollbar.tcl

library/ntkTFrameBase.tcl
library/ntkTFrame.tcl
library/ntkTLabelframe.tcl
library/ntkFrame.tcl
library/ntkTPanedwindow.tcl
library/ntkTTreeview.tcl
library/ntkTCombobox.tcl







>







118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
library/ntkButton.tcl
library/ntkTEntryBase.tcl
library/ntkTEntry.tcl
library/ntkEntry.tcl
library/ntkTScrollbarBase.tcl
library/ntkTScrollbar.tcl
library/ntkScrollbar.tcl
library/ntkScroll.tcl
library/ntkTFrameBase.tcl
library/ntkTFrame.tcl
library/ntkTLabelframe.tcl
library/ntkFrame.tcl
library/ntkTPanedwindow.tcl
library/ntkTTreeview.tcl
library/ntkTCombobox.tcl

Changes to library/ntkImageElement.tcl.

15
16
17
18
19
20
21
22








23
24
25
26
27
28
29
#--------------------------------------------------------------------------

namespace eval ::ntk::classes {

::itcl::extendedclass ImageElement {
    inherit baseElement utils

    source defaultImageElementOptions.tcl









    public method InitializeOptionValues {styleName tkwin state}
    public method imageElementConfigure {option value}
    public method ElementSize {widthVar heightVar paddingVar}
    public method ElementDraw {box state}
}








|
>
>
>
>
>
>
>
>







15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
#--------------------------------------------------------------------------

namespace eval ::ntk::classes {

::itcl::extendedclass ImageElement {
    inherit baseElement utils

    protected option [list -image Image Image] \
            -default "" \
            -configuremethod labelElementConfigure
    protected option [list -stipple Stipple Stipple] \
            -default grey50 \
            -configuremethod labelElementConfigure
    protected option [list -background Background Background] \
            -default "#d9d9d9"  \
            -configuremethod labelElementConfigure

    public method InitializeOptionValues {styleName tkwin state}
    public method imageElementConfigure {option value}
    public method ElementSize {widthVar heightVar paddingVar}
    public method ElementDraw {box state}
}

Changes to library/ntkScroll.tcl.

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
#---------------------------------------------------------------------------
# ntkWidget ntkPack.tcl --
#
# This file contains a ntkWidget Pack commands implementation
#
# this code is derived from the tile/ttk implementation written by
# Joe English
#
# Copyright (c) 2007-2013 by Arnulf P. Wiedemann
#
# See the file "license.terms" for information on usage and redistribution of
# this file, and for a DISCLAIMER OF ALL WARRANTIES.
#
# @(#) $Id: ntkPack.tcl
#--------------------------------------------------------------------------

namespace eval ::ntk::classes {

::itcl::extendedclass ntkpack {
   public proc pack {args}
}

::itcl::body ntkpack::pack {args} {

puts stderr "pack pack!$args!"











}

} ; # end namespace ::ntk::classes


|

|









|




|
|


|
>
|
>
>
>
>
>
>
>
>
>
>





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
#---------------------------------------------------------------------------
# ntkWidget ntkScroll.tcl --
#
# This file contains a ntkWidget Scroll commands implementation
#
# this code is derived from the tile/ttk implementation written by
# Joe English
#
# Copyright (c) 2007-2013 by Arnulf P. Wiedemann
#
# See the file "license.terms" for information on usage and redistribution of
# this file, and for a DISCLAIMER OF ALL WARRANTIES.
#
# @(#) $Id: ntkScroll.tcl
#--------------------------------------------------------------------------

namespace eval ::ntk::classes {

::itcl::extendedclass scroll {
   public proc CreateScrollHandle {args}
}

::itcl::body scroll::CreateScrollHandle {corePtr scrollVar} {
    upvar $scrollVar scrollable
puts stderr "scroll CreateScrollHandle!"
    set scrollable [dict create]
    dict set scrollable first 0
    dict set scrollable last 1
    dict set scrollable total 1
    set scrollHandle [dict create]
    dict set scrollHandle flags ""
    dict set scrollHandle core $corePtr
    dict set scrollHandle scrollPtr $scrollable

    return $scrollable

}

} ; # end namespace ::ntk::classes

Changes to library/ntkTEntryBase.tcl.

13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
..
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
...
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
#
# @(#) $Id: ntkTEntryBase.tcl
#--------------------------------------------------------------------------

namespace eval ::ntk::classes {

::itcl::extendedclass tentryBase {
    inherit widget utils

    private variable entryEventMask [list FocusChange]

    protected variable entry

    public option [list -exportselection exportSelection] -default 1
    public option [list -font font Font] -default Vera
................................................................................
    private method EntryStoreValue {value}
    private method EntrySetValue {value}
    private method InsertChars {index value}
    private method PointToChar {textLayout x val}
    private method EntryCharPosition {index}
    private method EntryEditable {}

    protected method CreateScrollHandle {args}

    public method EntryBBoxCommand {args}
    public method EntryDeleteCommand {args}
    public method EntryGetCommand {args}
    public method EntryICursorCommand {args}
    public method EntryIndex {idx indexVar}
    public method EntryIndexCommand {args}
    public method EntryInsertCommand {args}
................................................................................
    set entry [dict create]
    dict set entry string ""
    dict set entry displayString ""
    dict set entry textVariableTrace 0
    dict set entry textVariable ""
    dict set entry numBytes 0
    dict set entry numChars 0
    dict set entry xscroll [dict create]
    dict set entry xscroll first -1
    dict set entry xscroll last -1
    dict set entry xscrollHandle [CreateScrollHandle]
    dict set entry insertPos 0
    dict set entry selectFirst -1
    dict set entry selectLast -1
    dict set entry showChar ""
    dict set entry exportSelection 1
    dict set entry textLayout ""
    dict set entry textX 0







|







 







<
<







 







<
<
|
|







13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
..
63
64
65
66
67
68
69


70
71
72
73
74
75
76
...
169
170
171
172
173
174
175


176
177
178
179
180
181
182
183
184
#
# @(#) $Id: ntkTEntryBase.tcl
#--------------------------------------------------------------------------

namespace eval ::ntk::classes {

::itcl::extendedclass tentryBase {
    inherit widget utils scroll

    private variable entryEventMask [list FocusChange]

    protected variable entry

    public option [list -exportselection exportSelection] -default 1
    public option [list -font font Font] -default Vera
................................................................................
    private method EntryStoreValue {value}
    private method EntrySetValue {value}
    private method InsertChars {index value}
    private method PointToChar {textLayout x val}
    private method EntryCharPosition {index}
    private method EntryEditable {}



    public method EntryBBoxCommand {args}
    public method EntryDeleteCommand {args}
    public method EntryGetCommand {args}
    public method EntryICursorCommand {args}
    public method EntryIndex {idx indexVar}
    public method EntryIndexCommand {args}
    public method EntryInsertCommand {args}
................................................................................
    set entry [dict create]
    dict set entry string ""
    dict set entry displayString ""
    dict set entry textVariableTrace 0
    dict set entry textVariable ""
    dict set entry numBytes 0
    dict set entry numChars 0


    dict set entry xscrollHandle [CreateScrollHandle $core xscroll]
    dict set entry xscrollHandle xscroll $xscroll
    dict set entry insertPos 0
    dict set entry selectFirst -1
    dict set entry selectLast -1
    dict set entry showChar ""
    dict set entry exportSelection 1
    dict set entry textLayout ""
    dict set entry textX 0

Changes to library/ntkTTreeview.tcl.

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
...
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
#
# @(#) $Id: ntkTTreeview.tcl
#--------------------------------------------------------------------------

namespace eval ::ntk {

::itcl::extendedclass treeview {
    inherit classes::widget classes::utils

    protected variable treeview

    public option [list -columns columns Columns] -default ""
    public option [list -displaycolumns displayColumns DisplayColumns] -default "#all"
    public option [list -show show Show] -default "tree headings"
    public option [list -selectmode selectMode SelectMode] -default "extended"
    public option [list -height height Height] -default 10
    public option [list -padding padding Padding] -default [list 0 0 0 0]
    public option [list -xscrollcommand xScrollCommand ScrollCommand] -default ""
    public option [list -yscrollcommand yScrollCommand ScrollCommand] -default ""

    constructor {args} {}


    public method TreeviewInitialize {recordPtr}
    public method TreeviewCleanup {args}
    public method TreeviewPostConfigure {recordPtr mask}



    public method TreeviewConfigure {args}



    public method TreeviewGetLayout {theme recordPtr}
    public method TreeviewSize {recordPtr widthVar heightVar}
    public method TreeviewDoLayout {recordPtr}
    public method TreeviewDisplay {}

    public method TreeviewBBoxCommand {args} 
    public method TreeviewChildrenCommand {args} 
................................................................................
    dict set widgetSpec postConfigureProc TreeviewPostConfigure
    dict set widgetSpec getLayoutProc TreeviewGetLayout
    dict set widgetSpec sizeProc TreeviewSize
    dict set widgetSpec layoutProc TreeviewDoLayout
    dict set widgetSpec displayProc TreeviewDisplay
    dict set core widgetSpec $widgetSpec
    
    set treeview [dict create]

    WidgetInit $args

    dict set core takeFocus 1
}




















































#================================ TreeviewInitialize ============================
#     Initialization hooks.
#=========================================================================

::itcl::body treeview::TreeviewInitialize {recordPtr} {
puts stderr "TreeviewInitialize!"














}
















































#================================ TreeviewCleanup ============================
#     Cleanup hooks.
#=========================================================================

::itcl::body treeview::TreeviewCleanup {recordPtr} {
}

































#================================ TreeviewConfigure ============================


#     


#=========================================================================

::itcl::body treeview::TreeviewConfigure {recordPtr mask} {
puts stderr "TreeviewConfigure!$mask!"




















    CoreConfigure $mask





}

#================================ TreeviewPostConfigure ============================
#     Post-configuration hook.
#=========================================================================

::itcl::body treeview::TreeviewPostConfigure {recordPtr mask} {
#puts stderr "TreeviewPostConfigure!$mask!"
}
















#================================ TreeviewGetLayout ============================
# Layout management hooks.
#=========================================================================

::itcl::body treeview::TreeviewGetLayout {theme recordPtr} {
puts stderr "TreeviewGetLayout!$theme!"
# FIXME !!! Temporary
    return [WidgetGetLayout $theme $recordPtr]





































}

#================================ TreeviewSize ============================
# TreeviewSize --
#=========================================================================

::itcl::body treeview::TreeviewSize {recordPtr widthVar heightVar} {







|

|












>


|
>
>
>

>
>
>







 







|






>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>






>
>
>
>
>
>
>
>

>
>
>
>
>
|
>
>
>
>
>
>
>

>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>







>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>

>
>
|
>
>




>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>

>
>
>
>
>









>
>
>
>
>
>
>
>
>
>
>
>
>
>
>







<
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>







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
...
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
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397

398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
#
# @(#) $Id: ntkTTreeview.tcl
#--------------------------------------------------------------------------

namespace eval ::ntk {

::itcl::extendedclass treeview {
    inherit classes::widget classes::utils classes::scroll

    protected variable tree

    public option [list -columns columns Columns] -default ""
    public option [list -displaycolumns displayColumns DisplayColumns] -default "#all"
    public option [list -show show Show] -default "tree headings"
    public option [list -selectmode selectMode SelectMode] -default "extended"
    public option [list -height height Height] -default 10
    public option [list -padding padding Padding] -default [list 0 0 0 0]
    public option [list -xscrollcommand xScrollCommand ScrollCommand] -default ""
    public option [list -yscrollcommand yScrollCommand ScrollCommand] -default ""

    constructor {args} {}

    private method InitColumn {columnVar}
    public method TreeviewInitialize {recordPtr}
    public method TreeviewCleanup {args}
    private method TreeviewInitColumns {}
    private method TreeviewInitDisplayColumns {}
    private method ScrollbarUpdateRequired {scrollHandle}
    private method RecomputeSlack {recordPtr}
    public method TreeviewConfigure {args}
    public method TreeviewPostConfigure {recordPtr mask}
    private method NewItem {}
    private method GetSublayout {theme parentLayout layoutName optionTable layoutVar}
    public method TreeviewGetLayout {theme recordPtr}
    public method TreeviewSize {recordPtr widthVar heightVar}
    public method TreeviewDoLayout {recordPtr}
    public method TreeviewDisplay {}

    public method TreeviewBBoxCommand {args} 
    public method TreeviewChildrenCommand {args} 
................................................................................
    dict set widgetSpec postConfigureProc TreeviewPostConfigure
    dict set widgetSpec getLayoutProc TreeviewGetLayout
    dict set widgetSpec sizeProc TreeviewSize
    dict set widgetSpec layoutProc TreeviewDoLayout
    dict set widgetSpec displayProc TreeviewDisplay
    dict set core widgetSpec $widgetSpec
    
    set tree [dict create]

    WidgetInit $args

    dict set core takeFocus 1
}

#================================ InitColumn ============================
# 
#=========================================================================

::itcl::body treeview::InitColumn {columnVar} {
    upvar $columnVar column
puts stderr "InitColumn!"
    set column [dict create]
    dict set column width 200
    dict set column minWidth 20
    dict set column stretch 1
    dict set column idObj ""
    dict set column anchorObj ""

    dict set column headingState ""
    dict set column headingObj ""
    dict set column headingImageObj ""
    dict set column headingAnchorObj ""
    dict set column headingStateObj ""
    dict set column headingCommandObj ""

    dict set column data 0
}

#================================ NewItem ============================
# NewItem --
#     Allocate a new, uninitialized, unlinked item
#=========================================================================

::itcl::body treeview::NewItem {} {
puts stderr "NewItem!"
set item [dict create]
    dict set item entryPtr 0
    dict set item parent ""
    dict set item children ""
    dict set item next ""
    dict set item prev ""

    dict set item state  0
    dict set item textObj ""
    dict set item imageObj ""
    dict set item valuesObj ""
    dict set item openObj ""
    dict set item tagsObj ""

    dict set item tagset ""
    dict set item imagespec ""

    return $item
}

#================================ TreeviewInitialize ============================
#     Initialization hooks.
#=========================================================================

::itcl::body treeview::TreeviewInitialize {recordPtr} {
puts stderr "TreeviewInitialize!"
#    tv->tree.itemOptionTable = Tk_CreateOptionTable(interp, ItemOptionSpecs);
#    tv->tree.columnOptionTable = Tk_CreateOptionTable(interp, ColumnOptionSpecs);
#    tv->tree.headingOptionTable = Tk_CreateOptionTable(interp, HeadingOptionSpecs);
#    tv->tree.tagOptionTable = Tk_CreateOptionTable(interp, TagOptionSpecs);
     dict set tree itemOptionTable [dict create]
     dict set tree columnOptionTable [dict create]
     dict set tree headingOptionTable [dict create]
     dict set tree tagOptionTable [dict create]

#    tv->tree.tagTable = CreateTagTable( tv->core.tkwin, TagOptionSpecs, sizeof(DisplayItem));
#    tv->tree.bindingTable = Tk_CreateBindingTable(interp);
#    Tk_CreateEventHandler(tv->core.tkwin, TreeviewBindEventMask, TreeviewBindEventProc, tv);
     dict set tree tagTable [dict create]
     dict set tree bindingTable [dict create]

    dict set tree itemLayout 0
    dict set tree cellLayout 0
    dict set tree headingLayout 0
    dict set tree rowLayout 0
    dict set tree headingHeight 20
    dict set tree rowHeight 20
    dict set tree indent 20

    dict set tree columnNames [dict create]
    dict set tree nColumns 0
    dict set tree nDisplayColumns 0
    dict set tree columns ""
    dict set tree displayColumns ""
    dict set tree showFlags ""

    InitColumn column0
    dict set tree column0 $column0
#    Tk_InitOptions( interp, (ClientData)(&tv->tree.column0), tv->tree.columnOptionTable, tv->core.tkwin);
#    Tk_InitOptions( interp, (ClientData)(&tv->tree.column0), tv->tree.headingOptionTable, tv->core.tkwin);

    dict set tree items [dict create]
    dict set tree serial 0

    dict set tree focus 0
    dict set tree endPtr ""

    # Create root item "":

    dict set tree root [NewItem]
#    Tk_InitOptions(interp, (ClientData)tv->tree.root, tv->tree.itemOptionTable, tv->core.tkwin);
    dict set tree root tagset [list]
    dict set tree root entryPtr [dict get $tree root]

    # Scroll handles:

    dict set tree xscrollHandle [CreateScrollHandle $core xscroll]
    dict set tree xscrollHandle xscroll $xscroll
    dict set tree yscrollHandle [CreateScrollHandle $core yscroll]
    dict set tree yscrollHandle yscroll $yscroll

    # Size parameters:

    dict set tree treeArea [list 0 0 0 0]
    dict set tree headingArea [list 0 0 0 0]
    dict set tree slack 0

}

#================================ TreeviewCleanup ============================
#     Cleanup hooks.
#=========================================================================

::itcl::body treeview::TreeviewCleanup {recordPtr} {
}

#================================ TreeviewInitColumns ============================
# 
#=========================================================================

::itcl::body treeview::TreeviewInitColumns {} {
puts stderr "TreeviewInitColumns!"
}

#================================ TreeviewInitDisplayColumns ============================
# 
#=========================================================================

::itcl::body treeview::TreeviewInitDisplayColumns {} {
puts stderr "TreeviewInitDisplayColumns!"
}

#================================ ScrollbarUpdateRequired ============================
# 
#=========================================================================

::itcl::body treeview::ScrollbarUpdateRequired {scrollHandle} {
puts stderr "ScrollbarUpdateRequired!"
}

#================================ RecomputeSlack ============================
# 
#=========================================================================

::itcl::body treeview::RecomputeSlack {recordPtr} {
puts stderr "RecomputeSlack!"
}

#================================ TreeviewConfigure ============================
# TreeviewConfigure --
#     Configuration widget hook.
# 
#     BUG: If user sets -columns and -displaycolumns, but -displaycolumns
#     has an error, the widget is left in an inconsistent state.
#=========================================================================

::itcl::body treeview::TreeviewConfigure {recordPtr mask} {
puts stderr "TreeviewConfigure!$mask!"

    set showFlags [dict get $tree showFlags]
    if {[lsearch $mask columnsChanged] >= 0} {
        if {[TreeviewInitColumns] != TCL_OK} {
            return TCL_ERROR;
        }
        lappend mask dcolumnsChanged
    }
    if {[lsearch $mask dcolumnsChanged] >= 0} {
        if {[TreeviewInitDisplayColumns] != TCL_OK} {
            return TCL_ERROR;
        }
    }
    if {[lsearch $mask scrollcmdChanged] >= 0} {
        ScrollbarUpdateRequired [dict get $tree xscrollHandle]
        ScrollbarUpdateRequired [dict get $tree yscrollHandle]
    }
    if {[lsearch $mask showChanged] >= 0} {
        set showFlags [dict get $tree showObj showStrings]
    }
    CoreConfigure $mask
    dict set tree showFlags $showFlags

    if {[lsearch $mask show_changed] >= 0 || [lsearch $mask dcolumnsChanged] >= 0} {
        RecomputeSlack
    }
}

#================================ TreeviewPostConfigure ============================
#     Post-configuration hook.
#=========================================================================

::itcl::body treeview::TreeviewPostConfigure {recordPtr mask} {
#puts stderr "TreeviewPostConfigure!$mask!"
}

#================================ GetSublayout ============================
# GetSublayout --
#     Utility routine; acquires a sublayout for items, cells, etc.
#=========================================================================

::itcl::body treeview::GetSublayout {theme parentLayout layoutName optionTable layoutVar} {
    upvar $layoutVar layout
puts stderr "GetSublayout!"
    set newLayout [::ntk::classes::layout::CreateSubLayout $theme $parentLayout $core $layoutName $optionTable]
    if {$newLayout ne ""} {
        set layout $newLayout
    }
    return $newLayout
}

#================================ TreeviewGetLayout ============================
# Layout management hooks.
#=========================================================================

::itcl::body treeview::TreeviewGetLayout {theme recordPtr} {
puts stderr "TreeviewGetLayout!$theme!"

    set treeLayout [WidgetGetLayout $theme $recordPtr]
    if {$treeLayout eq ""} {
        return 0
    }
    set tagOptionTable [dict get $tree tagOptionTable]
    set itemLayout [dict get $tree itemLayout]
    if {[GetSublayout $theme $treeLayout ".Item" $tagOptionTable itemLayout] eq ""} {
        return 0
    }
    dict set tree itemLayout $itemLayout
    set cellLayout [dict get $tree cellLayout]
    if {[GetSublayout $theme $treeLayout ".Cell" $tagOptionTable cellLayout] eq ""} {
        return 0
    }
    dict set tree cellLayout $cellLayout
    set headingLayout [dict get $tree headingLayout]
    if {[GetSublayout $theme $treeLayout ".Heading" $tagOptionTable headingLayout] eq ""} {
        return 0
    }
    dict set tree headingLayout $headingLayout
    set rowLayout [dict get $tree rowLayout]
    if {[GetSublayout $theme $treeLayout ".Row" $tagOptionTable rowLayout] eq ""} {
        return 0
    }
    dict set tree rowLayout $rowLayout
    # Compute heading height.
    dict set tree headingLayout [dict get $tree column0]
    ::ntk::classes::layout::LayoutSize $headingLayout 0 unused [dict get $tree headingHeight]

    # Get item height, indent from style:
    # @@@ TODO: sanity-check.

    dict set tree rowHeight 20
    dict set tree indent 20
    dict set tree rowHeight 20
    dict set tree indent 20

    return $treeLayout
}

#================================ TreeviewSize ============================
# TreeviewSize --
#=========================================================================

::itcl::body treeview::TreeviewSize {recordPtr widthVar heightVar} {

Changes to library/ntkTextElement.tcl.

15
16
17
18
19
20
21
22



























23
24
25
26
27
28
29
#--------------------------------------------------------------------------

namespace eval ::ntk::classes {

::itcl::extendedclass TextElement {
    inherit baseElement utils

    source defaultTextElementOptions.tcl




























    public method InitializeOptionValues {styleName tkwin state}
    public method textElementConfigure {option value}
    public method ElementSize {widthVar heightVar paddingVar}
    public method ElementDraw {box state}
}








|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>







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
#--------------------------------------------------------------------------

namespace eval ::ntk::classes {

::itcl::extendedclass TextElement {
    inherit baseElement utils

    protected option [list -text Text Text] \
            -default "" \
            -configuremethod labelElementConfigure
    protected option [list -font Font Font] \
            -default Vera \
            -configuremethod labelElementConfigure
    protected option [list -foreground Foreground Foreground] \
            -default #000000 \
            -configuremethod labelElementConfigure
    protected option [list -underline Underline Underline] \
            -default -1 \
            -configuremethod labelElementConfigure
    protected option [list -width Width Width] \
            -default -1 \
            -configuremethod labelElementConfigure
    protected option [list -anchor Anchor Anchor] \
            -default w \
            -configuremethod labelElementConfigure
    protected option [list -justify Justify Justify] \
            -default left \
            -configuremethod labelElementConfigure
    protected option [list -wraplength wrapLength WrapLength] \
            -default 0 \
            -configuremethod labelElementConfigure
    protected option [list -embossed Embossed Embossed] \
            -default 0 \
            -configuremethod labelElementConfigure


    public method InitializeOptionValues {styleName tkwin state}
    public method textElementConfigure {option value}
    public method ElementSize {widthVar heightVar paddingVar}
    public method ElementDraw {box state}
}

Changes to library/tclIndex.

61
62
63
64
65
66
67


68
69




70
71

72
73
74
75
76
77
78
...
264
265
266
267
268
269
270



271
272
273
274
275
276
277
set auto_index(::ntk::classes::ButtonBorderElement::ElementDraw) [list source [file join $dir ntkButtonBorderElement.tcl]]
set auto_index(::ntk::classes::IndicatorElement) [list source [file join $dir ntkIndicatorElement.tcl]]
set auto_index(::ntk::classes::IndicatorElement::InitializeOptionValues) [list source [file join $dir ntkIndicatorElement.tcl]]
set auto_index(::ntk::classes::IndicatorElement::ElementSize) [list source [file join $dir ntkIndicatorElement.tcl]]
set auto_index(::ntk::classes::IndicatorElement::ElementDraw) [list source [file join $dir ntkIndicatorElement.tcl]]
set auto_index(::ntk::treeview) [list source [file join $dir ntkTTreeview.tcl]]
set auto_index(::ntk::treeview::constructor) [list source [file join $dir ntkTTreeview.tcl]]


set auto_index(::ntk::treeview::TreeviewInitialize) [list source [file join $dir ntkTTreeview.tcl]]
set auto_index(::ntk::treeview::TreeviewCleanup) [list source [file join $dir ntkTTreeview.tcl]]




set auto_index(::ntk::treeview::TreeviewConfigure) [list source [file join $dir ntkTTreeview.tcl]]
set auto_index(::ntk::treeview::TreeviewPostConfigure) [list source [file join $dir ntkTTreeview.tcl]]

set auto_index(::ntk::treeview::TreeviewGetLayout) [list source [file join $dir ntkTTreeview.tcl]]
set auto_index(::ntk::treeview::TreeviewSize) [list source [file join $dir ntkTTreeview.tcl]]
set auto_index(::ntk::treeview::TreeviewDoLayout) [list source [file join $dir ntkTTreeview.tcl]]
set auto_index(::ntk::treeview::TreeviewDisplay) [list source [file join $dir ntkTTreeview.tcl]]
set auto_index(::ntk::treeview::TreeviewBBoxCommand) [list source [file join $dir ntkTTreeview.tcl]]
set auto_index(::ntk::treeview::TreeviewChildrenCommand) [list source [file join $dir ntkTTreeview.tcl]]
set auto_index(::ntk::treeview::TreeviewColumnCommand) [list source [file join $dir ntkTTreeview.tcl]]
................................................................................
set auto_index(::ntk::classes::utils::GetElementPositions) [list source [file join $dir ntkUtils.tcl]]
set auto_index(::ntk::classes::utils::GetArrowPositions) [list source [file join $dir ntkUtils.tcl]]
set auto_index(::ntk::classes::utils::GetDiamondPositions) [list source [file join $dir ntkUtils.tcl]]
set auto_index(::ntk::classes::utils::BuildVertexInfo) [list source [file join $dir ntkUtils.tcl]]
set auto_index(::ntk::classes::image) [list source [file join $dir ntkImage.tcl]]
set auto_index(::ntk::classes::image::Image_Init) [list source [file join $dir ntkImage.tcl]]
set auto_index(::ntk::classes::image::Image_Init) [list source [file join $dir ntkImage.tcl]]



set auto_index(::ntk::classes::FocusElement) [list source [file join $dir ntkFocusElement.tcl]]
set auto_index(::ntk::classes::FocusElement::InitializeOptionValues) [list source [file join $dir ntkFocusElement.tcl]]
set auto_index(::ntk::classes::FocusElement::focusElementConfigure) [list source [file join $dir ntkFocusElement.tcl]]
set auto_index(::ntk::classes::FocusElement::ElementSize) [list source [file join $dir ntkFocusElement.tcl]]
set auto_index(::ntk::classes::FocusElement::ElementDraw) [list source [file join $dir ntkFocusElement.tcl]]
set auto_index(::ntk::classes::altTheme) [list source [file join $dir ntkAltTheme.tcl]]
set auto_index(::ntk::classes::altTheme::AltTheme_Init) [list source [file join $dir ntkAltTheme.tcl]]







>
>


>
>
>
>


>







 







>
>
>







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
...
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
set auto_index(::ntk::classes::ButtonBorderElement::ElementDraw) [list source [file join $dir ntkButtonBorderElement.tcl]]
set auto_index(::ntk::classes::IndicatorElement) [list source [file join $dir ntkIndicatorElement.tcl]]
set auto_index(::ntk::classes::IndicatorElement::InitializeOptionValues) [list source [file join $dir ntkIndicatorElement.tcl]]
set auto_index(::ntk::classes::IndicatorElement::ElementSize) [list source [file join $dir ntkIndicatorElement.tcl]]
set auto_index(::ntk::classes::IndicatorElement::ElementDraw) [list source [file join $dir ntkIndicatorElement.tcl]]
set auto_index(::ntk::treeview) [list source [file join $dir ntkTTreeview.tcl]]
set auto_index(::ntk::treeview::constructor) [list source [file join $dir ntkTTreeview.tcl]]
set auto_index(::ntk::treeview::InitColumn) [list source [file join $dir ntkTTreeview.tcl]]
set auto_index(::ntk::treeview::NewItem) [list source [file join $dir ntkTTreeview.tcl]]
set auto_index(::ntk::treeview::TreeviewInitialize) [list source [file join $dir ntkTTreeview.tcl]]
set auto_index(::ntk::treeview::TreeviewCleanup) [list source [file join $dir ntkTTreeview.tcl]]
set auto_index(::ntk::treeview::TreeviewInitColumns) [list source [file join $dir ntkTTreeview.tcl]]
set auto_index(::ntk::treeview::TreeviewInitDisplayColumns) [list source [file join $dir ntkTTreeview.tcl]]
set auto_index(::ntk::treeview::ScrollbarUpdateRequired) [list source [file join $dir ntkTTreeview.tcl]]
set auto_index(::ntk::treeview::RecomputeSlack) [list source [file join $dir ntkTTreeview.tcl]]
set auto_index(::ntk::treeview::TreeviewConfigure) [list source [file join $dir ntkTTreeview.tcl]]
set auto_index(::ntk::treeview::TreeviewPostConfigure) [list source [file join $dir ntkTTreeview.tcl]]
set auto_index(::ntk::treeview::GetSublayout) [list source [file join $dir ntkTTreeview.tcl]]
set auto_index(::ntk::treeview::TreeviewGetLayout) [list source [file join $dir ntkTTreeview.tcl]]
set auto_index(::ntk::treeview::TreeviewSize) [list source [file join $dir ntkTTreeview.tcl]]
set auto_index(::ntk::treeview::TreeviewDoLayout) [list source [file join $dir ntkTTreeview.tcl]]
set auto_index(::ntk::treeview::TreeviewDisplay) [list source [file join $dir ntkTTreeview.tcl]]
set auto_index(::ntk::treeview::TreeviewBBoxCommand) [list source [file join $dir ntkTTreeview.tcl]]
set auto_index(::ntk::treeview::TreeviewChildrenCommand) [list source [file join $dir ntkTTreeview.tcl]]
set auto_index(::ntk::treeview::TreeviewColumnCommand) [list source [file join $dir ntkTTreeview.tcl]]
................................................................................
set auto_index(::ntk::classes::utils::GetElementPositions) [list source [file join $dir ntkUtils.tcl]]
set auto_index(::ntk::classes::utils::GetArrowPositions) [list source [file join $dir ntkUtils.tcl]]
set auto_index(::ntk::classes::utils::GetDiamondPositions) [list source [file join $dir ntkUtils.tcl]]
set auto_index(::ntk::classes::utils::BuildVertexInfo) [list source [file join $dir ntkUtils.tcl]]
set auto_index(::ntk::classes::image) [list source [file join $dir ntkImage.tcl]]
set auto_index(::ntk::classes::image::Image_Init) [list source [file join $dir ntkImage.tcl]]
set auto_index(::ntk::classes::image::Image_Init) [list source [file join $dir ntkImage.tcl]]
set auto_index(::ntk::classes::scroll) [list source [file join $dir ntkScroll.tcl]]
set auto_index(::ntk::classes::scroll::CreateScrollHandle) [list source [file join $dir ntkScroll.tcl]]
set auto_index(::ntk::classes::scroll::CreateScrollHandle) [list source [file join $dir ntkScroll.tcl]]
set auto_index(::ntk::classes::FocusElement) [list source [file join $dir ntkFocusElement.tcl]]
set auto_index(::ntk::classes::FocusElement::InitializeOptionValues) [list source [file join $dir ntkFocusElement.tcl]]
set auto_index(::ntk::classes::FocusElement::focusElementConfigure) [list source [file join $dir ntkFocusElement.tcl]]
set auto_index(::ntk::classes::FocusElement::ElementSize) [list source [file join $dir ntkFocusElement.tcl]]
set auto_index(::ntk::classes::FocusElement::ElementDraw) [list source [file join $dir ntkFocusElement.tcl]]
set auto_index(::ntk::classes::altTheme) [list source [file join $dir ntkAltTheme.tcl]]
set auto_index(::ntk::classes::altTheme::AltTheme_Init) [list source [file join $dir ntkAltTheme.tcl]]

Changes to themedntk.tcl.

5
6
7
8
9
10
11

12
13
14
15
16
17
18
..
23
24
25
26
27
28
29

30
31
32
33
34
35
36
37
38
39
40
    source [file join $myDir library ntkTheme.tcl]
    source [file join $myDir library ntkElements.tcl]
    source [file join $myDir library ntkLabel.tcl]
    source [file join $myDir library ntkImage.tcl]
    source [file join $myDir library ntkButton.tcl]
    source [file join $myDir library ntkEntry.tcl]
    source [file join $myDir library ntkScrollbar.tcl]

    source [file join $myDir library ntkFrame.tcl]
    source [file join $myDir library ntkPanedwindow.tcl]
    source [file join $myDir library ntkTreeview.tcl]
    source [file join $myDir library ntkAltTheme.tcl]
    source [file join $myDir library ntkClassicTheme.tcl]
    source [file join $myDir library ntkClamTheme.tcl]
    source [file join $myDir library ntkLayout.tcl]
................................................................................
    source [file join $myDir ntkTheme.tcl]
    source [file join $myDir ntkElements.tcl]
    source [file join $myDir ntkLabel.tcl]
    source [file join $myDir ntkImage.tcl]
    source [file join $myDir ntkButton.tcl]
    source [file join $myDir ntkEntry.tcl]
    source [file join $myDir ntkScrollbar.tcl]

    source [file join $myDir ntkFrame.tcl]
    source [file join $myDir ntkPanedwindow.tcl]
    source [file join $myDir ntkTreeview.tcl]
    source [file join $myDir ntkAltTheme.tcl]
    source [file join $myDir ntkClassicTheme.tcl]
    source [file join $myDir ntkClamTheme.tcl]
    source [file join $myDir ntkLayout.tcl]
    source [file join $myDir ntkBind.tcl]
    source [file join $myDir ntkButtonBindings.tcl]
}
::ntk::classes::init::init







>







 







>











5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
..
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
    source [file join $myDir library ntkTheme.tcl]
    source [file join $myDir library ntkElements.tcl]
    source [file join $myDir library ntkLabel.tcl]
    source [file join $myDir library ntkImage.tcl]
    source [file join $myDir library ntkButton.tcl]
    source [file join $myDir library ntkEntry.tcl]
    source [file join $myDir library ntkScrollbar.tcl]
    source [file join $myDir library ntkScroll.tcl]
    source [file join $myDir library ntkFrame.tcl]
    source [file join $myDir library ntkPanedwindow.tcl]
    source [file join $myDir library ntkTreeview.tcl]
    source [file join $myDir library ntkAltTheme.tcl]
    source [file join $myDir library ntkClassicTheme.tcl]
    source [file join $myDir library ntkClamTheme.tcl]
    source [file join $myDir library ntkLayout.tcl]
................................................................................
    source [file join $myDir ntkTheme.tcl]
    source [file join $myDir ntkElements.tcl]
    source [file join $myDir ntkLabel.tcl]
    source [file join $myDir ntkImage.tcl]
    source [file join $myDir ntkButton.tcl]
    source [file join $myDir ntkEntry.tcl]
    source [file join $myDir ntkScrollbar.tcl]
    source [file join $myDir ntkScroll.tcl]
    source [file join $myDir ntkFrame.tcl]
    source [file join $myDir ntkPanedwindow.tcl]
    source [file join $myDir ntkTreeview.tcl]
    source [file join $myDir ntkAltTheme.tcl]
    source [file join $myDir ntkClassicTheme.tcl]
    source [file join $myDir ntkClamTheme.tcl]
    source [file join $myDir ntkLayout.tcl]
    source [file join $myDir ntkBind.tcl]
    source [file join $myDir ntkButtonBindings.tcl]
}
::ntk::classes::init::init