Jan-04-2017, 05:25 PM
I have made two windows
StartScreen=tk()
and FirstScreen=tk()
I want to make a button on StartScreen that opens up the window FirstScreen
This is the code for the startscreen-
Thank you.
StartScreen=tk()
and FirstScreen=tk()
I want to make a button on StartScreen that opens up the window FirstScreen
This is the code for the startscreen-
################################################### from tkinter import * ################################################## StartScreen=Tk() ##Photo Car## PhotoCarRed = PhotoImage(file="D:\Python Projects\Parking Management System\Photos\Best-High-Resolution-Photos-For-Cars.png") PlacementPhotoCarRed = Label(StartScreen, image = PhotoCarRed) PlacementPhotoCarRed.pack(side="top", fill=X ) ###ToolBar on the bottom of the screen toolbar= Frame(StartScreen, bg="white") Button1 = Button(toolbar, text="Book A Parking Space Right Now!", relief = RAISED) Button1.pack(side="left", padx=10, pady=10) Button2 = Button(toolbar, text="Have Your Own Parking? Register With Us!", relief = RAISED) Button2.pack(side="left", padx=10, pady=10) Button3 = Button(toolbar, text="Want To Cancel Your Reservation?", relief = RAISED) Button3.pack(side="right", padx=10, pady=10) toolbar.pack(side="bottom") StartScreen.mainloop()This is the code for the second tk() that is FirstScreen
#################### from tkinter import * #################### FirstScreen = Tk() ################### """Size of city screen image = 720x200 px""" WelcomePic = PhotoImage(file="D:\Python Projects\Parking Management System\Photos\CITYWALLPAPERLOWERTOOLBAR.png") WelcomePicPlacement=Label(FirstScreen,image=WelcomePic) WelcomePicPlacement.pack(side="top",fill="both") ###################### """Drop Drop Menus On The Top Of The Screen""" ####################### DropDownMenuToShowcase = Menu(FirstScreen) FirstScreen.configure(menu=DropDownMenuToShowcase) WhatWeDo= Menu(DropDownMenuToShowcase) DropDownMenuToShowcase.add_cascade(label="What We Do", menu = WhatWeDo) WhatWeDo.add_command(label="Reservations For Hotel Parking") WhatWeDo.add_command(label="Reservations For Clubs") WhatWeDo.add_command(label="Reservations For Events") WhatWeDo.add_command(label="Reservations For Institutions ") WhatWeDo.add_command(label="Reservations For Workplaces") FirstScreen.mainloop()I want to make a button on StarScreen, which, upon clicking, makes the FirstScreen window appear.
Thank you.