Re: #50218 - Notification on write-only properties is questionable/problematic

On 03/26/01 Owen Taylor wrote:
> As a concrete example, for GtkTextTag there's a write-only "foreground"
> property that is the color name as a string. You can also set the color as
> a GdkColor. In a GUI builder, conceivably you want people to be able to
> enter the color as a string, but you can't really do that since
> you can't display the current color as a string.

"#ffffff" looks like a fine color to me:-)
The point is if it's possible to return a value that's
"equivalent" instead of equal. This may not apply to all cases, though.

> Anyway, I'm thinking perhaps notification should be disabled for write-only
> properties, since it only conveys that the property was touched, there's no
> way to get the new value or display the value.
> In my experience write-only properties are only used for a different way to
> set some readable property. So there is always some other property that
> should be used for notification in these cases.

There is no guarantee for that, though. Maybe we should make it work
linking the write_only param to a readable one and the notification
is sent on the readable one whenever the first is changed.
This is basically a different way of returning an "equivalent" value.

Or the notification for write-only params is done right away (instead of
queued) so that the new value can be included in the signal emission
and inspected by the signal handlers. Since these kind of params
should be rarely used anyway, it shouldn't be a performance penalty.
It's not pretty, though. 

Either way, we should provide notifications (with the actual values
changed) for write-only params or somehow enforce the notification
on equivalent properties (writing "you will be damned if you don't do it!" 
in the documentation could be enough:-).


lupus debian org                                     debian/rules
lupus ximian com                             Monkeys do it better

[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]