How can I add a custom property to a widget?

Hi, I’m using gtkmm4, I need to set a simple boolean value to a gtkmm button.
I found this example: c++ - glibmm/gtkmm custom property explanation/example request - Stack Overflow, but it requires for me to create a derived class which I don’t want.
I tried to understand if I can add a custom property to an existing widget class, but the documentation isn’t very helpfull: glibmm: Glib::ObjectBase Class Reference
Please refer me to an example of how to set a custom property to a widget, thx!

You need to create a derived class.

Thx for the quick reply

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.