python 2.7 - Tkinter callback in a class -


I understand the concept callback button in the function and process. How can this code be implemented in class? I have a problem about the callback button in the tanker, to get value from the class. I can not use the callback method Erode program = Callback not defined. Tycanetter import * class program: def __init __ (self): self.root = Tk) self.root.title ("sample") self.display = entry (self.root) Self.display.grid (line = 1, column = 0, column = 5) button (self.root, text = "Proces" (width = 5, foreground = "blue", command = callback) .Grid (line = 4 , Column = 0) def callback (self): print hello program = programmable () menopause ()

What you need to do is use it: instead of command = self.callback command = callback



Comments

Popular posts from this blog

Java - Error: no suitable method found for add(int, java.lang.String) -

java - JPA TypedQuery: Parameter value element did not match expected type -

c++ - static template member variable has internal linkage but is not defined -