Re: GObject property validation during object construction




Hi Link,

My understanding is that the private string gets setup in my_object_class_init(). Then in my_object_init() you can initialize it to a default value. After that, you can set a new string value using a property set accessor function that can validate the string and/or you can use CSS for a string value.

Worked on a couple of gauge widgets which the setup might be helpful. The adjustable_gauge_main() test programs validate some color strings from a GtkEntry. If the string isn't validated a simple warning is issued but the current or default value isn't changed.

https://github.com/cecashon/OrderedSetVelociRaptor/tree/master/Misc

They are in the adjustable gauge folders with the test programs for them. Also there is a Penrose folder with an object that uses CSS. That came from the GTK+ C++ or gtkmm tutorial which has a lot of great info.

https://developer.gnome.org/gtkmm-tutorial/stable/sec-custom-widgets.html.en

Eric






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