Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 30 lines (22 sloc) 0.632 kb
dc5be1c Initial check-in.
uli authored
1 //
2 // NSView+SetFrameSizePinnedToTopLeft.m
3 // AngelTemplate
4 //
5 // Created by Uli Kusterer on 14.10.06.
6 // Copyright 2006 M. Uli Kusterer. All rights reserved.
7 //
8
9 #import "NSView+SetFrameSizePinnedToTopLeft.h"
10
11
12 @implementation NSView (UKSetFrameSizePinnedToTopLeft)
13
14 -(void) setFrameSizePinnedToTopLeft: (NSSize)siz
15 {
16 NSRect theBox = [self frame];
17 NSPoint topLeft = theBox.origin;
18 topLeft.y += theBox.size.height;
19
20 [[self superview] setNeedsDisplayInRect: theBox]; // Inval old box.
21
22 theBox.size = siz;
23 topLeft.y -= siz.height;
24 theBox.origin = topLeft;
25 [self setFrame: theBox];
26 [self setNeedsDisplay: YES];
27 }
28
29 @end
Something went wrong with that request. Please try again.