Tk Source Code

Check-in [877bea7a]
Login
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:Avoid errors when a menu is destroyed before its postcommand is run.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | bug-70e531918e
Files: files | file ages | folders
SHA3-256: 877bea7a983db2fae83b011b67f5231e7256ffc984260e2b2257ce55b07913b8
User & Date: culler 2019-01-13 16:43:19
Context
2019-01-13
18:02
Add TkpPostTearoffMenu, called by TkPostTearoffMenu and used in the menu post command; eliminates #ifdef in the generic code. check-in: 0f8ee94e user: culler tags: bug-70e531918e
16:43
Avoid errors when a menu is destroyed before its postcommand is run. check-in: 877bea7a user: culler tags: bug-70e531918e
2019-01-11
21:47
Fix related menubutton issues on linux and Windows. check-in: 63fef3c5 user: culler tags: bug-70e531918e
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to library/menu.tcl.

489
490
491
492
493
494
495


496
497
498
499
500
501
502
503
504
505
506
507
        if {[info exists Priv(menuActivated)] \
                && $index ne "none" \
                && $index ne $activeindex} {
            set mode [option get $menu clickToFocus ClickToFocus]
            if {[string is false $mode]} {
                set delay [expr {[$menu cget -type] eq "menubar" ? 0 : 50}]
                if {[$menu type $index] eq "cascade"} {


                    set Priv(menuActivatedTimer) \
                        [after $delay [list $menu postcascade active]]
                } else {
                    set Priv(menuDeactivatedTimer) \
                        [after $delay [list $menu postcascade none]]
                }
            }
        }
    }
}

# ::tk::MenuButtonDown --






>
>

|


|







489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
        if {[info exists Priv(menuActivated)] \
                && $index ne "none" \
                && $index ne $activeindex} {
            set mode [option get $menu clickToFocus ClickToFocus]
            if {[string is false $mode]} {
                set delay [expr {[$menu cget -type] eq "menubar" ? 0 : 50}]
                if {[$menu type $index] eq "cascade"} {
                    # Catch these postcascade commands since the menu could be
                    # destroyed before they run.
                    set Priv(menuActivatedTimer) \
                        [after $delay "catch {$menu postcascade active}"]
                } else {
                    set Priv(menuDeactivatedTimer) \
                        [after $delay "catch {$menu postcascade none}"]
                }
            }
        }
    }
}

# ::tk::MenuButtonDown --