Python Forum
GUI Tkinter Widget Positions
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
GUI Tkinter Widget Positions
#3
Here is the code. On my PC running Windows7 Professional the controls overlap. They don't overlap on Windows10

The inconsistency might be related to the following:

https://interactivepython.org/runestone/...dgets.html

import tkinter
from tkinter import ttk
from tkinter import *
from tkinter.ttk import *
from tkinter import messagebox


root = tkinter.Tk()                                                 
root.geometry("470x225")                                            
root.title("My First GUI")                                           

newCanvas = Canvas(root,width=460,height=250)                       
newCanvas.create_line(240,20,240,205,fill="black")


sacol = ttk.Combobox(
    root, values=[1,2,3,4,5],
    state='readonly', width = 2)                                    

sacol.current(0)                                              

sarow = ttk.Combobox(
    root, values=[1,2,3,4,5],
    state='readonly', width = 2)                                   

sarow.current(0)                                            

elementButton = tkinter.Button(root,text = "Calculate", relief=GROOVE)                        
                     

salbl = Label(root,text = "Press 1")               

elbl = Label(root, text = "Press 2")                

sacolTxt = Label(root, text = "Number of aaaaaaaaa columns")  
sarowTxt = Label(root, text = "Number of aaaaaaaaa rows")
sattxt = Label(root, text = "Number of aaaaaaaaa =")
elttxt = Label(root, text = "Number of aaaaaaaa =")

d1Txt = Label(root, text="")
d2Txt = Label(root, text="")


newCanvas.place(x=0,y=0)                                            
sacolTxt.place(x=10,y=10)
sacol.place(x=180,y=10)
sarowTxt.place(x=10,y=35)
sarow.place(x=180,y=35)
sattxt.place(x=10,y=60)
salbl.place(x=143,y=60)
elttxt.place(x=10,y=85)
elbl.place(x=132,y=85)
elementButton.place(x=10,y=110)

d1Txt.place(x=370,y=110)
d2Txt.place(x=370,y=135)

root.mainloop() 
Reply


Messages In This Thread
GUI Tkinter Widget Positions - by punksnotdead - Jun-09-2019, 11:19 AM
RE: GUI Tkinter Widget Positions - by Yoriz - Jun-09-2019, 11:55 AM
RE: GUI Tkinter Widget Positions - by punksnotdead - Jun-12-2019, 09:46 AM
RE: GUI Tkinter Widget Positions - by Yoriz - Jun-12-2019, 06:06 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  TKinter Widget Attribute and Method Quick Reference zunebuggy 3 959 Oct-15-2023, 05:49 PM
Last Post: zunebuggy
  [Tkinter] Programmatically creating buttons that remember their positions Clunk_Head 6 1,457 Jun-22-2023, 02:51 PM
Last Post: deanhystad
  [Tkinter] The Text in the Label widget Tkinter cuts off the Long text in the view malmustafa 4 5,233 Jun-26-2022, 06:26 PM
Last Post: menator01
  Tkinter Exit Code based on Entry Widget Nu2Python 6 3,144 Oct-21-2021, 03:01 PM
Last Post: Nu2Python
  tkinter text widget word wrap position chrisdb 6 7,726 Mar-18-2021, 03:55 PM
Last Post: chrisdb
  [Tkinter] How to add conversions and fix button positions. javesike1262 7 2,997 Jan-31-2021, 04:39 PM
Last Post: deanhystad
  Tkinter - How can I extend a label widget? TurboC 2 2,872 Oct-13-2020, 12:15 PM
Last Post: zazas321
  [Tkinter] Tkinter custom widget styling and creating custom theme karolp 6 4,957 May-06-2020, 06:11 PM
Last Post: karolp
  Tkinter calendar widget scratchmyhead 4 4,435 May-03-2020, 07:01 PM
Last Post: scratchmyhead
  [PyGUI] Python 3.8.1 Tkinter Widget stete change sasiap 4 2,617 Feb-14-2020, 10:38 AM
Last Post: sasiap

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020