4

I'm writing an application using C++ and gtkmm. I made a Gtk stack in it. Now I want to add images instead of text on stackswitcher's buttons. I assume that it's possible because something like this is made in gtk3-demo:

Unfortunatelly the example is made using UI file and I want to do it without UI designer. For now I found this answer:

But it's not very helpful to me. The answer was to use stack.child_set_property but I checked gtkmm documentation for stack and there isn't anything like this for C++. The closest match was Gtk::Stack::child_property_name with adnotation that it returns A ChildPropertyProxy that allows you to get or set the value of the property, or receive notification when the value of the property changes. I suppose this may be the thing i'm looking for, but due to lack of examples I have no idea how to use it.

To sum up: Is anyone able to tell me how to set an image as StackSwitcher's label?

creyD
  • 1,972
  • 3
  • 26
  • 55
P.B.
  • 190
  • 3
  • 17

1 Answers1

4

Ok, it seems I've found an answer. I'll post it if anyone needs it in the future: To change Stack Switcher's text label into image I just needed to do that:

stack->child_property_icon_name(ChildName) = "Icon Name";
P.B.
  • 190
  • 3
  • 17