SIGSEGV panic when no image is specified for a Button
Creating a button but not specifying a border image (widget.ButtonOpts.Image) creates a failure state when attempting to calculate PreferredSize. Since the button assumes Image.Idle will be non-nil.
It would be nice to not have to specify an Idle (or really any) NineImage for buttons without borders. For now I've set up a workaround using a transparent NewNineSliceColor.
That work-around is the current way to do it. I agree that a runtime panic like that with no info is not exactly user friendly. I will look into handling this better.
With the current commit I have added better error messaging. I have kept ButtonOpts.Image required as I still think the user of the library should be intentional about how their buttons look (i.e using a transparent nineslice). But, now you will get a clearer error message indicating that the Idle image is required on startup.
I am going to close this ticket for now. Thank you!
https://github.com/ebitenui/ebitenui/commit/d5405bee081a9863a7ad91b4d27542ce8e69a1f5