Determining underline style and mask?
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