[Tutor] help in TKINTER

Alan Gauld alan.gauld at btinternet.com
Tue Aug 16 10:10:13 CEST 2011


On 16/08/11 05:31, aditya wrote:
> Hello tutors,
>
> I wanted some help in using the Tkinter class for button creation, I am
> not able to add on click events i.e. when I press the button certain
> action should be performed for example if I press the button named 5,
> then it should display 5 in the text field .

The default behaviour for a button is to do nothing.
If you want it to do something you will need to assign a
command action, usually a function or method name.

But without seeing your code (or at least short sample code)
we can't begin to guess what you might be doing wrong...

If you look at the GUI programming topic in my tutorial you
will see various short programs including some adding a button
and an associated action.

-- 
Alan G
Author of the Learn to Program web site
http://www.alan-g.me.uk/



More information about the Tutor mailing list