Я пытаюсь создать кнопки в программе, чтобы вывести пользователя на другие экраны. Я создал изображения на ярлыках, но не уверен, как сделать их функциональными кнопками, которые переносят пользователей на другую страницу. Вы можете видеть в моем коде 2 кнопки, которые мне нужны, это цитата с поиском и новая цитата. СпасибоЯ пытаюсь создать кнопки в tkinter
from tkinter import *
class Window():
def __init__(self,master): #constructor
self.master = master
self.master.title("Borras Roofing Quotation System") #sets title of window
self.master.geometry("2160x1440") #sets size of window
self.master.configure(background = "white") # sets background colour of window.
self.Borras = PhotoImage(file = "Borras.Logo.PNG") #sets up image
self.BorrasLabel = Label(self.master, image = self.Borras, bg = "white", width='1000', height= '500') #puts image onto label
self.BorrasLabel.pack()
self.newquote = PhotoImage(file = "Process_New_Quote_Button.PNG") #sets up image
self.newquoteLabel = Label(self.master, image = self.newquote, bg = "white") #puts image onto label
self.newquoteLabel.place(x = 200, y = 500)
self.searchquote = PhotoImage(file = "Search_Current_Quote_Button.PNG") #sets up image
self.searchquoteLabel = Label(self.master, image = self.searchquote, bg = "white") #puts image onto label
self.searchquoteLabel.place(x = 800, y = 500)
root = Tk()
userPassWindow = Window(root)
root.mainloop()
Вы хотите знать, как функциональность к кнопкам? Вы пробовали добавить 'command'? 'Например, b = Button (text =" Click Me ", command = имя_функции)'? –