• 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
Determining underline style and mask?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Determining underline style and mask?


  • Subject: Determining underline style and mask?
  • From: Keith Blount <email@hidden>
  • Date: Sat, 21 Apr 2007 16:50:33 -0700 (PDT)

Hello,

What is the best way of determining an underline style
and mask?

For instance:

int underlineStyle = NSUnderlineStyleDouble |
NSUnderlineByWordMask;

BOOL isSingle = (underlineStyle &
NSUnderlineStyleSingle);
BOOL isDouble = (underlineStyle &
NSUnderlineStyleDouble);
BOOL byWord = (underlineStyle &
NSUnderlineByWordMask);

In the above, both isSingle and isDouble return a
non-zero value, but byWord returns a zero value.

This:

int underlineStyle = NSUnderlineStyleSingle |
NSUnderlineByWordMask;

	BOOL isSingle = (underlineStyle &
NSUnderlineStyleSingle) == NSUnderlineStyleSingle;
	BOOL isDouble = (underlineStyle &
NSUnderlineStyleDouble) == NSUnderlineStyleDouble;
	BOOL byWord = (underlineStyle &
NSUnderlineByWordMask) == NSUnderlineByWordMask;

Returns non-zero for everything.

I really just need to determine whether an underline
style is single or double, and whether it has the
NSUnderlineByWordMask set, but this is proving more
difficult than I had anticipated. Presumably this is
because of my poor use of the "&" operator?

Thanks in advance for any help,
Keith




__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around
http://mail.yahoo.com
_______________________________________________

Cocoa-dev mailing list (email@hidden)

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: Determining underline style and mask?
      • From: Martin Wierschin <email@hidden>
  • Prev by Date: Re: Removing subview crashes host application
  • Next by Date: Correct way to create a subview at runtime
  • Previous by thread: [ANN] Verpack and UKSyntaxColoredTextDocument 0.4
  • Next by thread: Re: Determining underline style and mask?
  • Index(es):
    • Date
    • Thread