From a1d03b8159ffe1fc63d8dc4c324afb0576950b7f Mon Sep 17 00:00:00 2001 From: Dianne Skoll Date: Sun, 26 Dec 2021 13:04:35 -0500 Subject: [PATCH] Make moon icons respond to mouse clicks to edit reminders. --- scripts/tkremind | 24 ++++++++++++++---------- 1 file changed, 14 insertions(+), 10 deletions(-) diff --git a/scripts/tkremind b/scripts/tkremind index 03debbcd..5b2a5e84 100755 --- a/scripts/tkremind +++ b/scripts/tkremind @@ -3058,17 +3058,19 @@ proc ReadTaggedOptions { tag date } { } return $ans } -proc FireEditor { w } { +proc FireEditor { w {fntag ""}} { global Option global EditorPid - set tags [$w tag names current] - set index [lsearch -glob $tags "FILE_*"] - if {$index < 0} { - return + if {"$fntag" == ""} { + set tags [$w tag names current] + set index [lsearch -glob $tags "FILE_*"] + if {$index < 0} { + return + } + set fntag [lindex $tags $index] } - set tag [lindex $tags $index] - if {![regexp {^FILE_([0-9]+)_(.*)} $tag all line file]} { - return + if {![regexp {^FILE_([0-9]+)_(.*)} $fntag all line file]} { + return } set editor $Option(Editor) regsub -all "%s" $editor $file editor @@ -3481,7 +3483,9 @@ proc DoMoonSpecial { n stuff fntag } { .cal.t$n insert 1.1 " $msg\n" [list REM $fntag] .cal.t$n tag bind $fntag "EditableEnter .cal.t$n" .cal.t$n tag bind $fntag "EditableLeave .cal.t$n" - .cal.t$n tag bind $fntag "FireEditor .cal.t$n" + .cal.t$n tag bind $fntag "FireEditor .cal.t$n $fntag" + bind $win "FireEditor .cal.t$n $fntag" + bind $win "FireEditor .cal.t$n $fntag" } } else { if {"$fntag" == "x"} { @@ -3490,7 +3494,7 @@ proc DoMoonSpecial { n stuff fntag } { .cal.t$n insert 1.1 "\n" [list REM $fntag] .cal.t$n tag bind $fntag "EditableEnter .cal.t$n" .cal.t$n tag bind $fntag "EditableLeave .cal.t$n" - .cal.t$n tag bind $fntag "FireEditor .cal.t$n" + .cal.t$n tag bind $fntag "FireEditor .cal.t$n $fntag" } } .cal.t$n configure -state disabled