On Monday 08 September 2003 06:55 pm, Christian Reis wrote:Pretty much all instances of write-only properties in GTK are ones that set some other property, but take a different format. For instance, setting the "markup" property on a gtk.CellRendererText object is equivalent to setting the "text" and "attributes" properties to appropriate values, however "markup" is not readable.
On Fri, Sep 05, 2003 at 11:57:22AM +0800, James Henstridge wrote:
On 4/09/2003 8:00 AM, Michael McLay wrote:Would it be possible to raise a proper exception in this case explaining
the GtkContainer::child property is write-only, which is why you getI received an odd warning when testing the use of get_property. Accessing the 'child' property for a button returns the message:
(:2640): Gtk-WARNING **: ../../gtk/gtkcontainer.c:874: invalid property id 3 for "child" of type `GParamObject' in `GtkButton'
c.get_property('child')
(:2640): Gtk-WARNING **: ../../gtk/gtkcontainer.c:874: invalid property id 3 for "child" of type `GParamObject' in `GtkButton'
Here's the code that caused this to happen.
weird results when trying to read it. The other cases are most likely
similar.
it is write-only?
I'm curious, what is the purpose of a write-only property? Under what circumstances would it be advantagous to not be able to do introspection on a property? Even if this does raise a special "Write-Only" exception, it still requires a special work around for code that is looking to probe the state of the object.
The GtkContainer "child" property looks more like a convenience. Setting the property adds the widget to the container. However, GtkContainer can have multiple children, so it isn't clear what should be returned when reading it.
James.
-- Email: [EMAIL PROTECTED] WWW: http://www.daa.com.au/~james/
_______________________________________________ pygtk mailing list [EMAIL PROTECTED] http://www.daa.com.au/mailman/listinfo/pygtk Read the PyGTK FAQ: http://www.async.com.br/faq/pygtk/