• 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
NSColorWell----please help
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

NSColorWell----please help


  • Subject: NSColorWell----please help
  • From: rethish <email@hidden>
  • Date: Wed, 07 Jan 2009 14:54:13 +0530

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@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: NSColorWell----please help
      • From: Martin Wierschin <email@hidden>
  • Prev by Date: Re: [iPhone] Search control like in App Store
  • Next by Date: Re: NSColorWell----please help
  • Previous by thread: Re: "Cannot finalize a class object"
  • Next by thread: Re: NSColorWell----please help
  • Index(es):
    • Date
    • Thread