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:
@ -469,11 +469,11 @@ int a_Dialog_user_password(const char *title, const char *msg,
|
||||
window->add(ok_button);
|
||||
|
||||
/* "Cancel" button */
|
||||
Fl_Button *cancel_button =
|
||||
new EnterButton(50, y, 100, button_h, "Cancel");
|
||||
auto cancel_button =
|
||||
std::make_unique< EnterButton >(50, y, 100, button_h, "Cancel");
|
||||
cancel_button->labelsize(14);
|
||||
cancel_button->callback(Dialog_user_password_cb);
|
||||
window->add(cancel_button);
|
||||
window->add(cancel_button.release());
|
||||
|
||||
y += button_h + 20;
|
||||
window_h = y;
|
||||
|
||||
Reference in New Issue
Block a user