Holger Jakobs
Holger Jakobs

Reputation: 1062

Error 'bad pad value "2m": must be positive screen distance' when using tk_messageBox on a wayland display (CentOS)

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

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

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

Is there any way to get around this error?

Upvotes: 1

Views: 716

Answers (1)

Brad Lanam
Brad Lanam

Reputation: 5723

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
  }

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

I found the ticket I opened: https://core.tcl-lang.org/tk/tktview?name=2524085333

Upvotes: 2

Related Questions