在 Wayland 显示器 (CentOS) 上使用 tk_messageBox 时出现错误“坏垫值“2m":必须为正屏幕距离 [英] Error 'bad pad value "2m": must be positive screen distance' when using tk_messageBox on a wayland display (CentOS)

查看:36
本文介绍了在 Wayland 显示器 (CentOS) 上使用 tk_messageBox 时出现错误“坏垫值“2m":必须为正屏幕距离的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的 Tcl 脚本在 Ubuntu 上运行良好,但现在我已将其中一个复制到 CentOS Linux 8 并收到上述错误.

My Tcl scripts run fine on Ubuntu, but now I have copied one to CentOS Linux 8 and get the error mentioned above.

即使我刚开始 Wish 并输入 tk_messageBox 命令,也会出现错误.

Even when I just start wish and enter a tk_messageBox command, the error appears.

安装的版本是 tk.x86_64 1:8.6.8-1.el8

The installed version is tk.x86_64 1:8.6.8-1.el8

有什么办法可以解决这个错误吗?

Is there any way to get around this error?

推荐答案

在 Wayland 上,您必须手动设置 tk 缩放.我有这样的代码来设置默认值:

On Wayland, you'll have to set the tk scaling manually. I have code like this to set a default:

  # fedora 25 has a bug where 'Inf' is returned
  # but once set is ok...
  set tkscale [tk scaling]
  if { $tkscale eq "Inf" } {
    tk scaling -displayof . 1.3333
    set tkscale 1.3333
  }

我的评论不正确,应该说 Tcl 返回Inf";当...的时候屏幕尺寸为 0.

My comment is incorrect, it should say Tcl returns "Inf" when the screen size is 0.

我找到了我打开的票:https://core.tcl-lang.org/tk/tktview?name=2524085333

这篇关于在 Wayland 显示器 (CentOS) 上使用 tk_messageBox 时出现错误“坏垫值“2m":必须为正屏幕距离的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