Re: Tkinter widgets into classes.
Thanks all who replied, will look further into megawidgets and the Toplevel() function. Is there a way to get a separate window to return something when closed? -- https://mail.python.org/mailman/listinfo/python-list
Tkinter widgets into classes.
I was wandering if I could dynamically change my GUI and after a few searches on Google found the grid_remove() function. What I'm wandering now is if there is a way to group a lot of widgets up into one, and then use the one grid_remove function which will remove them all. Is it possible to do this in a class like this? class group1: label1=Label(text=Upon clicking the button).grid(row=0,column=0) label2=Label(text=The menu will dynamically change).grid(row=1,column=0) group1.grid_remove() -- https://mail.python.org/mailman/listinfo/python-list
Re: Tkinter widgets into classes.
Oh and another question, say I make another window in the program itself using this: def secondwindow(): root2=Tk() root2.mainloop() Would it be possible for me to use some code which would return True if one of these windows is currently up, or return False if the window is not up? -- https://mail.python.org/mailman/listinfo/python-list
Re: Tkinter widgets into classes.
On Saturday, 1 February 2014 21:52:51 UTC, Dave Angel wrote: Lewis Wood fluttershy...@gmail.com Wrote in message: Oh and another question, say I make another window in the program itself using this: def secondwindow(): root2=Tk() root2.mainloop() Would it be possible for me to use some code which would return True if one of these windows is currently up, or return False if the window is not up? No need. Only one at a time can be running, and you won't return from this function till it's done. To put it another way, you only want one mainloop in your code. -- DaveA But I can click the button Multiple times and it will create multiple windows? -- https://mail.python.org/mailman/listinfo/python-list
Re: Tkinter widgets into classes.
On Saturday, 1 February 2014 22:26:17 UTC, Dave Angel wrote: Lewis Wood fluttershy...@gmail.com Wrote in message: (deleting doublespaced googlegroups trash) To put it another way, you only want one mainloop in your code. -- DaveA But I can click the button Multiple times and it will create multiple windows? Not using the function you showed. -- DaveA It does, this is the whole code: from tkinter import * root=Tk() root.title(Second Root Testing) def secondwindow(): root2=Tk() root2.mainloop() button1=Button(root,text=Root2,command=secondwindow).grid(row=0,column=0) root.mainloop() -- https://mail.python.org/mailman/listinfo/python-list
Re: Tkinter GUI Error
I cannot say how grateful I am to find such a community willing to help 3 Thanks to everyone posting, learned a lot of new stuff :) Never knew you could just bring a local var into a def block using global inside of the function. Again, thanks for taking your time to help out newbies to programming such as myself. -- https://mail.python.org/mailman/listinfo/python-list
Re: Tkinter GUI Error
Also anyone know how to create an entry box for Tkinter where you can only enter in 2 digits? -- https://mail.python.org/mailman/listinfo/python-list
Re: Tkinter GUI Error
Forgot to mention I am using Python 3.3.3 -- https://mail.python.org/mailman/listinfo/python-list
Re: Tkinter GUI Error
When I try to use the labelent1.configure, it greets me with an error: AttributeError: 'NoneType' object has no attribute 'configure' I changed the labelent's to global. Don't suppose you know why? Also how would I go about using an object for the entire window. I am still a Novice at Tkinter and Python but can make my way around it. -- https://mail.python.org/mailman/listinfo/python-list