• 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
Best way to implement a calculator style display/input system?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Best way to implement a calculator style display/input system?


  • Subject: Best way to implement a calculator style display/input system?
  • From: Dave Camp <email@hidden>
  • Date: Wed, 23 Jun 2004 17:53:45 -0700

I was wondering if anyone might have suggestions for the best way to implement a "calculator" style (for lack of a better term) text display and input handler.

My app has a view like the standard Calculator app with a colored background and text and numbers displayed on top of that. I essentially want the user to be able to press keys and have the corresponding characters appended to the display and have the delete key work as well. Like the Calculator app, there are no visual indicators for the insertion point or focus.

My first thought was to have the window delegate implement keydown: and tack printable characters onto the end of a NSTextField. I would have to manually handle the delete key and remove characters as needed.

However, I thought a cleaner design might be possible with an NSTextView if there was an easy way to make it not display the focus ring and insertion point, and have it always be the first responder. It seems like it would be preferable to allow the text system to perform all the key event processing for me.

Any suggestions?

Dave
---
In English, every word can be verbed.
_______________________________________________
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: Best way to implement a calculator style display/input system?
      • From: "Mark A. Stratman" <email@hidden>
    • Re: Best way to implement a calculator style display/input system?
      • From: Douglas Davidson <email@hidden>
  • Prev by Date: Re: Showing Alerts
  • Next by Date: Custom IB Palettes with Outlets and Actions
  • Previous by thread: Re: Forcing NSSplitView to constrain position?
  • Next by thread: Re: Best way to implement a calculator style display/input system?
  • Index(es):
    • Date
    • Thread