www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.learn - gtk: get property

reply Johnson Jones <JJ Dynomite.com> writes:
I am trying to get the handle size of panned. Not sure if I'm 
doing it right but

Value value = new Value();
paned.getProperty("handle-size", value);


GLib-GObject-CRITICAL **: g_object_get_property: assertion 
'G_IS_VALUE (value)' failed

or I get stuff like

GLib-GObject-WARNING **: g_object_get_property: object class 
'GtkStyle' has no property named 'handle-size'

if I do

mainPaned.getStyle().getProperty("handle-size", value);

I haven't been able to figure out how to get it.


I've also tried

mainPaned.getStyle().getStyleProperty(...

but the first parameter is a GType which is suppose to be the 
widget type yet I am getting value types like INT BOOl, etc.

Not sure if there are two types of GTypes

enum GType : size_t
{
	INVALID = 0<<2,
	NONE = 1<<2,
	INTERFACE = 2<<2,
	CHAR = 3<<2,
	UCHAR = 4<<2,
	BOOLEAN = 5<<2,
	INT = 6<<2,
	UINT = 7<<2,
	LONG = 8<<2,
	ULONG = 9<<2,
	INT64 = 10<<2,
	UINT64 = 11<<2,
	ENUM = 12<<2,
	FLAGS = 13<<2,
	FLOAT = 14<<2,
	DOUBLE = 15<<2,
	STRING = 16<<2,
	POINTER = 17<<2,
	BOXED = 18<<2,
	PARAM = 19<<2,
	OBJECT = 20<<2,
	VARIANT = 21<<2,
}

If that what I'm suppose to use then not sure which one I use for 
Paned ;)
Aug 05 2017
parent reply Gerald <gerald.b.nunn gmail.com> writes:
On Saturday, 5 August 2017 at 15:08:21 UTC, Johnson Jones wrote:
 I am trying to get the handle size of panned. Not sure if I'm 
 doing it right but

 [...]
I'm using this in Tilix: Value handleSize = new Value(0); paned.styleGetProperty("handle-size", handleSize);
Aug 05 2017
parent Johnson Jones <JJ Dynomite.com> writes:
On Saturday, 5 August 2017 at 15:19:43 UTC, Gerald wrote:
 On Saturday, 5 August 2017 at 15:08:21 UTC, Johnson Jones wrote:
 I am trying to get the handle size of panned. Not sure if I'm 
 doing it right but

 [...]
I'm using this in Tilix: Value handleSize = new Value(0); paned.styleGetProperty("handle-size", handleSize);
Awesome! Thanks! I didn't see that method in the list of 1000's of function in Visual D ;/ Figured everything that was a getter started with get.
Aug 05 2017