• Tklib tooltip usage problem with configure

    From Mark Summerfield@21:1/5 to All on Wed Jun 26 07:45:57 2024
    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]

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Harald Oehlmann@21:1/5 to All on Wed Jun 26 10:17:48 2024
    Am 26.06.2024 um 09:45 schrieb Mark Summerfield:
    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]

    The tklib tooltip package has a lot of bugs. You may try the main branch version at fossil. I could reproduce the problem you are seeing and it
    is not solved.
    BWidget tooltip still has a lot of advantages. Porting all its code to
    tklib would be great...

    Sorry, no much help...
    Harald

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From nemethi@21:1/5 to All on Wed Jun 26 20:17:44 2024
    Am 26.06.24 um 09:45 schrieb Mark Summerfield:
    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.

    --
    Csaba Nemethi https://www.nemethi.de mailto:[email protected]

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Mark Summerfield@21:1/5 to nemethi on Thu Jun 27 05:42:30 2024
    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) }

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From nemethi@21:1/5 to All on Thu Jun 27 11:48:38 2024
    Am 27.06.24 um 07:42 schrieb Mark Summerfield:
    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) }

    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?

    --
    Csaba Nemethi https://www.nemethi.de mailto:[email protected]

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From nemethi@21:1/5 to All on Thu Jun 27 13:01:27 2024
    Am 27.06.24 um 12:29 schrieb Mark Summerfield:
    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)

    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!

    --
    Csaba Nemethi https://www.nemethi.de mailto:[email protected]

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Mark Summerfield@21:1/5 to nemethi on Thu Jun 27 10:29:51 2024
    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)

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Mark Summerfield@21:1/5 to nemethi on Thu Jun 27 11:25:40 2024
    On Thu, 27 Jun 2024 13:01:27 +0200, nemethi wrote:
    [snip]
    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!

    I tried it and it makes every app much bigger. But that would mean
    changing every non-Tk app to be smaller to compensate.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)