• 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
resizing a NSView
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

resizing a NSView


  • Subject: resizing a NSView
  • From: email@hidden (Henri Hansen)
  • Date: Tue, 15 Jan 2002 19:17:41 +0100

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

or something with:

[myDocView drawRect:r];

has no effect :-(

My view has the following method:

-(void) drawRect:(NSRect)rect
{
NSRect bounds = [self bounds];

[[NSColor greenColor] set];
[NSBezierPath fillRect:bounds];
}

I realy need some guidence or help, because I don't see why this is
working with the window and not with the view --- in both cases I'm only
changing their framesize???

thanks a lot

greetings henri


  • Follow-Ups:
    • Re: resizing a NSView
      • From: Stéphane Sudre <email@hidden>
  • Prev by Date: Re: NSWorkspaceDidTerminateApplicationNotification bug?
  • Next by Date: Re: Calling an Applescript from Cocoa Java App
  • Previous by thread: Re: Dock icon position
  • Next by thread: Re: resizing a NSView
  • Index(es):
    • Date
    • Thread