Window resize indicator changes
Window resize indicator changes
- Subject: Window resize indicator changes
- From: glenn andreas <email@hidden>
- Date: Wed, 12 Apr 2006 09:50:02 -0500
I've got a window that has a button that explicitly resizes the
window to show additional information (click the button the window
double in sizes to show an additional table, click again to hide that
half of the window).
That additional information includes a tab view that includes some
tables (the tab view has a hidden border, so it basically switch
between different "detail" panes). When the window gets expanded and
the tab view shows a table, the resize indicator changes to have a
solid white background (since it overlaps a scroll bar). When the
tab view is changed to something without a scroll bar, the resize
indicator changes back, like expected.
The problem is that if the "show/hide" button is clicked while the
resize indicator has the white background, it stays like that, and
since that button is near the bottom corner, the white square ends up
being on top of the button.
I've tried hiding the resize indicator before changing the window
sizes and showing it afterwards, but that doesn't seem to help.
So any ideas how to tell the window "go back to the 'no white
background' resize indicator"?
The code I'm using looks like this:
NSWindow *window = [myDetailsTab window];
[window setShowsResizeIndicator: NO];
NSSize oldSize = [[window contentView] frame].size;
NSRect frame = [myDetailsTab frame]; // is this visible?
[(NSView *)[window contentView] setAutoresizesSubviews:NO];
NSSize sizeLimit = [window minSize];
if ( show) {
// show details pane
[window setContentSize:NSMakeSize(oldSize.width + frame.size.width,
oldSize.height)];
sizeLimit.width += frame.size.width;
} else {
// hide details paine
[window setContentSize:NSMakeSize(oldSize.width - frame.size.width,
oldSize.height)];
sizeLimit.width -= frame.size.width;
}
[window setMinSize:sizeLimit];
[(NSView *)[window contentView] setAutoresizesSubviews:YES];
[[window contentView] setNeedsDisplay: YES];
[window setShowsResizeIndicator: YES];
where myDetailsTab occupies the right hand half of the window (which
is the part that is shown/hidden).
If I manually resize the window, it seems to fix itself, but then
suffers the reverse problem (i.e., if a table view is shown, toggling
the details view back to visible causes the resize indicator to be
the transparent one, rather than the solid white one, which overlaps
the bottom arrow of the scroll bar until I manually resize it again).
Glenn Andreas email@hidden
<http://www.gandreas.com/> wicked fun!
quadrium | build, mutate, evolve | images, textures, backgrounds, art
_______________________________________________
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