Skip to content

Commit

Permalink
(minor) Seperating some stuff into - [YRSolcounter initTextField]
Browse files Browse the repository at this point in the history
  • Loading branch information
ELLIOTTCABLE committed Jun 11, 2010
1 parent 10a5efc commit feff948
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
1 change: 1 addition & 0 deletions YRSolcounter.h
Expand Up @@ -20,6 +20,7 @@
}

-(id) initWithBundle: (NSBundle*)bundle;
-(void) initTextField;
-(void) handleTimer: (NSTimer*)_;

@end
9 changes: 6 additions & 3 deletions YRSolcounter.m
Expand Up @@ -25,11 +25,16 @@ -(id) initWithBundle: (NSBundle*)bundle {
userInfo: nil
repeats: YES];

NSNib *nib = [[NSNib alloc] initWithNibNamed: @"Solcounter" bundle: bundle];
NSNib *nib = [[[NSNib alloc] initWithNibNamed: @"Solcounter" bundle: bundle] autorelease];

[nib instantiateNibWithOwner: self topLevelObjects: /* sets `textField` */ nil];
[self setView: textField];

[self initTextField];
return self;
}

-(void) initTextField {
NSRect frame = [textField frame];
[textField setFrame: NSMakeRect(frame.origin.x, frame.origin.y, frame.size.width, frame.size.height - 1)];
[[textField cell] setBackgroundStyle: NSBackgroundStyleRaised];
Expand All @@ -43,8 +48,6 @@ -(id) initWithBundle: (NSBundle*)bundle {
lastObject], 18.0, NULL);

[self handleTimer: nil];
[nib dealloc];
return self;
}

-(void) handleTimer: (NSTimer*)_ {
Expand Down

0 comments on commit feff948

Please sign in to comment.