Re: [gtkmm] Feature Wish: ad-hoc or external properties for simplified data binding



On Thu, Aug 05, 2004 at 02:26:31AM +0200, Christer Palm <palm nogui se> wrote:
> Andreas Pokorny wrote:
> >
> >I guess i have handled all common access types for values.
> >
> 
> Value "access" is only one of the challenges involved. Typically, you 
> may also need to handle conversion, formatting and validation. You also 
> typically need to be able to control under which conditions values are 
> transferred to/from the model, and in a multithreaded app there would 
> also be thread synchronization issues.
In a perfect world, validation and formating is done by the widget,
but it is still possible to add these features to the properties.
The same applies for conversion and multi threading, the concept allows
that, there was just no need for it yet. So I see these issues as a
possibility to save even more lines of code.

e.g. the validation feature would be a hook for the set part of the
property which would call a test method/signal/functor with a reference 
to the new value, and if the test fails a different
method/functor/signal is called with that value instead of setting the
property. 

I guess that this could still be done with a single initialization line.

Thank you for that cool idea. I will try to add these features in the next
weeks. 

Regards
Andreas Pokorny

Attachment: pgppezKEHzLro.pgp
Description: PGP signature



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