gnumed-devel
[Top][All Lists]
Advanced

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

Re: [Gnumed-devel] re: using paint get around errors thrown on dispatche


From: Karsten Hilbert
Subject: Re: [Gnumed-devel] re: using paint get around errors thrown on dispatcher loop.
Date: Thu, 17 Mar 2005 13:44:29 +0100
User-agent: Mutt/1.3.22.1i

On Thu, Mar 17, 2005 at 09:11:40AM +1100, Syan Tan wrote:

> regetMixin is using the paint event to refresh the view when the model
> changes, by polling the model.
Correct.

> the dispatcher is supposed to notify receivers
Correct.

> by pushing model change to the receivers,
Wrong. It notifies receivers about the necessity to pull
changes from the model. Receivers may opt to ignore that
depending on their mood. No force-pushing around potentially
large stuff especially since the scope of the data change and
the scope of the data the receiver is interested in does not
match up 1:1 in most cases.

> but the loop fails if any of the receivers throw an uncaught exception.
Argh. Seems you have found a bug. Thanks. Will look at your
fix below.

> If the receiver send is wrapped in
> a try, catch block, and the exception is caught and logged in the 
> dispatcher, then the dispatcher will work as expected
Good.

>  so the polling with the paint event is not required. 
Wrong. We don't push. We pull. And the paint event merely
defers pulling until needed ...

> This basically isolates errors from one gui module to another.
That would be excellent.

> This means  a debugged ui module will refresh immediately
> when the model changes i.e. a new patient becomes the current patient.
Nope. Only when it becomes visible.

> This avoids the problem of the ui not updating until painting is required,
> e.g  when resizing.
Which is only a problem of *visible* UI elements - for which
it indeed IS a problem. Pushing changes would be a fix. But it
would be a fix with big hammer. I hope to find a better fix.

> Interestingly, the vaccination widget won't refresh to it's child listboxes
> until it is first resized, and then it will refresh with each patient 
> change thereafter.
> Since the paint event isn't being listened to explicitly,
It is, via the mixin class cRegetMixin.

> I think the dispatcher change is a good idea anyway.
Absolutely.

Karsten
-- 
GPG key ID E4071346 @ wwwkeys.pgp.net
E167 67FD A291 2BEA 73BD  4537 78B9 A9F9 E407 1346




reply via email to

[Prev in Thread] Current Thread [Next in Thread]