NSTextTab at the rightmost edge of view

  • I'm trying to programatically set a right-aligned text tab at the
    rightmost edge of my text view.

    I've tried to set the tab stop location in terms of the width of the
    text view, and in terms of the width of the text container, but
    setting such a tab stop at this extreme offset seems to have the
    effect of causing the tabbed text to disappear.

    It was a guess to assume that the units were in pixels/points, but it
    seems right. I know it's *close* to the right units, because when I
    subtract 10.0 from the width, regardless of what it is, I get roughly
    the desired behavior (text right-aligned to the edge of the view).

    How can I find out the maximum tab location for a given textview/
    container, that will actually work as expected? The "minus 10.0" trick
    works for now, but I'm a little wary.

    Thanks for your help,
    Daniel
  • On Feb 15, 2008, at 4:22 PM, Daniel Jalkut wrote:

    > I'm trying to programatically set a right-aligned text tab at the
    > rightmost edge of my text view.
    >
    > I've tried to set the tab stop location in terms of the width of the
    > text view, and in terms of the width of the text container, but
    > setting such a tab stop at this extreme offset seems to have the
    > effect of causing the tabbed text to disappear.
    >
    > It was a guess to assume that the units were in pixels/points, but
    > it seems right. I know it's *close* to the right units, because when
    > I subtract 10.0 from the width, regardless of what it is, I get
    > roughly the desired behavior (text right-aligned to the edge of the
    > view).
    >
    > How can I find out the maximum tab location for a given textview/
    > container, that will actually work as expected? The "minus 10.0"
    > trick works for now, but I'm a little wary.

    Daniel,

    It can be a little tricky figuring out where all the various bits of
    space go, but there's a pretty good diagram at <http://developer.apple.com/documentation/Cocoa/Conceptual/TextStorageLayer/
    Tasks/Region.html
    >.  Take a look at (a) the text container inset and (b) the line
    fragment padding and see if either of those corresponds to what you're
    seeing.

    Douglas Davidson
  • Thanks - I don't think I've reviewed this particular section of the
    documentation. I will take a look and try to re-evaluate. Can you help
    me by clarifying which of these "areas" the units of a tab stop are
    reckoned against?

    Daniel

    On Feb 15, 2008, at 8:27 PM, Douglas Davidson wrote:

    > Daniel,
    >
    > It can be a little tricky figuring out where all the various bits of
    > space go, but there's a pretty good diagram at <http://developer.apple.com/documentation/Cocoa/Conceptual/TextStorageLayer/
    Tasks/Region.html
    > >.  Take a look at (a) the text container inset and (b) the line
    > fragment padding and see if either of those corresponds to what
    > you're seeing.
    >
    > Douglas Davidson
  • I'm pretty sure they're reckoned against the text container inset.
    The line fragment padding is mostly used within the text container
    and I haven't really seen it referenced anywhere else in the text
    system (however line fragment rects are, which are based off of the
    line fragment padding).

    Hope this helps,

    ->Ben
    --
    Ben Lachman
    Acacia Tree Software

    http://acaciatreesoftware.com

    <blachman...>
    740.590.0009

    On Feb 17, 2008, at 2:32 AM, Daniel Jalkut wrote:

    > Thanks - I don't think I've reviewed this particular section of the
    > documentation. I will take a look and try to re-evaluate. Can you
    > help me by clarifying which of these "areas" the units of a tab
    > stop are reckoned against?
    >
    > Daniel
    >
    > On Feb 15, 2008, at 8:27 PM, Douglas Davidson wrote:
    >
    >> Daniel,
    >>
    >> It can be a little tricky figuring out where all the various bits
    >> of space go, but there's a pretty good diagram at <http://
    >> developer.apple.com/documentation/Cocoa/Conceptual/
    >> TextStorageLayer/Tasks/Region.html>.  Take a look at (a) the text
    >> container inset and (b) the line fragment padding and see if
    >> either of those corresponds to what you're seeing.
    >>
    >> Douglas Davidson

  • Thanks, Ben. And thanks again, Douglas.

    I think I might have to file my original report under "confused." I
    just went back in and took out the "-10.0" adjustment, and things are
    still working perfectly. Perhaps in the heat of development I had
    observed the phenomenon while there was some line fragment padding
    being imposed?

    Thanks - I have confidence the tab stops are in fact reckoned against
    the text container. It seems to be working perfectly now.

    Daniel

    On Feb 17, 2008, at 3:00 AM, Ben Lachman wrote:

    > I'm pretty sure they're reckoned against the text container inset.
    > The line fragment padding is mostly used within the text container
    > and I haven't really seen it referenced anywhere else in the text
    > system (however line fragment rects are, which are based off of the
    > line fragment padding).
    >
    > Hope this helps,
    >
    > ->Ben
    > --
    > Ben Lachman
    > Acacia Tree Software
    >
    > http://acaciatreesoftware.com
    >
    > <blachman...>
    > 740.590.0009
    >
    >
    >
    > On Feb 17, 2008, at 2:32 AM, Daniel Jalkut wrote:
    >
    >> Thanks - I don't think I've reviewed this particular section of the
    >> documentation. I will take a look and try to re-evaluate. Can you
    >> help me by clarifying which of these "areas" the units of a tab
    >> stop are reckoned against?
    >>
    >> Daniel
    >>
    >> On Feb 15, 2008, at 8:27 PM, Douglas Davidson wrote:
    >>
    >>> Daniel,
    >>>
    >>> It can be a little tricky figuring out where all the various bits
    >>> of space go, but there's a pretty good diagram at <http://developer.apple.com/documentation/Cocoa/Conceptual/TextStorageLayer/
    Tasks/Region.html
    >>> >.  Take a look at (a) the text container inset and (b) the line
    >>> fragment padding and see if either of those corresponds to what
    >>> you're seeing.
    >>>
    >>> Douglas Davidson

    >
previous month february 2008 next month
MTWTFSS
        1 2 3
4 5 6 7 8 9 10
11 12 13 14 15 16 17
18 19 20 21 22 23 24
25 26 27 28 29    
Go to today