[Date Prev][Date Next] [Thread Prev][Thread Next]
[Thread Index]
[Date Index]
[Author Index]
Re: Entry "changed"
- From: Dan Rosen <dr cs brown edu>
- To: gtk-app-devel-list redhat com
- Subject: Re: Entry "changed"
- Date: Thu, 17 Jun 1999 15:37:00 -0400 (EDT)
> I am assuming that the second time the text is changed, it is not
> really changed, it is just set to the value that is already there. If
> this is not the case, you may have to do something differently. The
> way I have stopped loops like this is to check to see if the new value
> is different than the old value before setting it.
This isn't a totally reliable approach, though, for a couple reasons. The
obvious reason is that the mutually-mutating algorithm (did I just make up
a name?) could be one that doesn't "stop going" (that is, one where the
two fields aren't related by inverse functions or something). Of course,
the programmer would know when that is the case, and find a different way
around it. The real reason is that it is very prone to error when using
floating-point calculations. What you would hope is "the same" is often a
fraction off, even if only in the least significant bit, and it's not
effective programming style (unless doing graphics, or some such) to
redefine the equals operator as "within epsilon of".
I don't know if the "ignore this signal" is necessarily the Right Way of
doing things, but I would highly prefer it over an equality test....
Dan
[Date Prev][Date Next] [Thread Prev][Thread Next]
[Thread Index]
[Date Index]
[Author Index]