Re: [sigc] conditions in libsigc



Roel Vanhout wrote:
> 
> If I understand what you describe correctly, I think it would be very 
> useful, but only is it's not restricted to bool variables. I'd like to 
> have a way to 'mark' a (member) variable (eg by wrapping it in a 
> template) which would then automagically emit a signal when that 
> variable is changed (that is what you're proposing, right?), but in my 
> usecases that would hardly ever be a bool, more likely a string, numeric 
> value or complex type. Then again, how would this work with complex 
> types? Say:
> 
> class A
> {
> public:
>    int m_Int;
> }
> 
> class B
> {
> public:
>    A m_A;
> }
> 
> B.m_A.m_Int = 5;
> 
> Who should emit a signal - only m_Int or m_A also, because that object 
> has changed, too?
> 
> I'm drifting away from the original question I'm afraid, I was just 
> braindumping :)

Yes, it is useful, but I was thinking of something like this

  sigc::condition  condition = entry.is_not_empty_trimmed () & check_box.is_selected ();
  Gtk::SensivityController  controller (condition, some_widget);

You hardly need anything other than boolean variables for this kind of
stuff.  (Pointer vs. reference stuff etc. is not thought off yet, I'm
basing on a Java implementation.)

Any type of variable might be useful, but standard operators for
boolean variables (and, or, not) are _very_ convenient to have.

Paul





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