0

I am running Centos 8.2 and Ubuntu 20.04 on VirtualBox 6.x. Python version in Centos is 3.6.9 and in Ubuntu is 3.8.x.

The issue is that when I run the following code (which is very simple) the displayed image is unreadably small.

import tkinter as tk

master = tk.Tk()
tk.Label(master, text="First Name").grid(row=0)
tk.Label(master, text="Last Name").grid(row=1)

e1 = tk.Entry(master)
e2 = tk.Entry(master)

e1.grid(row=0, column=1)
e2.grid(row=1, column=1)

master.mainloop()

The window produced by the code is about a 1/2 inch wide and 3/4" long. It works fine on my macbook pro and my windows 10 laptop. But on both the VMs running on VirtualBox, the box produced by this code is impossibly small.

I've tried altering width and length and it has unpredictable effects. "pack" makes the box--oddly--very large.

Any thoughts?

SteveJ
  • 1
  • 3
  • If you explicitly define larger fonts for your widgets, does that help? – Bryan Oakley Dec 15 '20 at 23:54
  • May be this [question](https://stackoverflow.com/questions/34132203/scaling-of-tkinter-gui-in-4k-38402160-resolution) helps? – acw1668 Dec 16 '20 at 04:20
  • @acw1668 That sorta/kinda helped. It's at least readable now, but nothing like how the same code appears on my mac or pc. The suggestion was to add a line like "master.tk.call('tk','scaling',2.0)" – SteveJ Dec 16 '20 at 23:04

0 Answers0