Re: Gtk::Entry::set_icon_from_icon_name(nullptr) segmentation fault



On 26 July 2017 at 08:20, Martijn Otto via gtkmm-list <gtkmm-list gnome org> wrote:
I must admit I had missed that function, after reading the
documentation describing the usage of a "nullptr" to clear the image I
assumed that was the GTK way of doing things.


Well, yeah, it's a way, in that usually you can use a set() method with its argument being suitably-typed equivalent of 'empty' or 'null' to achieve unsetting. However, in many or perhaps most cases, there is an unset() to make things simpler, and IMO that is better API and should be offered/used where possible.

If you find any cases where there isn't an unset and the set(empty) is unintuitive or clumsy, then it's probably worth submitting an enhancement to Bugzilla - probably on the GTK+ side, since typically gtkmm just prefers to wrap what GTK+ offers.

That said, as you will have noticed, it's not uncommon for gtkmm to add extra convenience methods that GTK+ probably never will - especially when that "never will" is because the gtkmm methods depend on C++ convenience features. So it's possibly you'll find something that would be better done on the gtkmm side.



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]