A Clickless Button?

Hi -
I’d like to trigger a button action by simply waiving my mouse over the field (without clicking). I looked at the Button help file, but I suspect that might not be the way of doing such a task. Any advice on an approach would be appreciated.

Is this the vibe you are looking for:

(
w = Window().acceptsMouseOver_(true);
b = Button().mouseOverAction_{w.close};
w.layout_(HLayout(b));
w.front
)

the window has to have acceptsMouseOver set to true and the button needs a mouseOverAction and you should be golden.

Sam

1 Like

Try mouseEnterAction:

w = Window.new.front;
b = Button(w, Rect(10, 10, 100, 100));
b.mouseEnterAction_({“I can do something!”.postln});

1 Like