• 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
Re: NSDatePicker - can it be empty/blank?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSDatePicker - can it be empty/blank?


  • Subject: Re: NSDatePicker - can it be empty/blank?
  • From: George Orthwein <email@hidden>
  • Date: Thu, 8 Feb 2007 09:25:17 -0500

Thanks for the replies. I attempted to get an NSDatePickerCell subclass to draw just the background and stepper but not the date text, with no luck.

First I tried to override drawInteriorWithFrame: in my NSDatePickerCell subclass but it just didn't get called. Then I overrode drawWithFrame as a test:
- (void)drawWithFrame:(NSRect)cellFrame inView:(NSView *)controlView
{
[super drawInteriorWithFrame:cellFrame inView:controlView];
}


That did repress drawing the background/stepper. But what I got was text formatted like "Monday January..." instead of "01/12/2007...". So I'm concluding that NSDatePickerCell doesn't actually use drawInteriorWithFrame: to draw its text. From what I can tell, that leaves me with no way to just draw the background/stepper.

Now the thought occurred to me that I could just turn the text white for a blank date. But then I realized I wouldn't really want a random date to pop-in in black when the user clicks the field to enter a date. I'd probably want the date dividers "/" in black with empty spots for the date. I'd also have to hook up the delete key to clear the date.

Basically, it's looking like more work than I'm ready for at this point. I'm going to stick with a formatted text field and put this on the future todo list. Enhancement request filed.

George

_______________________________________________

Cocoa-dev mailing list (email@hidden)

Do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


References: 
 >NSDatePicker - can it be empty/blank? (From: George Orthwein <email@hidden>)
 >Re: NSDatePicker - can it be empty/blank? (From: Stephane Sudre <email@hidden>)

  • Prev by Date: Document object is not being released
  • Next by Date: Re: NSURLConnection vs WebKit
  • Previous by thread: Re: NSDatePicker - can it be empty/blank?
  • Next by thread: Struggling with basic AppleScript support
  • Index(es):
    • Date
    • Thread