[Glade-devel] Property Binding: Fixing the big blocker



Am 15.11.2011 20:59, schrieb Tristan Van Berkom:
Denis,
     Thanks for taking time to send this mail, it's good that we archive
this plan which we drafted in our irc session for future reference.

Because this GBinding thing is turning out to be complex, what I really
want (and I think you might have missed that, sorry if I wasn't clear) is
an explanation of how recording sensitivity in the undo/redo stack
solves the GBinding branch problems.

Oh, I missed that indeed. My bad.

The problem is that without recording sensitivity changes, we cannot 
cleanly detect property bindings that become invalid due to these 
changes and must be removed (or, at least, warned about).

For instance, imagine that you bound some widget's property to the 
"label" property of a button (that is, "label" is the source). Now you 
change the type of the button's content from "Label" to "Custom Widget". 
Clearly, the binding makes no sense anymore - there is no label anymore 
to get a source value from. So setting the "label" property insensitive 
should have the side effect of removing the binding, undoably (that is, 
as a command). But there is no sensible place in the code to do this at 
the moment.

If, on the other hand, there were a 
glade_command_set_property_sensitive(), that function could check for 
bindings that are going to become invalid and invoke further undoable 
commands to remove them. This would ensure that setting a property 
insensitive and removing all affected bindings is always a single, 
atomic, undoable operation.

I hope this answers your question.

Regards,
Denis




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