Re: Setting custom Glib::Property values in Gtk::Builder .ui XML



On 6/10/19 10:25 AM, Daniel Boles via gtkmm-list wrote:
 Do you think it would be possible, or worth thinking about, to add ways to do this (and probably custom signals) in C++? It would be nice if we could add properties and signals to the class without having to go into C (or rather, by having glibmm do that for us). Properties especially, to make them usable with GtkBuilder .ui files as mentioned.
It's probably possible, but I don't know how difficult it will be. I don't volunteer, at least not for the foreseeable future.

If such properties can be added, could they still be used with Glib::PropertyProxy, or does it require its target property to have been fully created by Glib::Property?

_WRAP_PROPERTY("visible", bool) in Gtk::Widget generates the code

Glib::PropertyProxy<bool> Widget::property_visible()
{  return Glib::PropertyProxy<bool>(this, "visible"); }

Glib::PropertyProxy_ReadOnly< bool > Widget::property_visible() const
{  return Glib::PropertyProxy_ReadOnly<bool>(this, "visible"); }

If custom properties are registered like glib/gtk+ register properties, I see no reason why similar code should not work for the custom properties.



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