import tkinter as tk
class Form(tk.Frame):
def __init__(self, root):
super().__init__(root)
root.title('graphics')
root.resizable(False, False)
root.geometry('640x480')
self.pack()
self.master = root
self.build()
root.mainloop()
def build(self):
tk.Button(text = 'small', command = lambda:self.master.geometry('320x240')).place(x = 10, y =10)
tk.Button(text = 'medium', command = lambda: self.master.geometry('640x480')).place(x = 10, y =40)
tk.Button(text = 'large', command = lambda: self.master.geometry('1280x720')).place(x=10,y=70)
Form(tk.Tk())
Использована встроенная библиотека tkinter
import tkinter as tk
class Form(tk.Frame):
def __init__(self, root):
super().__init__(root)
root.title('graphics')
root.resizable(False, False)
root.geometry('640x480')
self.pack()
self.master = root
self.build()
root.mainloop()
def build(self):
tk.Button(text = 'small', command = lambda:self.master.geometry('320x240')).place(x = 10, y =10)
tk.Button(text = 'medium', command = lambda: self.master.geometry('640x480')).place(x = 10, y =40)
tk.Button(text = 'large', command = lambda: self.master.geometry('1280x720')).place(x=10,y=70)
Form(tk.Tk())
Использована встроенная библиотека tkinter