Copyright 2004 by M. Uli Kusterer Fri, 29 Nov -1901 11:06:32 GMT Comments on article ukprogresspanel-oh-two at Zathras.de http://www.zathras.de/angelweb/ukprogresspanel-oh-two.htm ukprogresspanel-oh-two Comments witness_dot_of_dot_teachtext_at_gmx_dot_net (M. Uli Kusterer) witness_dot_of_dot_teachtext_at_gmx_dot_net (M. Uli Kusterer) en-us Comment 1 by uwe http://www.zathras.de/angelweb/ukprogresspanel-oh-two.htm#comment1 http://www.zathras.de/angelweb/ukprogresspanel-oh-two.htm#comment1 Found a couple of minor things and a bug (to reproduce the bug use
your test app and press the "test button" a couple of times to add
tasks to the tasks panel. then stop a couple of them in the middle.
bug should be obvious from there :-) )

Here are some diffs that fix that stuff

regards

uwe

diff UKProgressPanelTask.m
~/Downloads/UKProgressPanel_02/UKProgressPanel/UKProgressPanelTask.m
108d107
< [inUse setName:@"UKProgressPanelTask.inUse"];
137,138c136
< [inUse unlock];
<
---
>
173c171
< -(void) animate: (id)sender { if( [inUse tryLock] ) {
UK_DEBUG_PRINT(@"%lx: animating", self); NSProgressIndicator* pb =
[progressBar copyMainThreadProxy]; [pb startAnimation: sender]; [pb
display]; [pb release]; [inUse unlock]; } }
---
> -(void) animate: (id)sender { if( [inUse tryLock] ) { UK_DEBUG_PRINT(@"%lx: animating", self); NSProgressIndicator* pb = [progressBar copyMainThreadProxy]; [pb animate: sender]; [pb display]; [pb release]; [inUse unlock]; } }


diff UKProgressPanel.m
~/Downloads/UKProgressPanel_02/UKProgressPanel/UKProgressPanel.m
227c227,228
< NSUInteger pos = [subs indexOfObject: elementsView];
---
> unsigned int pos = [subs indexOfObject: elementsView];
> NSEnumerator* elEnum = [subs objectEnumerator];
228a230,231
> unsigned int x;
> NSView* currElemView = nil;
240,250c243,253
<
< subs = [taskContentView subviews];
< NSUInteger i;
<
< for (i = pos; i < [subs count]; i++) {
< NSView *currElemView = [subs objectAtIndex:i];
<
< NSPoint currOrigin = [currElemView frame].origin;
< currOrigin.y -= sizeGone.height;
< [currElemView setFrameOrigin: currOrigin];
< [currElemView setNeedsDisplay:YES];
---
>
> // Move down elements above the one we're removing:
> for( x = 0; currElemView = [elEnum nextObject]; x++ )
> {
> if( x > pos )
> {
> NSPoint currOrigin = [currElemView frame].origin;
> currOrigin.y -= sizeGone.height;
> [currElemView setFrameOrigin: currOrigin];
> [currElemView setNeedsDisplay:YES];
> }