Re: Suppresing events to avoid fibrillation
- From: Daniel Pitts <newsgroup.spamfilter@xxxxxxxxxxxxxxxxxxx>
- Date: Wed, 30 Dec 2009 20:06:45 -0800
Roedy Green wrote:
I run into this problem frequently. I call it fibrillation.Use a shared model amongst all your views. Don't listen for changes on a particular visual element, but instead have the business logic handled in your model. This also will help prevent coupling your business model to GUI.
Lets say I do a setText on some component. This triggers an event on
it. That event handler then might do setText's on other components.
If you are really unlucky, you get a circularity.
What would like to do is a sneaky programmatic setText that does NOT
trigger any events, other than perhaps a repaint.
What I have been doing is somewhat klutzy. I have some ad hoc
booleans. When I don't want an event to be acted on, I set the
boolean, then detect it in the event handler, and turn it off.
You need one boolean for each possible event that might be triggered.
If it is not triggered, the event improperly stays suppressed.
Is there a clean way to do this?
The other possibility is to check for an actual "difference" in value before setting off other events.
--
Daniel Pitts' Tech Blog: <http://virtualinfinity.net/wordpress/>
.
- References:
- Suppresing events to avoid fibrillation
- From: Roedy Green
- Suppresing events to avoid fibrillation
- Prev by Date: Re: Suppresing events to avoid fibrillation
- Next by Date: International Journal of Electronics, Information and Systems (IJEIS) Call for Paper
- Previous by thread: Re: Suppresing events to avoid fibrillation
- Next by thread: International Journal of Electronics, Information and Systems (IJEIS) Call for Paper
- Index(es):
Relevant Pages
|