NSStepper + keyDown
NSStepper + keyDown
- Subject: NSStepper + keyDown
- From: Jeff Childers <email@hidden>
- Date: Sat, 20 Aug 2005 17:37:39 -0500
another newbie question
ok... what I have done
the normal subclass of nsview called stepperView
dropped in my custom view in IB and set the custom class
in IB I dropped a NSStepper and NSTextField into stepperView and cross
connected them with takeIntValueFrom
the problem:
if I have 1 stepperView object in IB all goes well but when I have
more than 1
the first stepperView I use works as expected but any of the rest do
not become first responder. Can someone help me out.
stepperView.m code to follow
- (id)initWithFrame:(NSRect)frameRect
{
[super initWithFrame:frameRect];
return self;
}
- (void)drawRect:(NSRect)rect
{
if ([[self window] firstResponder] == self){
}
}
- (BOOL)acceptsFirstResponder {
NSLog(@"Accepting");
return YES;
}
- (BOOL)becomeFirstResponder {
NSLog(@"Becoming");
[self setNeedsDisplay: YES];
return YES;
}
- (BOOL)resignFirstResponder {
NSLog(@"Resigning");
[self setNeedsDisplay: YES];
return YES;
}
//- (void)keyDown:(NSEvent *) event {
- (void)flagsChanged:(NSEvent *)event{
if (([event modifierFlags] & NSCommandKeyMask) != 0){
NSLog(@"10");
[[self viewWithTag:0] setIncrement:10];
}
else{
[[self viewWithTag:0] setIncrement:1];
NSLog(@"1");
}
}
- (void)dealloc
{
[super dealloc];
}
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden