Bwidget Source Code
Check-in [c3b144fc1f]
Not logged in
Bounty program for improvements to Tcl and certain Tcl packages.
Tcl 2019 Conference, Houston/TX, US, Nov 4-8
Send your abstracts to tclconference@googlegroups.com
or submit via the online form by Sep 9.

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

Overview
Comment: * tree.tcl [Bug 3106208]: Followup. Moved the fixed code of the last entry I did (2010-11-09) into a new command Tree::MergeFlag and call this from both Tree::itemconfigure and Tree::insert. Missing the place in Tree::insert caused another problem, found by Dustin Littau.
Timelines: family | ancestors | descendants | both | trunk | tcllib-1-13 | tcllib-1-14
Files: files | file ages | folders
SHA1:c3b144fc1f7c6f1fb20283aefa230f5eaca99dde
User & Date: andreas_kupries 2010-12-14 17:01:34
Context
2018-02-07
16:58
add support to msgcat -- closed because become invalid Closed-Leaf check-in: b19b621e2a user: pd tags: msgcat
2010-12-14
17:01
* tree.tcl [Bug 3106208]: Followup. Moved the fixed code of the last entry I did (2010-11-09) into a new command Tree::MergeFlag and call this from both Tree::itemconfigure and Tree::insert. Missing the place in Tree::insert caused another problem, found by Dustin Littau. Leaf check-in: c3b144fc1f user: andreas_kupries tags: trunk, tcllib-1-13, tcllib-1-14
2010-11-21
17:29
Dialog.html Removed documentation of unavailable option -buttonwidth. check-in: 7eee767759 user: oehhar tags: trunk
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to ChangeLog.

1
2
3
4
5
6






















7
8






9
10
11
12
13
14
15
# ------------------------------------------------------------------------------
#  ChangeLog
#  This file is part of Unifix BWidget Toolkit
#  $Id: ChangeLog,v 1.221 2010/11/21 17:29:07 oehhar Exp $
# ------------------------------------------------------------------------------























2010-11-16 Harald Oehlmann <oehhar@users.sourceforge.net>







	* Dialog.html Removed documentation of unavailable option -buttonwidth.

2010-11-09  Andreas Kupries  <andreask@activestate.com>

	* tree.tcl (Tree::itemconfigure): Fix intermingling of node names
	and flag values which can cause an lsearch to fail, by mistaking a
	flag value as the node searched for, and then treating a node name



|


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


>
>
>
>
>
>







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
# ------------------------------------------------------------------------------
#  ChangeLog
#  This file is part of Unifix BWidget Toolkit
#  $Id: ChangeLog,v 1.222 2010/12/14 17:01:34 andreas_kupries Exp $
# ------------------------------------------------------------------------------

2010-12-14  Andreas Kupries  <andreask@activestate.com>

	* tree.tcl [Bug 3106208]: Followup. Moved the fixed code of the
	last entry I did (2010-11-09) into a new command Tree::MergeFlag
	and call this from both Tree::itemconfigure and Tree::insert.
	Missing the place in Tree::insert caused another problem, found by
	Dustin Littau.

2010-11-05 Harald Oehlmann <oehhar@users.sourceforge.net>

	**** BWidget 1.9.3 tagged ****

2010-11-23 Harald Oehlmann <oehhar@users.sourceforge.net>

	* scrollw.tcl Add theming support for ScrolledWindow widget.
	* ScrolledWindow.html Themed mode documented.

2010-11-21 Harald Oehlmann <oehhar@users.sourceforge.net>

	* label.tcl Add theming support for Label widget.
	* label.html Themed mode documented.

2010-11-16 Harald Oehlmann <oehhar@users.sourceforge.net>

	* button.tcl Add theming support for Button widget.
	Option "-relief link" is mapped to "Toolbutton style.
	Option -height is not available when themed.
	Thanks to Kevin Walzer for the test on MacOS.
	* buttonbox.tcl When themed, only set themed button options.
	The widget itself is not jet themed.
	* Dialog.html Removed documentation of unavailable option -buttonwidth.

