• 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
changing NSTextView text colour
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

changing NSTextView text colour


  • Subject: changing NSTextView text colour
  • From: James Maxwell <email@hidden>
  • Date: Sun, 6 Jun 2010 10:21:12 -0700

I have a NSTextView that's displaying MIDI info from my app's current MIDI input device. I show this info in a couple of places - one is in a "MIDI Setup" type window, and the other is in an Inspector window. I want the Inspector window to show this data in light grey text against a dark background (whereas the MIDI Setup window shows it in black on white).
I'm doing this from my MIDI controller class, which is instantiated as a nib in IB. The controller has an IBOutlet to the desired text view. In the controller's init I tried just setting the foreground colour of my text view's textStorage, but that didn't work -- it still displays as black text. It does work to do this:

[[mainWindowMIDIMonitor textStorage] setForegroundColor:[NSColor lightGrayColor]];
[mainWindowMIDIMonitor performSelectorOnMainThread:@selector(setString:) withObject:monitorInfo waitUntilDone:NO];

But it doesn't display the first input in light grey. It starts out as black, than changes after the first entry... go figure...
Is there no way to just permanently set the text colour to light grey once? Do I have to have the controller hold a reference to the text view, rather than just using an outlet?

J.


James B Maxwell
Composer/Doctoral Student
School for the Contemporary Arts (SCA)
School for Interactive Arts + Technology (SIAT)
Simon Fraser University
email@hidden
email@hidden

_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

  • Follow-Ups:
    • Re: changing NSTextView text colour
      • From: Michael Ash <email@hidden>
    • Re: changing NSTextView text colour
      • From: Ross Carter <email@hidden>
    • Re: changing NSTextView text colour
      • From: Graham Cox <email@hidden>
  • Prev by Date: Re: detecting touch and hold vs touch in UIButton
  • Next by Date: Re: detecting touch and hold vs touch in UIButton
  • Previous by thread: AUTO: Bill Abt is out of the office. (returning 06/14/2010)
  • Next by thread: Re: changing NSTextView text colour
  • Index(es):
    • Date
    • Thread