• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: resizing a NSView
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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];


  • Follow-Ups:
    • Re: resizing a NSView
      • From: email@hidden (Henri Hansen)
References: 
 >resizing a NSView (From: email@hidden (Henri Hansen))

  • Prev by Date: Re: NSWorkspaceDidTerminateApplicationNotification bug?
  • Next by Date: Re: NSFileManager buggy?!?
  • Previous by thread: resizing a NSView
  • Next by thread: Re: resizing a NSView
  • Index(es):
    • Date
    • Thread