SR Technology WTK Repo
Check-in [5302f56b65]
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:Corrected error messages in focus. Made bind command correspond to Tk syntax and raise exceptions for not yet implemented features.
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 5302f56b65124edcf361ee54605100bf1d438fbf
User & Date: gerald 2013-01-19 08:25:35
Context
2013-01-19
08:27
Changed ensembles to map lower case subcommands to title case commands so that subcommands such as "info" do not interfere with core tcl commands. Note -- the definitions in grid.tcl will be overridden by whose in wtk-grid.tcl. The code in grid.tcl is not yet working. check-in: 6e66a11779 user: gerald tags: trunk
08:25
Corrected error messages in focus. Made bind command correspond to Tk syntax and raise exceptions for not yet implemented features. check-in: 5302f56b65 user: gerald tags: trunk
08:13
Corrected implementation of focus command to match that of tk. Most options "not implemented yet" errors at this time. check-in: 6fc5bc5029 user: gerald tags: trunk
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to commands/bind.tcl.



1





2




3
4
5


6
7















proc ::wtk::bind {w ev script} {
    return [$w _bind $ev $script]
}







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

|
>
>
>
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
##
## Partial implementation of focus
#
proc ::wtk::bind {w args} {
    _VerifyWindowExists $w
    switch -exact -- [llength $args] {
        0 {
            return  -code error  -level 1  -errorcode [list WTKNOTIMPYET bind query_for_events]  {[bind window] not yet implemented}
        }
        1 {
            return  -code error  -level 1  -errorcode [list WTKNOTIMPYET bind query_for_script]  {[bind window pattern] not yet implemented}
        }
        2 {
            lassign $args ev script
            return [$w _bind $ev $script]
        }
        default {
            return  -code error  -level 1  {wrong # args: should be "bind window ?pattern? ?command?"}

        }
    }
    return [$w _bind $ev $script]
}

Changes to commands/focus.tcl.

5
6
7
8
9
10
11

12
13
14
15
16
17
18
    if {![llength $args]} {
        set args [list  -displayof .]
    } elseif {[llength $args] > 2} {
        return \
            -code error \
            [format {bad option "%1$s": must be -displayof, -force, or -lastfor} [lindex $arg 0]]
    } elseif {[llength $args] == 1} {

        $args _focus
        return;
    }
    switch -exact -- [lindex $args 0] {
        -displayof {
            return  -code error  -level 1  -errorcode [list WTKNOTIMPYET focus -displayof]  {[focus -displayof] not yet implemented}
        }






>







5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
    if {![llength $args]} {
        set args [list  -displayof .]
    } elseif {[llength $args] > 2} {
        return \
            -code error \
            [format {bad option "%1$s": must be -displayof, -force, or -lastfor} [lindex $arg 0]]
    } elseif {[llength $args] == 1} {
        _VerifyWindowExists $args
        $args _focus
        return;
    }
    switch -exact -- [lindex $args 0] {
        -displayof {
            return  -code error  -level 1  -errorcode [list WTKNOTIMPYET focus -displayof]  {[focus -displayof] not yet implemented}
        }