|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
Noob With Widgets
I am currently reading an e-book about python and its coming now to the part about widgets and stuff. I want to know if there is a website of some sort that can show and demenstrate all the different actions you can do with a widget. One in paticular i am having trouble with is clearing out an entry box. Like if the user typed something but then changed his/her mind they could click a button and then it would clear it out by deleting the text in the box. I can figure out how to add text but not how to clear the box. Any help is appreciated though a website for all widgets would help me in the future.
Also, if you used to different programming styles, i am using a style like this... def close(event): sys.exit(0) button = Button(root) button.bind("<Button-1>") ... in other words, i am using "bind", for my buttons. |
|
#2
|
|||
|
|||
|
I found a website called pythonware.com, and so far its been a big help and i even got my program thing to work. Although, if you still know of some sources that would be great too. Thanks.
|
|
#3
|
|||
|
|||
|
I will assume you're using Tkinter, and say it is quite easy to clear the contents of an Entry or Text widget. Here is a quick example:
Code:
#clear an Entry widget entry_widget.delete(0,END) #clear a Text widget text_widget.delete(1.0,END) I'm not sure if you need to know how to set up a button to clear the widget, or just what method should be called to do it. If I didn't hit the nail on the head, let me know ![]() |
![]() |
| Viewing: Dev Shed Forums > Programming Languages > Python Programming > Noob With Widgets |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|
|