control autoresizing problem
control autoresizing problem
- Subject: control autoresizing problem
- From: Chuck Soper <email@hidden>
- Date: Sun, 25 Apr 2004 09:59:24 -0700
I've had an issue for several months with autoresizing various
controls particularly NSImageView. Until yesterday I was unsure how
to explain the issue. Here's one way to reproduce it:
1. Download the Sproing sample code at:
http://developer.apple.com/samplecode/Sproing/Sproing.html
2. Remove the minimum size constraint of the 'main' window in the
nib. I change Minimum h/w to 0/0; IB sets h/w to 130/5. (This is not
the issue I'm concerned about.)
3. Set the autoresizing for the NSBox in the main (Sproing) window
(either in the nib or by running the Sproing application) as follows:
[myView setAutoresizingMask: NSViewWidthSizable | NSViewMaxXMargin |
NSViewMinYMargin | NSViewHeightSizable];
4. Run Sproing (or test the interface in IB) and drag the bottom edge
of the window above the top edge of the NSBox.
Notice that the top edge of the NSBox permanently shifts upward and
can be positioned above the top edge of the window (off-screen). In
my application I have an NSImage with the same autoresizing
attributes. The NSImage instance is positioned below other controls
(NSTextField's etc.). When I reduce the height of the window, the
NSImage moves upward and is drawn on top of or behind other controls.
I realize that I can avoid this behavior by constraining the height
of the window, but I don't want to do that.
How can I avoid this behavior? Can I prevent the NSImage from moving
upward by changing its frame while resizing the window? Has anyone
else run into this problem?
Chuck
_______________________________________________
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.