callback strangeness?
Rob Gayvert
rtg at rochester.rr.com
Tue Mar 15 19:53:52 UTC 2005
Cees de Groot wrote:
> On Tue, 15 Mar 2005 18:40:30 +0100, Cees de Groot <cg at cdegroot.com>
> wrote:
>
>> However, I just realized that the p2p search sends global
>> references, not actual objects, in some cases. Reference resolution
>> times out after two seconds, so that could be the cause of this.
>> I'll investigate more...
>
> Yup. That's it. I paint different icons in the list, the test needs
> to resolve a global network link to see what icon needs to be
> returned. So the #onGetItemImage: callback takes around 2 seconds.
> This seems to severely mess up everything else (which, IMHO, means
> that there are still some holes in the call back handling - whether
> the callback takes 2 nanoseconds or 2 years should not make a
> difference in how wxSqueak works, should it?)
>
> Oh well, not much I can do to that for now, can I?
With a virtual list control, #onGetItemImage: get called once for each
item in the list each time that the list is displayed, so if the
callback takes a significant amount of time this is going to make the
GUI very unresponsive. I think you'd be much better off with some kind
of asynchronous update to the list.
That's not to say that the callback handling doesn't have holes, because
it does ;) But even after we get it plugged, it will be a good policy
to keep callbacks as short as possible to make the UI feel fast.
More information about the Wxsqueak
mailing list