Replies: 3 comments
|
You have to assign the callback without the 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() |
0 replies
|
how to pass some data through the arguments ? |
0 replies
|
The callback is called by vanilla, and it passes the "sender" argument. You don't pass it arguments yourself. What are you trying to do? |
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
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()`
All reactions