Manage an FLTK cancel button via smart ptr.

It's still `release()`'d, but I can make a cleaner
wrapper which explicitly type-enforces the ownership
transfer.

That will come later.
This commit is contained in:
2025-04-12 04:07:13 -04:00
parent d1d4653477
commit 07485c7959

View File

@ -469,11 +469,11 @@ int a_Dialog_user_password(const char *title, const char *msg,
window->add(ok_button); window->add(ok_button);
/* "Cancel" button */ /* "Cancel" button */
Fl_Button *cancel_button = auto cancel_button =
new EnterButton(50, y, 100, button_h, "Cancel"); std::make_unique< EnterButton >(50, y, 100, button_h, "Cancel");
cancel_button->labelsize(14); cancel_button->labelsize(14);
cancel_button->callback(Dialog_user_password_cb); cancel_button->callback(Dialog_user_password_cb);
window->add(cancel_button); window->add(cancel_button.release());
y += button_h + 20; y += button_h + 20;
window_h = y; window_h = y;