• 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
Problems with tabbing between custom text fields
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Problems with tabbing between custom text fields


  • Subject: Problems with tabbing between custom text fields
  • From: Alex Penner <email@hidden>
  • Date: Sat, 20 Mar 2004 22:05:37 +0100
  • Envelope-to: email@hidden

Hi,

I'm trying to implement custom text field that acts mostly like from iCal or Address Book: looks normally like a label, but get a background and border while selected.

The code works so far, if I select fields with a mouse. If I'm tabbing between fields these draw correctly, but there is no cursor in selected Field and I cannot input anything (just getting those "error sound" on key press).

I'm sure this one is a pretty basic question, but I found no answer in Cocoa Archive :-(


Thanks and best regards,
Alex


My code...

@interface LabelTextField : NSTextField
{}
@end

...

- (void)showAsLabel:(BOOL)flag{
[self setBordered:!flag];
[self setDrawsBackground:!flag];
}

- (id)initWithFrame:(NSRect)rect{
if (self = [super initWithFrame:rect])
[self showAsLabel:YES];
return self;
}

- (BOOL)becomeFirstResponder{
[self showAsLabel:NO];
[self setNeedsDisplay];
return YES;
}

- (BOOL)resignFirstResponder
{
[self showAsLabel:YES];
[self setNeedsDisplay];
return YES;
}
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.


  • Follow-Ups:
    • Re: Problems with tabbing between custom text fields
      • From: Allan Odgaard <email@hidden>
  • Prev by Date: Re: Loading a default file in doc based app
  • Next by Date: How about assembling and posting "Frequently Asked Questions"
  • Previous by thread: Re: Programmatically Create Login Item
  • Next by thread: Re: Problems with tabbing between custom text fields
  • Index(es):
    • Date
    • Thread