Am 05.06.2023 um 09:40 schrieb Mark:
I recently discovered tk scaling which I find very useful.Mark,
However, the scaling factor I need varies from computer to computer.
It is possible to set a global scaling factor for a computer (e.g., by storing a value in .Xdefaults or something like that), so that I can just set it once per computer and then rely on that?
you may look to the work of Csaba (and maybe Brian) about initializing
tk scaling to a senseful value.
You will find this code:
- in Tk 8.7 (not released, trunk of fossil)
- in scrollutil or tablelist packages
Take care,
Harald
I recently discovered tk scaling which I find very useful.
However, the scaling factor I need varies from computer to computer.
It is possible to set a global scaling factor for a computer (e.g., by storing a value in .Xdefaults or something like that), so that I can just set it once per computer and then rely on that?
Am 05.06.23 um 10:00 schrieb Mark:
On Monday, June 5, 2023 at 8:54:41 AM UTC+1, Harald Oehlmann wrote:
Am 05.06.2023 um 09:40 schrieb Mark:
I recently discovered tk scaling which I find very useful.Mark,
However, the scaling factor I need varies from computer to computer.
It is possible to set a global scaling factor for a computer (e.g., by storing a value in .Xdefaults or something like that), so that I can just set it once per computer and then rely on that?
you may look to the work of Csaba (and maybe Brian) about initializing
tk scaling to a senseful value.
You will find this code:
- in Tk 8.7 (not released, trunk of fossil)
- in scrollutil or tablelist packages
Take care,
Harald
That won't help with other people's applications. For example for tkcon I have to manually edit the tkcon file to add tk scaling _factor_. That's why I was hoping for the ability to set a system-wide setting.Why do you want to change the scaling factor "for tkcon"? Once set, the
new scaling factor will apply to everything in your GUI, not only to tkcon.
The Tk engine sets the scaling factor at start time according to the display's physical size (in mm) and its size in pixels. If you see the
need to change the scaling factor then this is probably because you want
to have bigger fonts and/or larger widgets. If this is the case then
you probably have the same problem not only with Tk scripts, but also
with most other applications, too. This is quite normal if you have a relatively small display with high pixel density.
The recommended way to solve this (Tk-independent) issue is to increase
the display's DPI scaling percentage via the system settings. On
Windows 10+ this is quite easy, and most modern X11 desktops provide
similar capabilities, too. Once you have done this, your Tk scripts
will start with a correspondingly adapted scaling factor. On Windows
this has always been the case, and on X11 it will be the case too in Tk
8.7. For applications running an earlier Tk versions it is sufficient
to invoke "package require scrollutil" or "package require tablelist".
--
Csaba Nemethi https://www.nemethi.de mailto:csaba....@t-online.de
On Monday, June 5, 2023 at 8:54:41 AM UTC+1, Harald Oehlmann wrote:
Am 05.06.2023 um 09:40 schrieb Mark:
I recently discovered tk scaling which I find very useful.Mark,
However, the scaling factor I need varies from computer to computer.
It is possible to set a global scaling factor for a computer (e.g., by storing a value in .Xdefaults or something like that), so that I can just set it once per computer and then rely on that?
you may look to the work of Csaba (and maybe Brian) about initializing
tk scaling to a senseful value.
You will find this code:
- in Tk 8.7 (not released, trunk of fossil)
- in scrollutil or tablelist packages
Take care,
Harald
That won't help with other people's applications. For example for tkcon I have to manually edit the tkcon file to add tk scaling _factor_. That's why I was hoping for the ability to set a system-wide setting.
But that doesn't help with my own tk apps. I tried adding `package
require scrollutil` to a simple `hello gui` app and it had no effect;
but `tk scaling 1.5` works. I'm using 8.6 on Debian on one machine
and on Ubuntu on another machine.
Nor do I want to fiddle with my global font settings which work for everything else since if I change them for Tk that'll mess them up
for all the other widget toolkits that other apps use.
On Monday, June 5, 2023 at 12:20:59 PM UTC+1, nemethi wrote:Presumably it stores this somewhere, but where I don't know.
Am 05.06.23 um 10:00 schrieb Mark:
On Monday, June 5, 2023 at 8:54:41 AM UTC+1, Harald Oehlmann wrote:Why do you want to change the scaling factor "for tkcon"? Once set, the
Am 05.06.2023 um 09:40 schrieb Mark:
I recently discovered tk scaling which I find very useful.Mark,
However, the scaling factor I need varies from computer to computer. >>>>> It is possible to set a global scaling factor for a computer (e.g., by storing a value in .Xdefaults or something like that), so that I can just set it once per computer and then rely on that?
you may look to the work of Csaba (and maybe Brian) about initializing >>>> tk scaling to a senseful value.
You will find this code:
- in Tk 8.7 (not released, trunk of fossil)
- in scrollutil or tablelist packages
Take care,
Harald
That won't help with other people's applications. For example for tkcon I have to manually edit the tkcon file to add tk scaling _factor_. That's why I was hoping for the ability to set a system-wide setting.
new scaling factor will apply to everything in your GUI, not only to tkcon. >>
The Tk engine sets the scaling factor at start time according to the
display's physical size (in mm) and its size in pixels. If you see the
need to change the scaling factor then this is probably because you want
to have bigger fonts and/or larger widgets. If this is the case then
you probably have the same problem not only with Tk scripts, but also
with most other applications, too. This is quite normal if you have a
relatively small display with high pixel density.
The recommended way to solve this (Tk-independent) issue is to increase
the display's DPI scaling percentage via the system settings. On
Windows 10+ this is quite easy, and most modern X11 desktops provide
similar capabilities, too. Once you have done this, your Tk scripts
will start with a correspondingly adapted scaling factor. On Windows
this has always been the case, and on X11 it will be the case too in Tk
8.7. For applications running an earlier Tk versions it is sufficient
to invoke "package require scrollutil" or "package require tablelist".
--
Csaba Nemethi https://www.nemethi.de mailto:csaba....@t-online.de
You're right that I need tkcon to show bigger fonts. Weirdly, after editing tkcon to use `tk scaling 1.5` -- and after which it was big enough -- when I then deleted the tk scaling command I'd added it somehow remembered and still show the right size.
But that doesn't help with my own tk apps. I tried adding `package require scrollutil` to a simple `hello gui` app and it had no effect; but `tk scaling 1.5` works. I'm using 8.6 on Debian on one machine and on Ubuntu on another machine.
Nor do I want to fiddle with my global font settings which work for everything else since if I change them for Tk that'll mess them up for all the other widget toolkits that other apps use.
I'm using Debian with Xfce where tkcon seems to remember the scale (at least within one session; I'll find out tomorrow if it remembers across sessions). And I'm also using Ubuntu with Xfce on another computer where I have to manually add tk scaling totkcon.
I know how to adjust font sizes and how to use tk scaling _inside_ an app. But the problem is that the scaling needed is different per computer (due to different screen sizes and resolutions).all on the other. But at least it can be done and applies globally to all FLTK apps. So I'm looking for a Tk equivalent. For example, in my .Xdefaults I have `*insertofftime: 0` which stops cursor blink in Tk's non-themed widgets. So really, I'm
For Gtk and KDE apps this can be solved with global settings. And so too for Xfce. But this only seems to work for Gtk- and Qt-based apps. For FLTK-based apps in my .bashrc I have: `export FLTK_SCALING_FACTOR=1.4` on one computer; but don't need it at
I'm using Debian with Xfce where tkcon seems to remember the scale (at least within one session; I'll find out tomorrow if it remembers across sessions). And I'm also using Ubuntu with Xfce on another computer where I have to manually add tk scaling totkcon.
I know how to adjust font sizes and how to use tk scaling _inside_ an app. But the problem is that the scaling needed is different per computer (due to different screen sizes and resolutions).all on the other. But at least it can be done and applies globally to all FLTK apps. So I'm looking for a Tk equivalent. For example, in my .Xdefaults I have `*insertofftime: 0` which stops cursor blink in Tk's non-themed widgets. So really, I'm
For Gtk and KDE apps this can be solved with global settings. And so too for Xfce. But this only seems to work for Gtk- and Qt-based apps. For FLTK-based apps in my .bashrc I have: `export FLTK_SCALING_FACTOR=1.4` on one computer; but don't need it at
Am 05.06.23 um 21:02 schrieb Mark:to tkcon.
I'm using Debian with Xfce where tkcon seems to remember the scale (at least within one session; I'll find out tomorrow if it remembers across sessions). And I'm also using Ubuntu with Xfce on another computer where I have to manually add tk scaling
at all on the other. But at least it can be done and applies globally to all FLTK apps. So I'm looking for a Tk equivalent. For example, in my .Xdefaults I have `*insertofftime: 0` which stops cursor blink in Tk's non-themed widgets. So really, I'mI know how to adjust font sizes and how to use tk scaling _inside_ an app. But the problem is that the scaling needed is different per computer (due to different screen sizes and resolutions).
For Gtk and KDE apps this can be solved with global settings. And so too for Xfce. But this only seems to work for Gtk- and Qt-based apps. For FLTK-based apps in my .bashrc I have: `export FLTK_SCALING_FACTOR=1.4` on one computer; but don't need it
So now we know that you are running Xfce on both computers, but you
haven't answered my second question, namely whether you have set the DPI scaling level via the system settings. Apparently not. On Xfce this is
not as simple as on GNOME, KDE, or Cinnamon, but possible:
Method 1: In the 3rd tab of the Appearance dialog set the Custom DPI
setting to, say, 144. If you then start wish and perform "package
require scrollutil" then the [tk scaling] will automatically change from 1.333... to 2.0.
Method 1: In the Display dialog set the Scale to, say, "1.5x", and in
the last tab of the Appearance dialog select "2x" as the value of the
Window Scaling. If you then start wish and perform "package require scrollutil" then the [tk scaling] will automatically change from
1.333... to 2.666...
It is assumed that you are using the most recent Scrollutil version 1.18.
It would be helpful if you could proceed as described above and report
back the results of your tests.
--
Csaba Nemethi https://www.nemethi.de mailto:csaba....@t-online.de
Am 06.06.2023 um 13:17 schrieb Mark:
Well I realised I can do this myself.
In my .bashrc I add an export, e.g.: `export TK_SCALING=1.5`
and then in every Tk app I write I start with this one-liner:
tk scaling [expr {[info exists env(TK_SCALING)] ? $env(TK_SCALING) : 1}]
Perhaps not setting it to 1 if TK_SCALING is not present. Just leave it untouched.
You may also read about .tclrc on the tclsh man page.
Take care,
Harald
Well I realised I can do this myself.
In my .bashrc I add an export, e.g.: `export TK_SCALING=1.5`
and then in every Tk app I write I start with this one-liner:
tk scaling [expr {[info exists env(TK_SCALING)] ? $env(TK_SCALING) : 1}]
On Tuesday, June 6, 2023 at 12:30:10 PM UTC+1, Harald Oehlmann wrote:
Am 06.06.2023 um 13:17 schrieb Mark:
Well I realised I can do this myself.
In my .bashrc I add an export, e.g.: `export TK_SCALING=1.5`
and then in every Tk app I write I start with this one-liner:
tk scaling [expr {[info exists env(TK_SCALING)] ? $env(TK_SCALING) : 1}]
Perhaps not setting it to 1 if TK_SCALING is not present. Just leave it untouched.
You may also read about .tclrc on the tclsh man page.
Take care,Good idea. I'm now using:
Harald
if {[info exists env(TK_SCALING)]} { tk scaling $env(TK_SCALING) }
On Tuesday, June 6, 2023 at 12:58:35 PM UTC+1, Mark wrote:
On Tuesday, June 6, 2023 at 12:30:10 PM UTC+1, Harald Oehlmann wrote:
Am 06.06.2023 um 13:17 schrieb Mark:Good idea. I'm now using:
Well I realised I can do this myself.Perhaps not setting it to 1 if TK_SCALING is not present. Just leave it
In my .bashrc I add an export, e.g.: `export TK_SCALING=1.5`
and then in every Tk app I write I start with this one-liner:
tk scaling [expr {[info exists env(TK_SCALING)] ? $env(TK_SCALING) : 1}] >>>>
untouched.
You may also read about .tclrc on the tclsh man page.
Take care,
Harald
if {[info exists env(TK_SCALING)]} { tk scaling $env(TK_SCALING) }
Incidentally, I can't find any docs for tclrc or .tclrc.
On Tuesday, June 6, 2023 at 12:30:10 PM UTC+1, Harald Oehlmann wrote:
Am 06.06.2023 um 13:17 schrieb Mark:
Well I realised I can do this myself.Perhaps not setting it to 1 if TK_SCALING is not present. Just leave it
In my .bashrc I add an export, e.g.: `export TK_SCALING=1.5`
and then in every Tk app I write I start with this one-liner:
tk scaling [expr {[info exists env(TK_SCALING)] ? $env(TK_SCALING) : 1}] >>>
untouched.
You may also read about .tclrc on the tclsh man page.
Take care,
Harald
Good idea. I'm now using:
if {[info exists env(TK_SCALING)]} { tk scaling $env(TK_SCALING) }
Sysop: | Keyop |
---|---|
Location: | Huddersfield, West Yorkshire, UK |
Users: | 489 |
Nodes: | 16 (2 / 14) |
Uptime: | 45:33:08 |
Calls: | 9,670 |
Calls today: | 1 |
Files: | 13,719 |
Messages: | 6,169,995 |