Is there a reason why user_data() (or some other application-specific data) 
can't be used for this?

On Dec 12, 2011, at 11:44 AM, Domingo Alvarez Duarte wrote:
> I'm proposing to add a second changed flag to Fl_Widget, this second one  
> will not be reseted after a callback like the actual one is.
> 
> I'm working with windows with several Fl_Inputs and some of then uses  
> callback to allow calculations when the value changes, but at the end I  
> need to know which ones have changed over the session and because the  
> CHANGED flag is cleared after the callbacks this information is lost.
> 
> With a second flag that is not reset by the callback I can easily get the  
> changes over the section.
> 
> I think that this can be util for more people and for FLTK as well, so I  
> propose to add to the official distribution, this change is transparent  
> for applications that do not use it explicitly, so all code made till now  
> should work as before.
> 
> CHANGED2         = 1<<22, ///< the widget value changed and is not reseted  
> by the callback call
> 
>   unsigned int changed() const {return flags_&CHANGED;}
>   unsigned int changed2() const {return flags_&CHANGED2;}
> 
>   /** Marks the value of the widget as changed.
>       \see changed(), clear_changed()
>    */
>   void set_changed() {flags_ |= (CHANGED|CHANGED2);}
>   void set_changed2() {flags_ |= CHANGED2;}
> 
>   /** Marks the value of the widget as unchanged.
>       \see changed(), set_changed()
>    */
>   void clear_changed() {flags_ &= ~CHANGED;}
>   void clear_changed2() {flags_ &= ~CHANGED2;}
>   void clear_changed_all() {flags_ &= ~(CHANGED|CHANGED2);}
> _______________________________________________
> fltk-dev mailing list
> fltk-dev@easysw.com
> http://lists.easysw.com/mailman/listinfo/fltk-dev

_____________
Michael Sweet

_______________________________________________
fltk-dev mailing list
fltk-dev@easysw.com
http://lists.easysw.com/mailman/listinfo/fltk-dev

Reply via email to