2010-11-09  Andreas Kupries  <andreask@activestate.com>

	* tree.tcl (Tree::itemconfigure): Fix intermingling of node names
	and flag values which can cause an lsearch to fail, by mistaking a
	flag value as the node searched for, and then treating a node name

Changes to tree.tcl.

1
2
3
4
5
6
7
8
9
10
11
...
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
...
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
# ----------------------------------------------------------------------------
#  tree.tcl
#  This file is part of Unifix BWidget Toolkit
#  $Id: tree.tcl,v 1.63 2010/11/10 07:57:58 oehhar Exp $
# ----------------------------------------------------------------------------
#  Index of commands:
#     - Tree::create
#     - Tree::configure
#     - Tree::cget
#     - Tree::insert
#     - Tree::itemconfigure
................................................................................
    } elseif { [visible $path $parent] } {
        # parent is visible...
        if { [Widget::getMegawidgetOption $path.$parent -open] } {
            # ...and opened -> redraw whole
            _redraw_idle $path 3
        } else {
            # ...and closed -> redraw cross
            lappend data(upd,nodes) $parent 8
            _redraw_idle $path 2
        }
    }

    return $node
}

................................................................................
        }

	if {$data(upd,level) < 3 && [Widget::hasChanged $path.$node -padx x]} {
	    _redraw_idle $path 3
	}

	if { $data(upd,level) < 3 && $flag } {
            # data(upd,nodes) is a key-val list: emulate a dict by an array
            array set n $data(upd,nodes)
            if {![info exists n($node)]} {
                lappend data(upd,nodes) $node $flag
            } else {
                set n($node) [expr {$n($node) | $flag}]
                set data(upd,nodes) [array get n]
            }
            _redraw_idle $path 2
        }
    }
    return $result
}
















# ----------------------------------------------------------------------------
#  Command Tree::itemcget
# ----------------------------------------------------------------------------
proc Tree::itemcget { path node option } {
    # Instead of upvar'ing $path as data for this test, just directly refer to
    # it, as that is faster.



|







 







|







 







|
<
<
<
<
<
<
<






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







1
2
3
4
5
6
7
8
9
10
11
...
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
...
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
# ----------------------------------------------------------------------------
#  tree.tcl
#  This file is part of Unifix BWidget Toolkit
#  $Id: tree.tcl,v 1.64 2010/12/14 17:01:34 andreas_kupries Exp $
# ----------------------------------------------------------------------------
#  Index of commands:
#     - Tree::create
#     - Tree::configure
#     - Tree::cget
#     - Tree::insert
#     - Tree::itemconfigure
................................................................................
    } elseif { [visible $path $parent] } {
        # parent is visible...
        if { [Widget::getMegawidgetOption $path.$parent -open] } {
            # ...and opened -> redraw whole
            _redraw_idle $path 3
        } else {
            # ...and closed -> redraw cross
	    MergeFlag $path $parent 8
            _redraw_idle $path 2
        }
    }

    return $node
}

................................................................................
        }

	if {$data(upd,level) < 3 && [Widget::hasChanged $path.$node -padx x]} {
	    _redraw_idle $path 3
	}

	if { $data(upd,level) < 3 && $flag } {
	    MergeFlag $path $node $flag







            _redraw_idle $path 2
        }
    }
    return $result
}

proc Tree::MergeFlag { path node flag } {
    variable $path
    upvar 0  $path data

    # data(upd,nodes) is a key-val list: emulate a dict by an array
    array set n $data(upd,nodes)
    if {![info exists n($node)]} {
	lappend data(upd,nodes) $node $flag
    } else {
	set n($node) [expr {$n($node) | $flag}]
	set data(upd,nodes) [array get n]
    }
    return
}

# ----------------------------------------------------------------------------
#  Command Tree::itemcget
# ----------------------------------------------------------------------------
proc Tree::itemcget { path node option } {
    # Instead of upvar'ing $path as data for this test, just directly refer to
    # it, as that is faster.