[comp.sys.mac.programmer] cdevs and the List Manager

mxmora@unix.SRI.COM (Matt Mora) (06/27/90)

In article <36518@shemp.CS.UCLA.EDU> tj@cs.ucla.edu (Tom Johnson) writes:

>over the list.  When the dialog is dismissed, the list is'n properly updated.
>I am doing an LUpdate when the cdev receives an Update msg, but it
>just doesn't seem to be doing the trick--the list is still there, but
>each cell appears empty, and the selection stuff is messed up (instead
>of boing able to select only one cell, you can select several).   


I had this problem in a library that I wrote using the list manager. I solved
it by invalidating the rect of the list manager before the update. This did
solve the problem but is probably not the best way to go. The whole idea of
the update routine is to only draw what really needs to be updated. Not to 
invalidate the whole mess and redraw it.

Does anybody know the real reason why the listmanager sometimes doesn't
update correctly? 

>Any ideas/suggestions/source code?
>Tom Johnson      UCLA Computer Science Department 






-- 
___________________________________________________________
Matthew Mora                |   my Mac  Matt_Mora@sri.com
SRI International           |  my unix  mxmora@unix.sri.com
___________________________________________________________

ech@cbnewsk.att.com (ned.horvath) (06/30/90)

From article <13580@unix.SRI.COM>, by mxmora@unix.SRI.COM (Matt Mora):
> ...The whole idea of
> the update routine is to only draw what really needs to be updated. Not to 
> invalidate the whole mess and redraw it.
> 
> Does anybody know the real reason why the listmanager sometimes doesn't
> update correctly? 

To add a bit more fuel to this thread: I've noticed that LUpdate does a 
ValidRect on the part of the window where the horizontal scrollbar is
drawn -- even if the list has no horizontal scrollbar.  I traced this one
through the 6.0.5 PACK0 code: sure enough, it tests for the presence of
a scrollbar, then (if there isn't one), branches around the draw routine
to the ValidRect.

If LUpdate is only being called between BeginUpdate and EndUpdate, this
doesn't matter.  But if LUpdate is being called after resizing the list,
this is annoying.  The only workaround I've found is to explicitly call
InvalRect after LUpdate.  I have not checked to see if the same problem
exists when there is no vertical scrollbar.

=Ned Horvath=