• 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: Temporary text display over NSTableView (was NSTextField over NSImageView?)
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Temporary text display over NSTableView (was NSTextField over NSImageView?)


  • Subject: Re: Temporary text display over NSTableView (was NSTextField over NSImageView?)
  • From: Ondra Cada <email@hidden>
  • Date: Sun, 23 Apr 2006 17:33:04 +0200

James,

On 23.4.2006, at 17:20, James Bucanek wrote:

When a user opens a new document window they get an empty NSTableView -- this is not very informative. I'd like to superimpose some subtle text (light grey or semi-transparent) over the center of the table to the effect of "To add items to the table, drag and drop them here." This text would go away as soon as the table was no longer empty.

What would be the sane+Cocoa way of accomplishing this?

- I know that I could simply override the NSTableView's drawing routine and draw my text directly into the view after the table is finished drawing. I've been putting this off because it just seems like a lot of work (get a font, measure it, calculate a centering rectangle, ...).

- Using NSTextField would make less work for me because it would handle all of the centering, clipping, wrapping, etc. of the text (and I could localize the message in the NIB). But where do I stick it in the NSView hierarchy and how to I keep it centered over the table? From the earlier thread, it appears that just cramming it into the same NSView that the NSTableView is in is a bad idea. On the other hand, making an NSTextField a subview of an NSTableView just seems bizarre and I'm afraid of messing up the NSTableView's subview(s).

Any suggestions from the NSView mavens out there?

To be frank, I would do neither: most probably I would add a child semi-transparent click-through window overlay with whatever "intro views" needed. As soon as the user begins editing in the parent window, I would remove the child.
---
Ondra Čada
OCSoftware: email@hidden http://www.ocs.cz
private email@hidden http://www.ocs.cz/oc



Attachment: smime.p7s
Description: S/MIME cryptographic signature

 _______________________________________________
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

References: 
 >Temporary text display over NSTableView (was NSTextField over NSImageView?) (From: James Bucanek <email@hidden>)

  • Prev by Date: Temporary text display over NSTableView (was NSTextField over NSImageView?)
  • Next by Date: Re: Trying to read PICT data using Quartz functions
  • Previous by thread: Temporary text display over NSTableView (was NSTextField over NSImageView?)
  • Next by thread: Re: Temporary text display over NSTableView (was NSTextField over NSImageView?)
  • Index(es):
    • Date
    • Thread