| | |
Wondering about new windows in Tkinter
Thread Solved |
Hello all!
Ok here's my problem:
I have a Hello World type program that I want to run in steps, and each step is in a new window. When a "next" button is pressed the old window terminates and a new one is created. Now I don't know much about the command = whatever thingy so I was wondering if you could give me some info on it? Oh and I mostly work with .bind so if so can you give me the example in that form?
Help appreciated.
Ok here's my problem:
I have a Hello World type program that I want to run in steps, and each step is in a new window. When a "next" button is pressed the old window terminates and a new one is created. Now I don't know much about the command = whatever thingy so I was wondering if you could give me some info on it? Oh and I mostly work with .bind so if so can you give me the example in that form?
Help appreciated.
This snippet will bring up a message window using Toplevel() ...
python Syntax (Toggle Plain Text)
# display message in a child window from Tkinter import * def messageWindow(message): # create child window win = Toplevel() # display message Label(win, text=message).pack() # quit child window and return to root window Button(win, text='OK', command=win.destroy).pack() def createMessage(): global counter counter = counter + 1 message = "This is message number " + str(counter) messageWindow(message) counter = 0 # create root window root = Tk() # put a button on it, command executes the given function on button-click Button(root, text='Bring up Message', command=createMessage).pack() # start event-loop root.mainloop()
Last edited by vegaseat; Aug 12th, 2009 at 4:58 pm.
May 'the Google' be with you!
![]() |
Similar Threads
- Windows dynamic disk question (Windows NT / 2000 / XP)
- play video on windows start up and shut down (Windows NT / 2000 / XP)
- Windows 2000 SMTP issue (Windows NT / 2000 / XP)
- have log !!!!!!!!!!! finally (Viruses, Spyware and other Nasties)
- Windows Media Center video card (Monitors, Displays and Video Cards)
- A 3D Windows Desktop (Windows NT / 2000 / XP)
- Windows 2003 Dual Boot (Windows NT / 2000 / XP)
- Problems installing windows 98se over 98nt (Windows 95 / 98 / Me)
Other Threads in the Python Forum
- Previous Thread: Need Help with Tkinter
- Next Thread: Error of some kind
| Thread Tools | Search this Thread |
address aliased anydbm app bash beginner bits calling casino changecolor cipher clear conversion coordinates corners count cturtle curves definedlines development dictionary digital dynamic events examples excel external feet file float format function gui handling hints homework iframe images import input java keycontrol line linux list lists loan loop matching mouse multiple number numbers output parsing path port prime programming projects py py2exe pygame pymailer python random rational raw_input recursion recursive scrolledtext searchingfile shebang signal singleton split string strings tails terminal text threading time tlapse tooltip tuple tutorial type ubuntu unicode url urllib urllib2 valueerror variable web-scrape whileloop word wxpython xlwt






