• 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
Re: Centering an NSAttributedString in a line in a view
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Centering an NSAttributedString in a line in a view


  • Subject: Re: Centering an NSAttributedString in a line in a view
  • From: Matt Neuburg <email@hidden>
  • Date: Wed, 19 Jul 2006 12:25:50 -0700
  • Thread-topic: Centering an NSAttributedString in a line in a view

On Wed, 19 Jul 2006 14:29:52 -0400, Michael Tsai <email@hidden> said:
>On Jul 19, 2006, at 1:50 PM, email@hidden wrote:
>
>>  (gdb) po parsty (* just after that line has been executed *)
>> Alignment 2, LineSpacing 0, ParagraphSpacing 0,
>> ParagraphSpacingBefore 0,
>> HeadIndent 0, TailIndent 0, FirstLineHeadIndent 0, LineHeight 0/0,
>> LineHeightMultiple 0, LineBreakMode 0, Tabs (288C, 576R),
>> DefaultTabInterval 0, Blocks (null), Lists (null),
>> BaseWritingDirection
>> -1, HyphenationFactor 0, TighteningFactor 0.05, HeaderLevel 0
>>
>>   All I understand here is that the Alignement parameter has been
>> modified in parsty, exactly as I wanted.
>>   What am I supposed to ``see right away" here ? Is there some
>> parameter
>> that should be nonzero ?
>
>I think the alignment of the page number is handled by the right-
>aligned tab stop, so changing the alignment of the paragraph won't
>make a difference

Right. But you're not the guy I was trying to teach! :) I was going on the
theory that it's better to teach someone to fish than hand them a fish.

By thinking about what Alignment 4 means (what is what I wanted to get the
OP to think about), one realizes (eventually) that the text position was not
caused by the paragraph being originally right-aligned (because it wasn't);
therefore changing the alignment won't affect it.

However, the beans now having been spilled, here's a possible version of the
desired fish:

- (NSAttributedString*) pageFooter {
 NSAttributedString* s = [super pageFooter];
 return [s attributedSubstringFromRange:NSMakeRange(1,[s length]-1)];
}

m.

--
matt neuburg, phd = email@hidden, <http://www.tidbits.com/matt/>
A fool + a tool + an autorelease pool = cool!
AppleScript: the Definitive Guide - Second Edition!
<http://www.amazon.com/gp/product/0596102119>



 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

  • Follow-Ups:
    • Re: Centering an NSAttributedString in a line in a view [SOLVED]
      • From: email@hidden
  • Prev by Date: Re: Autoreleasepool problems
  • Next by Date: Re: NSSearchField Categories Menu (bug?!)
  • Previous by thread: Re: Centering an NSAttributedString in a line in a view
  • Next by thread: Re: Centering an NSAttributedString in a line in a view [SOLVED]
  • Index(es):
    • Date
    • Thread