0

EDIT: I found the solution! My xorg settings were all wacky because I have an ultrawide monitor, and it had no idea what size (and therefore dpi) my monitor was. Explicitly setting the display and font dpi in X's settings fixed the rendering in all GUI's.

ORIGINAL:

When I run any tkinter program, many of the widgets render at around 1/2 size, especially text. Why is this happening? My window manager is Window Maker, and I'm running the latest version of Tcl/Tk.

Any help will be greatly appreciated!

My code:

import tkinter as tk

window = tk.Tk()

label = tk.Label(text="Name")
entry = tk.Entry()
button = tk.Button(text="Submit")

label.pack()
entry.pack()
button.pack()

window.mainloop()

Window manager: Window Maker 0.95.0 Tk: tk 8.6.10-2

Screenshot:

enter image description here

lisp-machine
  • 83
  • 1
  • 9

1 Answers1

0

In tkinter you can only change the size of a label with the font atribute, and same goes for the text inside the button. The button size can be changed with the width and height atribute.

from tkinter import *

window = Tk()

label = Label(text="Name", font='Helvetica 15')
entry = Entry()
button = Button(text="Submit",font ='Helvetica 15', height="3", width="10")

label.pack(pady = 5) # add pady inside the pack
entry.pack()
button.pack(pady = 5)

window.mainloop()
dumicodes
  • 34
  • 7