hmmm... i got the point. I applied it in image case. b1=button(root,image=None,height=4,width=4,command=ok)
and then ok defination is as follows : def ok(): b1["image"]=photo now problem is that after clicking on the button, image is coming up like a flash and then button becomes almost to zero size. I want to retain the height=4,width=4 along with the image after clicking on the button. Image size is smaller than the button size. On Tue, Feb 15, 2011 at 5:58 PM, Alan Gauld <alan.ga...@btinternet.com>wrote: > > "ANKUR AGGARWAL" <coolankur2...@gmail.com> wrote > > > I am looking for a method using Tkinter module to update the button on the >> click. >> > > Define an event handler command for the button. > Lets call it sayHi() > > def sayHi(self): > self.myButton['text'] = 'hi' > # Note:event handlers don't return results so store it as an attribute > self.myButtonResult = 'hi' > > Now create the widget with spam as the handler. > > self.myButton = Button(parent, text='hello', command = spam) > > That's it. > > > the its click should be "hi". I tried it through event handling but failed >> to do so. >> > > It would be more helpful if you posted the code that you tried > and a more detailed explanation of "failed to do so". > What happened? Did it update but not store a value? > Did you get an error message? Did anything happen? > > The more specific information you provide the more likely you > are to get a specific solution that works. > > HTH, > > > -- > Alan Gauld > Author of the Learn to Program web site > http://www.alan-g.me.uk/ > > > _______________________________________________ > Tutor maillist - Tutor@python.org > To unsubscribe or change subscription options: > http://mail.python.org/mailman/listinfo/tutor >
_______________________________________________ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor