I have added tooltips to some widgets and they work fine. For example:
package require tooltip
...
tooltip::tooltip $panel.optionsButton "Modal Show/Hide"
But the tooltips come with a sort of blue/grey background whereas I prefer the more traditional light yellow.
So I tried this:
tooltip::tooltip configure -background yellow and got this:
Error in startup script: invalid command name ".__tooltip__.label"
while executing
"$b.label configure $opt"
(procedure "configure" line 13)
invoked from within
"configure {*}$args"
(procedure "tooltip::tooltip" line 34)
invoked from within
"tooltip::tooltip configure -background yellow"
(procedure "test::make" line 11)
invoked from within
...
It is no different if I use ::tooltip::tooltip. And I get a similar error
if I just try to print the config options, e.g.,
puts [tooltip::tooltip configure]
I have added tooltips to some widgets and they work fine. For example:
package require tooltip
...
tooltip::tooltip $panel.optionsButton "Modal Show/Hide"
But the tooltips come with a sort of blue/grey background whereas I prefer the more traditional light yellow.
So I tried this:
tooltip::tooltip configure -background yellow and got this:
Error in startup script: invalid command name ".__tooltip__.label"
while executing
"$b.label configure $opt"
(procedure "configure" line 13)
invoked from within
"configure {*}$args"
(procedure "tooltip::tooltip" line 34)
invoked from within
"tooltip::tooltip configure -background yellow"
(procedure "test::make" line 11)
invoked from within
...
It is no different if I use ::tooltip::tooltip. And I get a similar error
if I just try to print the config options, e.g.,
puts [tooltip::tooltip configure]
That blue/grey background and the error message generated by "tooltip::tooltip configure" are caused by some bugs in version 1.8 of
the tooltip package. These bugs are now fixed in the latest tooltip
version 1.8.2. I suggest you to check out this new version, in which
the default tooltip background is lightyellow (again) and
"tooltip::tooltip configure" works as expected.
On Wed, 26 Jun 2024 20:17:44 +0200, nemethi wrote:
[snip]
That blue/grey background and the error message generated by
"tooltip::tooltip configure" are caused by some bugs in version 1.8 of
the tooltip package. These bugs are now fixed in the latest tooltip
version 1.8.2. I suggest you to check out this new version, in which
the default tooltip background is lightyellow (again) and
"tooltip::tooltip configure" works as expected.
Thanks, I just downloaded and installed from trunk and the background in lightyellow.
Incidentally, before installing Tcllib and Tklib I always have to edit installer.tcl to add the line
tk scaling 1.67
I wish both contained this so I wouldn't need to:
if {[info exists env(TK_SCALING)]} { tk scaling $env(TK_SCALING) }
On Thu, 27 Jun 2024 11:48:38 +0200, nemethi wrote:
[snip]
Tk 9 uses a different strategy for the scaling-related stuff: On X11 it
retrieves the display's scaling level (100%, 125%, 150%, ...) from the
system settings, assigns it to the public variable tk::scalingPct, and
passes a value derived from the latter to "tk scaling" (see "man n
tk_scalingPct"). Both $tk::scalingPct and [tk scaling] are used at many
places in the Tk code and library scripts to make the widgets and
standard dialogs scaling-aware.
Out of curiosity: What is your desktop environment
(GNOME/KDE/Cinnamon/MATE/Xfce)? What is the display's scaling level?
Are you using Xorg or Wayland?. What are the values $tk::scalingPct and
[tk scaling] immediately after starting wish?
In my experience *every* Tk app is far too small for me. For example, I
use gitk but fortunately it lets you set all the fonts. For others I am
able to add in the [tk scaling] if statement or simply can't use them.
I'm using Tcl/Tk 9.0b2 on Linux 6.1 amd64 Debian/Linux 12 (bookworm) with Xfce 4.18 (GTK 3.24).
$ wish9
% puts $tk::scalingPct
100
% puts [tk scaling]
1.3333333333333333
I don't know if I am using Xorg or Wayland. My display is 1920x1200 (16:10 aspect ratio)
Tk 9 uses a different strategy for the scaling-related stuff: On X11 it retrieves the display's scaling level (100%, 125%, 150%, ...) from the
system settings, assigns it to the public variable tk::scalingPct, and
passes a value derived from the latter to "tk scaling" (see "man n tk_scalingPct"). Both $tk::scalingPct and [tk scaling] are used at many places in the Tk code and library scripts to make the widgets and
standard dialogs scaling-aware.
Out of curiosity: What is your desktop environment (GNOME/KDE/Cinnamon/MATE/Xfce)? What is the display's scaling level?
Are you using Xorg or Wayland?. What are the values $tk::scalingPct and
[tk scaling] immediately after starting wish?
Suggestion: In the "Fonts" tab of the "Appearance" dialog set the font
DPI to 120. This will increase the size of the fonts by a factor of
1.25, for all applications, including the Tk scripts. After doing this, right after starting wish, $tk::scalingPct will be 125 and [tk scaling]
will be 1.66666666666666666666. Just give it a try!
| Sysop: | Keyop |
|---|---|
| Location: | Huddersfield, West Yorkshire, UK |
| Users: | 715 |
| Nodes: | 16 (2 / 14) |
| Uptime: | 154:54:35 |
| Calls: | 12,092 |
| Files: | 15,000 |
| Messages: | 6,517,690 |