what equal function of pyqt setgeometry()
in tkinter? or there function works that? searched bit couldn't find, of examples looks tkinter works on specific widget , can set width-height.
edit:
the
setgeometry()
2 things. locates window on screen , sets size. first 2 parameters x , y positions of window. third width , fourth height of window.
the nearest thing tkinter has place geometry manager. can set x,y coordinates (either absolute or relative) , width , height attributes (also absolute or relative).
for example, place label @ 100,100 , width , height 50% of parent this:
import tkinter tk root = tk.tk() label = tk.label(root, text="hello, world") label.place(x=100, y=100, relwidth=.5, relheight=.5) root.mainloop()
however, place right choice. tkinter smart picking right size widgets, , laying them out. without knowing actual problem you're trying solve it's hard give recommendations, certainly, pack or grid work better.
Comments
Post a Comment