Skip to content

object: Add Gtk::make_managed<T>(args...) helper [gtkmm-3-24]

Daniel Boles requested to merge wip/dboles/make_managed-3 into gtkmm-3-24
    To avoid the discouraged pattern of manually writing `new` and get
    tidier syntax, follow the example of std::make_(unique|shared)() by
    adding a new helper function that both constructs and manages a widget
    in one call. The user will not need to `new` and can user fewer parens.
    
      auto button = Gtk::manage(new Gtk::Button("_Hi", true));
    
    becomes
    
      auto button = Gtk::make_managed<Gtk::Button>("_Hi", true);
    
    Switch to make_managed() in tests and demo, albeit nowhere else (yet?).

#33 (closed)

Edited by Daniel Boles

Merge request reports