Eskil

Check-in [963da4b53d]
Login

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

Overview
Comment:Better handling of extra events in Balloon Help
Downloads: Tarball | ZIP archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256: 963da4b53d266c2a42905d408bc4d8919e916ef848f1bebc62847ba0a2a3071b
User & Date: peter 2020-06-25 12:48:03.507
Context
2020-09-02
12:33
Fixed bug where copy context menu used the wrong key. check-in: e7d99aa232 user: peter tags: trunk
2020-06-25
12:48
Better handling of extra events in Balloon Help check-in: 963da4b53d user: peter tags: trunk
2020-05-07
14:39
Renamed plugin to gz. check-in: 727de749d3 user: peter tags: trunk
Changes
Unified Diff Ignore Whitespace Patch
Changes to eskil.vfs/lib/psballoon/pkgIndex.tcl.
1
2
3
4
5
6
7
8
9
10
11
# Tcl package index file, version 1.1
# This file is generated by the "pkg_mkIndex" command
# and sourced either when an application starts up or
# by a "package unknown" script.  It invokes the
# "package ifneeded" command to set up package-related
# information so that packages will be loaded automatically
# in response to "package require" commands.  When this
# script is sourced, the variable $dir must contain the
# full path name of this file's directory.

package ifneeded psballoon 1.0 [list source [file join $dir psballoon.tcl]]










|
1
2
3
4
5
6
7
8
9
10
11
# Tcl package index file, version 1.1
# This file is generated by the "pkg_mkIndex" command
# and sourced either when an application starts up or
# by a "package unknown" script.  It invokes the
# "package ifneeded" command to set up package-related
# information so that packages will be loaded automatically
# in response to "package require" commands.  When this
# script is sourced, the variable $dir must contain the
# full path name of this file's directory.

package ifneeded psballoon 1.1 [list source [file join $dir psballoon.tcl]]
Changes to eskil.vfs/lib/psballoon/psballoon.tcl.
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#  Permission is granted to use this code under the same terms as
#  for the Tcl core code.
#
#----------------------------------------------------------------------
# $Revision: 1.1 $
#----------------------------------------------------------------------

package provide psballoon 1.0

namespace eval psballoon {
    variable balloon

    set balloon(pending) 0
    set balloon(created) 0
    set balloon(id) ""







|







9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#  Permission is granted to use this code under the same terms as
#  for the Tcl core code.
#
#----------------------------------------------------------------------
# $Revision: 1.1 $
#----------------------------------------------------------------------

package provide psballoon 1.1

namespace eval psballoon {
    variable balloon

    set balloon(pending) 0
    set balloon(created) 0
    set balloon(id) ""
76
77
78
79
80
81
82


83
84
85
86
87
88
89
90
91
92
93
94
95







96
97


98
99
100
101
102
103
104
    if {$msg == "" && $c != "Listbox" && $c != "Label"} {
        error "Missing message to balloon for $W ($c)"
    }
    set balloon(msg,$W) $msg
    bind $W <Enter> {
        set ::psballoon::balloon(pending) 1
        set ::psballoon::balloon(created) 0


        set ::psballoon::balloon(id) [after 500 {psballoon::createBalloon %W %x %y}]
    }
    bind $W <Button> {
        psballoon::killBalloon
    }
    bind $W <Leave> {
        psballoon::killBalloon
    }
    bind $W <Motion> {
        if {$::psballoon::balloon(pending) == 1} {
            after cancel $::psballoon::balloon(id)
        }
        if {$::psballoon::balloon(created) == 1} {







            psballoon::killBalloon
        }


        set ::psballoon::balloon(id) [after 500 {psballoon::createBalloon %W %x %y}]
        set ::psballoon::balloon(pending) 1
    }
}

proc psballoon::killBalloon {} {
    variable balloon







>
>













>
>
>
>
>
>
>


>
>







76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
    if {$msg == "" && $c != "Listbox" && $c != "Label"} {
        error "Missing message to balloon for $W ($c)"
    }
    set balloon(msg,$W) $msg
    bind $W <Enter> {
        set ::psballoon::balloon(pending) 1
        set ::psballoon::balloon(created) 0
        set ::psballoon::balloon(lastX) %X
        set ::psballoon::balloon(lastY) %Y
        set ::psballoon::balloon(id) [after 500 {psballoon::createBalloon %W %x %y}]
    }
    bind $W <Button> {
        psballoon::killBalloon
    }
    bind $W <Leave> {
        psballoon::killBalloon
    }
    bind $W <Motion> {
        if {$::psballoon::balloon(pending) == 1} {
            after cancel $::psballoon::balloon(id)
        }
        if {$::psballoon::balloon(created) == 1} {
            if {$::psballoon::balloon(lastX) == %X && \
                        $::psballoon::balloon(lastY) == %Y} {
                # Sometimes when the balloon is created, a motion event with
                # the same coordinates arrive. Ignore that to avoid killing the
                # new balloon.
                return
            }
            psballoon::killBalloon
        }
        set ::psballoon::balloon(lastX) %X
        set ::psballoon::balloon(lastY) %Y
        set ::psballoon::balloon(id) [after 500 {psballoon::createBalloon %W %x %y}]
        set ::psballoon::balloon(pending) 1
    }
}

proc psballoon::killBalloon {} {
    variable balloon