Hi all,

Please help ...

I use nscolorwell to set the backgroundcolor of the textview. It works with
the code [textview setBackgroundColor:[colorwel color]];

But there is some problem .

The problem is,

I have a textview and if I click the colorwell , the text which is to be
typed appear in the that color, which is currently active in the colorwel.
ie ., background and foreground colors become the same.

Whenever I activate  the colorwell by clicking  the nscolorwell instance
these things happen.

After activating the colorwell ,if we select any colors from that colorwell
The backgroundcolor changes and the foregroundcolor changes to the same
color if we type.

Here is the code:

-(IBAction)colorwellaction:(id)sender
{        

    
    
    NSTextStorage *store =[textview textStorage];
    NSRange range=[ textview selectedRange];



    if([textview shouldChangeTextInRange:range replacementString:nil])
    {
            [store addAttribute:NSBackgroundColorAttributeName value:nil
range:range];
            
            [textview setBackgroundColor:[colorwell color]];
            [textview didChangeText];
    }


    
}


I want the colorwell to act ,only when any color from it is selected,
Not at the time of activation .


Please help..

searching for an answer for it, for weeks
I am really fedup withit....


Thanks inadvance

regards





_______________________________________________

Cocoa-dev mailing list ([email protected])

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [email protected]

Reply via email to