Re: Adding/removing rectangles from an NSImageView
Re: Adding/removing rectangles from an NSImageView
- Subject: Re: Adding/removing rectangles from an NSImageView
- From: Rob In der Maur <email@hidden>
- Date: Thu, 12 Feb 2004 09:47:32 +0100
James,
Thanks for your reply. I got it sorted out. It had nothing to do with
not displaying things properly. It was a stupid mistake in my algorithm
to remove the subviews. It should have been:
Relevant code for -endPageViewSheet:
int subviewCount = [[pageViewImageView subviews] count];
NSLog(@"About to remove %d subviews...", subviewCount);
for (i = 0; i < subviewCount; i++) {
RectangleView *rectView = [[pageViewImageView subviews]
objectAtIndex:0];
[rectView removeFromSuperviewWithoutNeedingDisplay];
// [pageViewImageView setNeedsDisplayInRect:[rectView frame]];
}
[pageViewImageView display];
// [pageViewSheet display];
This works ok now...
cheers,
Rob
On Feb 12, 2004, at 2:49, James Chen wrote:
Hi,
These are something might help.
On Feb 12, 2004, at 4:55 AM, Rob In der Maur wrote:
Relevant code from the -endPageViewSheet:
for (i = 0; i < [[pageViewImageView subviews] count]; i++) {
RectangleView *rectView = [[pageViewImageView subviews]
objectAtIndex:i];
[rectView removeFromSuperviewWithoutNeedingDisplay];
// tried [rectView removeFromSuperView] without effect
[pageViewImageView setNeedsDisplayInRect:[rectView bounds]];
line above changed to ==> [pageViewImageView
setNeedsDisplayInRect:[rectView frame]];
Because the parameter rectangle should be in pageViewImageView's
coordinate.
}
If this doesn't work, I guess the sheet didn't get a chance to redraw
itself before you close it.
So maybe you should force the sheet to draw by sending -display to
pageViewImageView before you close it.
Hope these help,
James
------------------------------------
Ulead Systems Inc.
James Chen
Software Engineer
Image Div.
------------------------------------
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.
- Rob In der Maur
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.