From 1c872c5558f1a25aac48f0e4db375ab96d59bd1a Mon Sep 17 00:00:00 2001 From: Sergey Kalinin Date: Wed, 8 Apr 2026 16:46:31 +0300 Subject: [PATCH] =?UTF-8?q?=D0=94=D0=BE=D0=B1=D0=B0=D0=B2=D0=BB=D0=B5?= =?UTF-8?q?=D0=BD=D1=8B=20=D0=BF=D1=80=D0=BE=D1=86=D0=B5=D0=B4=D1=83=D1=80?= =?UTF-8?q?=D1=8B=20=D0=BE=D1=82=D0=BE=D0=B1=D1=80=D0=B0=D0=B6=D0=B5=D0=BD?= =?UTF-8?q?=D0=B8=D0=B5=20=D0=BF=D0=BE=D0=B4=D1=81=D0=BA=D0=B0=D0=B7=D0=BE?= =?UTF-8?q?=D0=BA=20=D0=B8=20=D0=B7=D0=B0=D0=BF=D1=83=D1=81=D0=BA=D0=B0=20?= =?UTF-8?q?=D0=B1=D1=80=D0=BE=D1=83=D0=B7=D0=B5=D1=80=D0=B0=20=D0=B4=D0=BB?= =?UTF-8?q?=D1=8F=20=D1=81=D1=81=D1=8B=D0=BB=D0=BE=D0=BA.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/procedure.tcl | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) diff --git a/lib/procedure.tcl b/lib/procedure.tcl index 8f526af..eb8e772 100644 --- a/lib/procedure.tcl +++ b/lib/procedure.tcl @@ -1242,3 +1242,36 @@ proc ChooseColor {} { $txt insert insert "$color" } } + +proc OpenURL {url} { + global tcl_platform + + if {$tcl_platform(platform) == "windows"} { + set cmd "cmd /c start $url" + } elseif {$tcl_platform(platform) == "mac"} { + set cmd "open $url" + } elseif {$tcl_platform(platform) == "unix"} { + set cmd "xdg-open $url" + } + puts $cmd + set pipe [open "|$cmd" "r"] + puts $pipe + fileevent $pipe readable + fconfigure $pipe -buffering none -blocking no +} + +proc ShowTooltip {widget showingText} { + if [winfo exists .baloonTip] {destroy .baloonTip} + set tip [toplevel .baloonTip -bg yellow -bd 1 -relief solid] + wm transient $tip . + wm overrideredirect $tip 1 + set x [winfo pointerx $widget] + set y [winfo pointery $widget] + + wm geometry $tip +[expr {$x + 10}]+[expr {$y + 10}] + + label $tip.l -text $showingText -bg white + pack $tip.l + after 5000 [list destroy $tip] +} +