osx - Render multi line centered text similar Icon View in OS X Finder -


how render multi-line centered text, limited specific frame size, along inserting … (ellipsis) char when text doesn't fit?

background:

i developing custom view mimicks os x finder's "as icons" view, label position set "bottom". in view mode, file names appear below icons in 2 rows, (with ascii art bounding frame):

+------------------------+ |  long file name   | | gets centered…rest.jpg | +------------------------+ 

i understand nstextfield can accomplish that, not completely: settings "wrap" , "truncate last visible line" (as offered in xcode's ib), ends this:

+------------------------+ |  long file name   | | gets centered , mor… | +------------------------+ 

i.e, truncates text @ end , not in middle of last visible line.

also, cannot use nscontrol need render text graphics context instead.

is there framework function can this, or code private finder , i'll need rewrite myself?


Comments

Popular posts from this blog

shopping cart - Page redirect not working PHP -

php - How to modify a menu to show sub-menus -

python - Installing PyDev in eclipse is failed -