Hello<div>I changed the code as follows.But still the callback function is not working.</div><div>The he() is working well but clicking on the frame has no result.</div><div><br></div><div><br></div><div><div>class app:</div>
<div><span class="Apple-tab-span" style="white-space:pre">        </span> def __init__(self,root):</div><div><span class="Apple-tab-span" style="white-space:pre">                </span>frame=Frame(root)</div><div><span class="Apple-tab-span" style="white-space:pre">                </span>frame.bind("<Button-1>", callback)</div>
<div><span class="Apple-tab-span" style="white-space:pre">                </span>frame.pack()</div><div><span class="Apple-tab-span" style="white-space:pre">                </span>self.button=Button(root,text='quit',fg='red',command=frame.quit)</div>
<div><span class="Apple-tab-span" style="white-space:pre">                </span>self.button.pack(side='left')</div><div><span class="Apple-tab-span" style="white-space:pre">                </span>self.hi=Button(root,text='hi',fg='SystemWindowFrame',command=self.hi)</div>
<div><span class="Apple-tab-span" style="white-space:pre">                </span>self.hi.pack(side='right')</div><div><span class="Apple-tab-span" style="white-space:pre">                </span>self.callback</div><div><span class="Apple-tab-span" style="white-space:pre">        </span> def hi (self):<span class="Apple-tab-span" style="white-space:pre">                </span>print 'hello! there'</div>
<div><span class="Apple-tab-span" style="white-space:pre">        </span> def callback(self,event): </div><div> print "clicked at", event.x, event.y</div><div><br></div><div> </div>
<div>>>> root=Tk()</div><div>>>> xx=app(root)</div><div>>>> root.mainloop()</div><div>hello! there</div><div>hello! there</div><div><br></div></div>