Re: Win32 & timer


Subject: Re: Win32 & timer
From: Martin Sevior (msevior@mccubbin.ph.unimelb.edu.au)
Date: Sun Nov 12 2000 - 20:37:02 CST


On Sun, 12 Nov 2000, Sam TH wrote:

> On Mon, Nov 13, 2000 at 12:54:45AM +0100, Mike Nordell wrote:
> > I just noticed a _really_ strange behaviour. The Win32 Lists dialog get
> > messages every timer tick, and that timer seems to be ticking, let me tell
> > you.
> >
> > Now why (the hell) would a dialog want to recieve timer messages?
> >
> > The simple and abvious answer to this is "unless it has a 'control' to
> > update every second (and I sure hope we have nothing like that) it should
> > not get timer messages".
> >
> > I won't fix this anomaly until someone at least comments on it, but then I
> > will kill this behaviour (it's a bug in our framework, and I think it
> > connects to my post about Windows and Views).
>
> Well, it may be that the timer should be in the XP part of the dialog, but
> Martin has timer code in lists for a reason. Try this. Create a list
> with the toolbar, open the lists dialog, select the list in the document,
> and turn off the list. The list dialog should update to reflect these
> changes.
>
> This has to do with the whole idea of modeless dialogs, which I actually
> like quite a lot.
>

This is the reason in a nutshell. The preview window displays the
characteristics of the list the cursor currently resides within. When the
cursor moves rather than setup a listener to the cursor motion change I
setup a timer to update the dialog if the cursor has moved.

I think that doing things this way (with the timer) is a defensible way of
working around not running a background thread. Tacking a list update to
every cursor motion could really slow down performance.

 I have some more fixes for Unix and xp to go in Real Soon Now to improve
this. If you look at the timer call-back in Unix you'll see that I do a
test to see something has changed since since the previous update. If not
I just return.

However Mike, I'm surprised you haven't yet bitterly complained about the
really ugly way I construct the unique (void *) pointers needed for the
fake list elements used in the preview. Feel free to explain the right way
to do this :-) Remember every pointer must be unique.

Cheers

Martin
 



This archive was generated by hypermail 2b25 : Sun Nov 12 2000 - 20:37:16 CST