• 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
NSStepper + keyDown
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


  • Prev by Date: Re: Strange Managed Context Error
  • Next by Date: Finding next / previous characters in an alphabet?
  • Previous by thread: Re: open docs at quit time
  • Next by thread: Finding next / previous characters in an alphabet?
  • Index(es):
    • Date
    • Thread