diff --git a/darwin/button.m b/darwin/button.m index 0efd5725..1813e1f7 100644 --- a/darwin/button.m +++ b/darwin/button.m @@ -116,6 +116,13 @@ void uiButtonSetMinSize(uiButton *b, int width, int height) libui_btn.minHeight = height; } +void uiButtonPreferredSize(uiButton *b, int *width, int *height) +{ + NSSize s = b->button.intrinsicContentSize; + *width = s.width; + *height = s.height; +} + void uiButtonOnClicked(uiButton *b, void (*f)(uiButton *, void *), void *data) { b->onClicked = f;