[java-gnome-hackers] Style properties
Brought to you by:
afcowie
From: Andrew C. <an...@op...> - 2010-09-09 02:14:50
|
I just landed a branch that, among other things, exposes a "style property" for the first time. Style properties are a bit weird; to us as programmers they are read-only¹. But sometimes you want to know what they are set to for your own drawing purposes, and so I figured out how to expose the "scrollbar-spacing" style property from ScrolledWindow. As with other properties, it is just public int getScrollbarSpacing() Widget has a gtk_widget_style_get_property() that uses a GValue as an out-parameter, so I was able to use most of our existing GValue infrastructure in an analogous fashion [org.gnome.glib] Object's protected getPropertyInteger() etc. This one uses Widget's protected getStylePropertyInteger(). AfC Sydney ¹ Actually, they CAN be changed, care of the .gtkrc file system. I've been trying to figure that one out for ages. If you follow the documentation around, we could create Widget's getStyle() returning a GtkStyle, except that you're not supposed to use that. Meanwhile, there's GtkRcStyle, but you create those by reading a file... weird. -- Andrew Frederick Cowie Operational Dynamics is an operations and engineering consultancy focusing on IT strategy, organizational architecture, systems review, and effective procedures for change management: enabling successful deployment of mission critical information technology in enterprises, worldwide. http://www.operationaldynamics.com/ Sydney New York Toronto London |