NSWindow doesnt update it's background on view resize
NSWindow doesnt update it's background on view resize
- Subject: NSWindow doesnt update it's background on view resize
- From: Robert Kuilman <email@hidden>
- Date: Thu, 24 Feb 2005 15:59:06 +0100
Hey all!
I have a NSWindow containing a NSScrollView, and a NSView.
I'm giving the user the option to hide the NSView and resize the NSScrollView to resize over where the NSView used to be.
When the NSView gets hidden, and the NSScrollView gets resized over it, it's okay. However, when the user wants to make the NSView visible again, and thus resizing the NSScrollView back to normal size, the space between the two views isnt redrawn. ( see http://www.skinner.ath.cx/temp/pics/drawingProblem.jpg the middle part is supposed to have a brushed metal background )
I've tried calling setNeedsDisplay on the views, but only calling -display, or -setViewNeedsDisplay: will make it update. but that comes with flashing all the controls in the window, which is ugly and should not be necessary.
Any Insights as to what i am doing wrong? the code i use for resizing the views, is below
Regards,
Robert K.
web: http://halfduplex.net/
email: email@hidden
---------------------------------------------------------------------------------------------
- (BOOL)visible {
if( visible == ![infoView isHidden] ) {
return;
}
float windowWidth = [familyWindow frame].size.width;
NSRect scrollViewFR = [[familyView enclosingScrollView] frame];
NSRect infoViewFR = [infoView frame];
if( visible ) {
scrollViewFR.size.width = windowWidth - (info_view_offset_from_familyView + (2*info_view_offset_from_window) + infoViewFR.size.width);
} else {
scrollViewFR.size.width = windowWidth - (2*info_view_offset_from_window);
}
[infoView setHidden:!visible];
[[familyView enclosingScrollView] setFrame:scrollViewFR];
// update the contents of the windows
[[familyView enclosingScrollView] reflectScrolledClipView:[[familyView enclosingScrollView] contentView]];
[[familyView enclosingScrollView] setNeedsDisplay:YES];
// i can force the update of the window, but that flashes the window's interface, which is ugly, and shouldnt be necessary
// [familyWindow setViewNeedsDisplay:YES];
RKPostNotification(kNotificationInfoViewVisibilityChanged);
}
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden