Closed wsimm closed 2 years ago
You have to assign the callback without the ('somedata')
bit (which is calling it on the spot).
from vanilla import Window, Button
class ButtonDemo:
def __init__(self):
self.w = Window((100, 40))
self.w.button = Button((10, 10, -10, 20), "A Button",
callback=self.buttonCallback)
self.w.open()
def buttonCallback(self, sender):
print("button hit!")
ButtonDemo()
Hi, when I create a button with a callback function with arguments it auto runs the function assigned
`from vanilla import Window, Button
class ButtonDemo:
ButtonDemo()`