Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8089381
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T19:22:41+00:00 2026-06-05T19:22:41+00:00

How do I draw an inner shadow on a text in Cocoa for Mac

  • 0

How do I draw an inner shadow on a text in Cocoa for Mac OS X?

I am subclassing NSView to create a placeholder control with a gradient background and an inner shadowed text title over it.

All current Core Graphics answers on stackoverflow seem to explain drawing text shadows on Cocoa Touch.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-05T19:22:42+00:00Added an answer on June 5, 2026 at 7:22 pm

    You might think too complicated. If I get your problem right, the only thing you actually want to do is to set the text style. Then do so by simply using:

    [[object cell] setBackgroundStyle:NSBackgroundStyleRaised];
    

    where object is an instance of the class NSTextField.

    This handles everything for you. Your gradient background then could be reached for example by using a custom view with a NSGradient. See here

    Advantage: You have a proper instance of NSTextField without the need to subclass it or to do other unneeded things like implementing everything a NSTextField does in a subclass of NSView on your own.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am trying to draw an inner shadow in an NSView. The shadow itself
How to draw watermark text whose outline color is red and inner color is
I draw a line on a google map than I create a string like:
I draw the text using CTFramesetter, I have set kCTParagraphStyleSpecifierParagraphSpacing , kCTParagraphStyleSpecifierLineSpacing , kCTParagraphStyleSpecifierParagraphSpacingBefore
I would like to animate a radial gradient to shrink and grow the inner
I have a problem making an inner class that extends from JPanel to draw
I have an NSBezierPath and I want to draw in inset shadow (similar to
I draw a text along a path with Keith Wood's jQuery SVG plugin. How
I want to do something similar to Photoshops inner shadow effect in Core Graphics.
Does anyone know of existing code that lets you draw fully justified text in

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.