Go Back   MacRumors Forums > Apple Systems and Services > Programming > Mac Programming

Reply
 
Thread Tools Search this Thread Display Modes
Old Jun 2, 2009, 03:23 AM   #1
rethish
macrumors member
 
Join Date: Oct 2008
changing background color of a textview using colorwel?l

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)bgColwelactionid)sender
{

[textView setBackgroundColor:[bgColorwell color]];

}

Is anything missing?

Thank you in advance..

Rethish.
rethish is offline   0 Reply With Quote
Old Jun 2, 2009, 06:36 AM   #2
SRossi
macrumors regular
 
Join Date: May 2009
Location: 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
__________________
macMini, 2.0 GHz Core 2 Duo, 1 GB RAM, 120GB hd;
Dell S2209W 21.5" monitor;
iPhone 4GS 16GB;
30 GB iPod video;
SRossi is offline   0 Reply With Quote
Old Jun 3, 2009, 05:27 AM   #3
rethish
Thread Starter
macrumors member
 
Join Date: Oct 2008
Quote:
Originally Posted by SRossi View Post

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

Stephen
hi,

I use the colorwell and the textview in the same window.

Thankyou
rethish is offline   0 Reply With Quote
Old Jun 3, 2009, 01:04 PM   #4
SRossi
macrumors regular
 
Join Date: May 2009
Location: 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
__________________
macMini, 2.0 GHz Core 2 Duo, 1 GB RAM, 120GB hd;
Dell S2209W 21.5" monitor;
iPhone 4GS 16GB;
30 GB iPod video;
SRossi is offline   0 Reply With Quote

Reply
MacRumors Forums > Apple Systems and Services > Programming > Mac Programming

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Similar Threads
thread Thread Starter Forum Replies Last Post
UIWebview background color DennisBlah iPhone/iPad Programming 0 May 24, 2014 12:26 PM
pages background color fleeper Mac Applications and Mac App Store 2 Sep 1, 2013 08:34 PM
UITableView separators don't show after changing table background color straber iPhone/iPad Programming 7 Feb 19, 2013 07:41 PM
Tabs Background Color caseydean iPhone and iPod touch Apps 1 Nov 29, 2012 02:05 AM
Background picture changing traincollection Mac Pro 2 Oct 20, 2012 05:56 AM

Forum Jump

All times are GMT -5. The time now is 11:45 AM.

Mac Rumors | Mac | iPhone | iPhone Game Reviews | iPhone Apps

Mobile Version | Fixed | Fluid | Fluid HD
Copyright 2002-2013, MacRumors.com, LLC