You can do this like so: class Name(tk.Frame): It will certainly clean up the attributes, and you will not having them together with all of the built in attributesĪlso, get all of your widgets into a class. Also, if you use from tkinter import * you can use import tkinter as tk instead as it groups all attributes into tk. ![]() This means you can write tk.widget and not having to write out every widget you use. Instead of from tkinter import Tk use import tkinter as tk. It will also get rid of the bar at the top, so you will have to use alt f4 to exit out of the window.Īlso, these options are optional but will certainly make your code more clear and efficient by getting rid of possible errors which may occur when doing certain tasks with the code. You can use window.overrideredirect(True) to get rid of the task bar. Window.geometry("%sx%s" %(screenWidth, screenHeight) This is how to do it: windowWidth = window.winfo_screenwidth Instead of using monitorInfo you can use winfo_screedwidth() and winfo_screenheight(). To everyone who commented and offered solutions for me, thank you! I really appreciate you taking the time to do so. That question didn't really put the pieces together in a newbie-friendly way, nor did it have any usable sample code, so hopefully this will be of use to someone else in the future.) ![]() (The breakthrough was examining all the properties mentioned in the suspected duplicate question (and it's comments and replies) here: tkinter window get x, y, geometry/coordinates without top of window Window.geometry(" 0 0".format(windowWidth,windowHeight)) #Set the new window to upper left corner and height
0 Comments
Leave a Reply. |