Trivial feature request

Please add a default constructor to Button.


1 Like

it’s a base class for several button types that all have their own unique abilities and are tied to certain lookAndFeel methods. rather than giving button a default constructor i’d suggest reinventing button entirely so that all button-types are in button itself so it’s not an inheritance-thing anymore

We just override button, set the behaviour ourselves, and ignore the lookandfeel stuff which doesn’t work in our use cases. So it’s quite annoying that there’s no default constructor :slight_smile:

in that case you could ditch button completely as well. writing a custom button with the mouse event methods (like mouseUp etc) with basic functionality takes less than 50 lines and everything else is up to your imagination then

I just want Button() = default; adding.

You aren’t going to talk me out of it :slight_smile:


IMO all widgets should have default constructors, even base classes.

Also agree that Button could be a concrete type of its own. TextButton, ImageButton, etc. could all just be different types of content you give a button.

Funnily the ToggleButton has such a default constructor and also has to add a dummy value just because of this: