Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

rethish

macrumors member
Original poster
Oct 16, 2008
41
0
Hi,

I use a nscolorwell to change the back ground color of a nstextview.
I use an action method to do this task.

When I click the colorwell for the first time, the color panel window opens
and if I type in textview , the text color will be of the colorwell’s default color.

Is this colorwell default behaviour?

And if I select any color from the color panel the background color changes and if type
In textview, the text will also appear in the same color., which makes the text invisible.


I only want to change the back ground color of the textview.

Here is what I did:

-(IBAction)bgColwelaction:(id)sender
{

[textView setBackgroundColor:[bgColorwell color]];

}

Is anything missing?

Thank you in advance..

Rethish.
 

SRossi

macrumors regular
May 27, 2009
202
0
Glasgow, Scotland
I had exactly the same problem as you just last week.

I figured out that you cannot have the background change colour when the notification from the colorWell changes because it will also change the text colour.

Where is your colourWells set up? In a panel or the same window as the textView?

Stephen
 

SRossi

macrumors regular
May 27, 2009
202
0
Glasgow, Scotland
The way I ended up changing the background colour was placing the NSColorWell in a panel like "Preferences" and changing the colour from there.

Thats the only way that I got it to change the background without changing the text.

Although I'm sure there's someone with a easier solution.

Stephen
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.