Bwidget Source Code
Check-in [f3f827b7ac]
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 [email protected]
or submit via the online form by Sep 9.

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

Overview
Comment:Replaced the boolean test function with a more efficient one.
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: f3f827b7ace0b14172f0cb80d6cf9aaccfd2766b
User & Date: ericm 2000-02-23 19:22:25
Context
2000-02-24
00:04
Changed bwinclude ... "" to bwinclude ... :cmd so that reverse mappings work. check-in: 5a57a30f89 user: ericm tags: trunk
2000-02-23
19:22
Replaced the boolean test function with a more efficient one. check-in: f3f827b7ac user: ericm tags: trunk
19:18
Added some comments about the internal structure. check-in: f331cf83b2 user: ericm tags: trunk
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to widget.tcl.

1
2
3
4
5
6
7
8
9
10
11
...
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
# ------------------------------------------------------------------------------
#  widget.tcl
#  This file is part of Unifix BWidget Toolkit
#  $Id: widget.tcl,v 1.3 2000/02/23 19:18:22 ericm Exp $
# ------------------------------------------------------------------------------
#  Index of commands:
#     - Widget::tkinclude
#     - Widget::bwinclude
#     - Widget::declare
#     - Widget::addmap
#     - Widget::init
................................................................................
}


# ------------------------------------------------------------------------------
#  Command Widget::_test_boolean
# ------------------------------------------------------------------------------
proc Widget::_test_boolean { option value arg } {
    if { $value == 1 ||
         ![string compare $value "true"] ||
         ![string compare $value "yes"] } {
        set value 1
    } elseif { $value == 0 ||
               ![string compare $value "false"] ||
               ![string compare $value "no"] } {
        set value 0
    } else {
        return -code error "bad [string range $option 1 end] value \"$value\": must be boolean"
    }
    return $value
}


# ------------------------------------------------------------------------------
#  Command Widget::focusNext
#  Same as tk_focusNext, but call Widget::focusOK
# ------------------------------------------------------------------------------


|







 







|
<
<
<
<
<
<
<
<
|

|







1
2
3
4
5
6
7
8
9
10
11
...
843
844
845
846
847
848
849
850








851
852
853
854
855
856
857
858
859
860
# ------------------------------------------------------------------------------
#  widget.tcl
#  This file is part of Unifix BWidget Toolkit
#  $Id: widget.tcl,v 1.4 2000/02/23 19:22:25 ericm Exp $
# ------------------------------------------------------------------------------
#  Index of commands:
#     - Widget::tkinclude
#     - Widget::bwinclude
#     - Widget::declare
#     - Widget::addmap
#     - Widget::init
................................................................................
}


# ------------------------------------------------------------------------------
#  Command Widget::_test_boolean
# ------------------------------------------------------------------------------
proc Widget::_test_boolean { option value arg } {
    if { ![string is boolean $value] } {








        return -code error "bad $option value \"$value\": must be boolean"
    }
    return [expr {$value}]
}


# ------------------------------------------------------------------------------
#  Command Widget::focusNext
#  Same as tk_focusNext, but call Widget::focusOK
# ------------------------------------------------------------------------------