After compiled a glib resource bundle with some PNG icons (inside “/icons” path), I tried unsuccessfully to check out both Gtk::Window::set_icon_name() and Gtk::Image::set_from_icon_name().
I wrote the following C++/Gtkmm 4.0 code (irrelevant parts removed)
class Window
:
public Gtk::Window
{
public:
Window()
:
refIconTheme (Gtk::IconTheme::create())
{
refIconTheme->add_resource_path ("/icons");
for (auto & it : refIconTheme->get_icon_names())
std::cout << it << std::endl;
set_icon_name ("great-app-logo");
image.set_from_icon_name ("great-app-logo");
}
private:
Gtk::Image image;
Glib::RefPtr<Gtk::IconTheme> refIconTheme;
};
When listing, “great-app-logo” appears among the IconTheme icons; and Gtk::Image::set_from_resource (“great-app-logo.png”) runs fine, but not the case of set_icon_name (“great-app-logo”) and image.set_from_icon_name (“great-app-logo”), which shows the “missing-image” icon.