Professional Web Applications Themes

[newbie] NSTextView and Scroller - Mac Programming

Hi, i have an NSTextView subclass into an NSScrollView instance. When i digit some text and i go outside the visible range the NSScroll doesn't move my text and i can't see what i'm writing. How can i solve this problem ? -- Thanks Wezzy...

  1. #1

    Default [newbie] NSTextView and Scroller

    Hi, i have an NSTextView subclass into an NSScrollView instance. When i
    digit some text and i go outside the visible range the NSScroll doesn't
    move my text and i can't see what i'm writing. How can i solve this
    problem ?

    --
    Thanks
    Wezzy
    Wezzy Guest

  2. #2

    Default Re: [newbie] NSTextView and Scroller

    In article <1g2qcdj.10ipgveio9xxsN%it>,
    it (Wezzy) wrote:
     

    This one had be curious, since I still think I have much to learn about
    *View's. I couldn't find any class which had a autoscroll property (as
    the old OS 9 TextEdit did), so I started a fresh Cocoa app. I dropped a
    single NSTextView from the palette onto the window. Without writing any
    code, I ran the program. I could type into the text view (which is what
    I assume you mean by 'digit some text') and lo' and behold - when I got
    to the bottom of the view the scroller enabled and scrolled to show
    where I was up to.

    Not sure if that will help you too much, but I thought it might be
    useful to know that you don't actually have to do anything by default.
    Might let you know to look for something already in your code, not
    something to add.

    Incidentally, I have an application which manually fills a text view
    with a bunch of text and then deliberately scrolls it to the end each
    time. Probably not what you need, but I could find the code for that.

    --
    Heath
    __________________________________________________ ______
    | *Nothing is foolproof to a sufficiently talented fool* |
    | _\|/_ |
    |________________________________________m(. .)m_________|
    Heath Guest

  3. #3

    Default Re: [newbie] NSTextView and Scroller

    Heath Raftery <com> wrote:
     
    >
    > This one had be curious, since I still think I have much to learn about
    > *View's. I couldn't find any class which had a autoscroll property (as
    > the old OS 9 TextEdit did), so I started a fresh Cocoa app. I dropped a
    > single NSTextView from the palette onto the window. Without writing any
    > code, I ran the program. I could type into the text view (which is what
    > I assume you mean by 'digit some text') and lo' and behold - when I got
    > to the bottom of the view the scroller enabled and scrolled to show
    > where I was up to.[/ref]

    I think that my problems are generated from my choise to work with
    subclass of NSTesxtView instaed of wotking with delegates. Probably i
    have to implement some methods or connect some element with outlets in
    my subclass, but i couldn't find the answer.
     

    I have already considered this option, but my subclass is very simple
    and it adds very few new methods. Anyway i'll do some test with very
    basic subclass.
     

    This can be very useful if i could get the cursor position (but this is
    another Cocoa's mistery for me :-) ) so i can scroll to that position.

    --
    Thanks a lot for your help
    Wezzy
    Wezzy Guest

  4. #4

    Default Re: [newbie] NSTextView and Scroller

    In article <1g2sbm8.1ndwo4a1u1ac80N%it>,
    it (Wezzy) wrote:
     

    NSTextView has a single call which will scroll it so that the
    current cursor position is visible. You don't do one call to
    find the position and another to scroll, it's all in one call.


    Simon Guest

Similar Threads

  1. Need help with js scroller
    By typa in forum Macromedia Dynamic HTML
    Replies: 1
    Last Post: July 25th, 06:15 AM
  2. delegate or subclass NSTextView?
    By None in forum Mac Programming
    Replies: 3
    Last Post: October 1st, 08:58 AM
  3. NSTextView problems plus a few others...
    By Per Bull Holmen in forum Mac Programming
    Replies: 6
    Last Post: September 18th, 12:01 AM
  4. NSMutableAttributedString in an NSTextView
    By matt neuburg in forum Mac Programming
    Replies: 11
    Last Post: July 26th, 01:21 AM
  5. NSScrollView for NSTextView scrolls then snaps back
    By Harry Mahoney in forum Mac Programming
    Replies: 0
    Last Post: July 16th, 09:19 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

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 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139