Re: GObject property validation during object construction
- From: cecashon aol com
- To: link sub-pop net, gtk-list gnome org
- Subject: Re: GObject property validation during object construction
- Date: Wed, 7 Jun 2017 14:28:19 -0400
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]