public abstract class Object
extends org.freedesktop.bindings.Proxy
This is the wrapper around GObject
!
Methods here provide the mechanism to get and set "properties" on the
underlying GObject
s. As a deliberate design decision to ensure
type safety, however, these are not exposed for public use. To offer a
getter or setter for a property, a java-gnome subclass must expose an
explicitly named method. For example, to set the righteous
property, (assuming that the GObject
in question has such a
property, that it is writable, and that it takes a string), create a method
like this:
public void setRighteous(String value) { setPropertyString("righteous", value); }The use of a String property name is, of course, insanely type-unsafe, which is why we don't expose it in our public API. Luckily, though, in general it is not necessary to use this at all, as most
GObject
s provide convenience methods for such things, and
should be used in preference wherever available.
It is probably also worth noting that these code paths are less
efficient by about 8:1 as a GValue
must be constructed as a
wrapper around the data for the property being set. While that's not too
expensive in C, from Java (and from all other language bindings of GTK) it
requires allocation and initialization of the wrapper structure which
really is just throw away.