Sysop: | Amessyroom |
---|---|
Location: | Fayetteville, NC |
Users: | 27 |
Nodes: | 6 (0 / 6) |
Uptime: | 46:22:22 |
Calls: | 632 |
Calls today: | 3 |
Files: | 1,187 |
D/L today: |
24 files (29,813K bytes) |
Messages: | 176,482 |
TkSVG, the SVG Tk 9 support for Tk 8.6, has a 0.15 release:
https://github.com/tcltk-depot/tksvg/releases/tag/0.15
This is due to upstream changes in great SVGNANO project.
The changes are:
- support of the svg "color-order" attribute
- fixing a possible race condition in color values
There are binaries for MAC-OS, Linux and Win32/64.
Please comment, if those are helpful for you.
And thanks to magic other Christian to bring us all this gems !
Harald
TkSVG, the SVG Tk 9 support for Tk 8.6, has a 0.15 release:
https://github.com/tcltk-depot/tksvg/releases/tag/0.15
This is due to upstream changes in great SVGNANO project.
The changes are:
- support of the svg "color-order" attribute
- fixing a possible race condition in color values
There are binaries for MAC-OS, Linux and Win32/64.
Please comment, if those are helpful for you.
And thanks to magic other Christian to bring us all this gems !
Harald
On Mon, 13 Oct 2025 18:15:43 +0200, Harald Oehlmann wrote:
TkSVG, the SVG Tk 9 support for Tk 8.6, has a 0.15 release:
https://github.com/tcltk-depot/tksvg/releases/tag/0.15
This is due to upstream changes in great SVGNANO project.
The changes are:
- support of the svg "color-order" attribute
- fixing a possible race condition in color values
There are binaries for MAC-OS, Linux and Win32/64.
Please comment, if those are helpful for you.
And thanks to magic other Christian to bring us all this gems !
Harald
I find Tcl/Tk 9's SVG support really useful.
For my GUI applications _all_ my icons are SVG and for my buttons'
and menu items' -image I use this tiny function:
proc icon {svg {width 0}} {
if {!$width} {
return [image create photo -file $::APPPATH/images/$svg]
}
image create photo -file $::APPPATH/images/$svg \
-format "svg -scaletowidth $width"
}
And for color menus I generate color swatches programmatically,
again using SVG:
proc swatch {color size} {
const R [expr {max(3, $size / 4.0)}]
const W [expr {$R + 2.5}]
const SVG "<svg width=\"$size\" height=\"$size\"><rect x=\"0\"
y=\"0\" width=\"$size\" height=\"$size\" rx=\"$R\" ry=\"$R\"
fill=\"$color\" stroke-width=\"$W\" stroke=\"white\"></svg>"
image create photo -data $SVG
}
The only caveat is that for icons that contain text I must (once
each) load them into inkscape and for the text do "Object to Path"
so that they don't need any fonts.