Skip to content

Button Callback function with arguments auto run #166

@wsimm

Description

@wsimm

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:

 def __init__(self):
     self.w = Window((100, 40))
     self.w.button = Button((10, 10, -10, 20), "A Button",
                        callback=self.buttonCallback('somedata'))
     self.w.open()

 def buttonCallback(self, sender):
     print("button hit!")

ButtonDemo()`

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions