Re: resizing a NSView
Re: resizing a NSView
- Subject: Re: resizing a NSView
- From: Stéphane Sudre <email@hidden>
- Date: Tue, 15 Jan 2002 19:47:34 +0100
On Tuesday, January 15, 2002, at 07:17 PM, Henri Hansen wrote:
Hi
I'd like to write a little application to manipulate images. Therfore,
when one opens an image, I want to display the image in a window, which
has the same size as the image.
In order to learn how to resize a window and a subclass of a view I
greated a small ap with some TextFields and Buttons to read and set the
size of the window and the view (a subclass of NSView). The resizing of
the window by seting its frame
[myWindow setFrame:r display:YES];
where r is a NSRect. But a similar procedure with the view:
[myDocView setFrame:r];
[myDocView setNeedsDisplay:YES];
This code is working for me:
[IBresizableView_
setFrameSize:NSMakeSize(tSize.width,-tSize.height+SIZE_DIFF)];
[[IBresizableView_ superview] setNeedsDisplay:YES];