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

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


  • Subject: Temporary text display over NSTableView (was NSTextField over NSImageView?)
  • From: James Bucanek <email@hidden>
  • Date: Sun, 23 Apr 2006 08:20:32 -0700

Greetings,

All of this discussion about drawing order and using NSViews to draw over other NSViews brings me to a (hopefully) simple feature that I've been meaning to add to my application for months.

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?

--
James Bucanek
 _______________________________________________
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

  • Follow-Ups:
    • Re: Temporary text display over NSTableView (was NSTextField over NSImageView?)
      • From: Ricky Sharp <email@hidden>
    • Re: Temporary text display over NSTableView (was NSTextField over NSImageView?)
      • From: Ondra Cada <email@hidden>
References: 
 >Re: Superimpose a NSTextField over NSImageView? (From: glenn andreas <email@hidden>)

  • Prev by Date: Re: Weird bug with selection in Textview with custom textcontainer [solved]
  • Next by Date: Re: Temporary text display over NSTableView (was NSTextField over NSImageView?)
  • Previous by thread: Re: Superimpose a NSTextField over NSImageView?
  • Next by thread: Re: Temporary text display over NSTableView (was NSTextField over NSImageView?)
  • Index(es):
    • Date
    • Thread