The description of Glib::ValueBase says * Glib::Value<> is specialized for almost
any type used within the glibmm and gtkmm libraries. "Almost any type" does not include
Glib::DateTime, unfortunately. And "All flags and enum types" is not quite right.
There are some enum types, especailly in glibmm, without a
Glib::Value specialization. I think this Glib::Value<Glib::DateTime> specialization will work: namespace Glib On 2019-04-23 15:01,
p sun fun gmail com wrote:
Thanks, Kjell. I missed that gobj() returns a pointer to gobject_. However, the returned type is not a pure C gtype. Let me illustrate this by example: ``` Glib::Value<Glib::DateTime> data; data.init(data.value_type()); const GValue *val = data.gobj(); std::cout << "val type is " << G_VALUE_TYPE_NAME(val) << std::endl; GValue *val2 = g_new0(GValue, 1); g_value_init(val2, G_TYPE_DATE_TIME); std::cout << "val2 type is " << G_VALUE_TYPE_NAME(val2) << std::endl; ``` In stdout I see ``` val type is glibmm__CustomBoxed_N4Glib8DateTimeE val2 type is GDateTime ``` I know that GDateTime is a boxed type and Glib::Value registers it own type. If I use built-in type, e.g. int, I see the same type for C++ and C parts. Basically, my question should be refined and tailed to the conversion of C++ gtype (boxed equivalent) to the C-like gtype. Thanks. |