delegate or subclass NSTextView?

Ask a Question related to Mac Programming, Design and Development.

  1. #1

    Default delegate or subclass NSTextView?

    I can't quite figure out if I should focus on using the delegate
    methods of a NSTextView or if I should work on subclassing it. What I'd
    like is to have is a continuously updated "translation" line of text
    just under the user entered line of text (like DNA to protein, for
    instance). I could maybe figure this out better if I knew what commands
    get sent to a NSTextView delegate. Is there a list anywhere of the
    selectors that get sent by doCommandBySelector?



    Thanks for any tips
    None Guest

  2. Similar Questions and Discussions

    1. Losing Delegate On Postback
      I have authored a webcontrol that contains a SimpleCellCollection of SimpleCell objects. Both have custom typeconverters that handle viewstate...
    2. NSTextView problems plus a few others...
      Hey I am trying to make an NSTextView resize itself to fit the text as the user types. These are the steps I take: NSView *superView; // Not a...
    3. impersonate/delegate problem
      Ok.. so I've read and seen lot of messages and MSDN docs concerning the above issue.. how do I get it to work? I want to impersonate the current...
    4. NSMutableAttributedString in an NSTextView
      In <210720032130382351%sgketcham@comcast.net> Steve Ketcham wrote: Do you mean an NSTableView? Do you mean an NSTableView? It sounds to...
    5. NSScrollView for NSTextView scrolls then snaps back
      I have a text view created in IB that I use to display the contents of the clipboard by doing a paste into the text view. When the text is...
  3. #2

    Default Re: delegate or subclass NSTextView?

    None <none@none.com> wrote:
    > I can't quite figure out if I should focus on using the delegate
    > methods of a NSTextView or if I should work on subclassing it. What I'd
    > like is to have is a continuously updated "translation" line of text
    > just under the user entered line of text (like DNA to protein, for
    > instance). I could maybe figure this out better if I knew what commands
    > get sent to a NSTextView delegate. Is there a list anywhere of the
    > selectors that get sent by doCommandBySelector?
    If you look at the documentation, you'll find a list of delegate methods
    for NSTextView and its superclasses. You can tame the wild documentation
    with Cocoa Browser: <http://www.macupdate.com/info.php/id/10291>

    You probably want to make a delegate object for the user-entered text
    view, and then have that delegate object translate it and put it in the
    second text view. This is simpler, conceptually, and would be easier to
    understand if you're not all that intimately familiar with Cocoa.
    Paul Mitchum Guest

  4. #3

    Default Re: delegate or subclass NSTextView?

    In article <1g1niwd.mytc1j15odc3hN%usenet@mile23.com.r3m0v3 >, Paul
    Mitchum <usenet@mile23.com.r3m0v3> wrote:
    > None <none@none.com> wrote:
    >
    > > I can't quite figure out if I should focus on using the delegate
    > > methods of a NSTextView or if I should work on subclassing it. What I'd
    > > like is to have is a continuously updated "translation" line of text
    > > just under the user entered line of text (like DNA to protein, for
    > > instance). I could maybe figure this out better if I knew what commands
    > > get sent to a NSTextView delegate. Is there a list anywhere of the
    > > selectors that get sent by doCommandBySelector?
    >
    > If you look at the documentation, you'll find a list of delegate methods
    > for NSTextView and its superclasses. You can tame the wild documentation
    > with Cocoa Browser: <http://www.macupdate.com/info.php/id/10291>
    >
    > You probably want to make a delegate object for the user-entered text
    > view, and then have that delegate object translate it and put it in the
    > second text view. This is simpler, conceptually, and would be easier to
    > understand if you're not all that intimately familiar with Cocoa.
    Sorry to be so dense, but I've read the documentation and the info in
    Cocoa Browser as well as all posts in deja that I can find on this
    subject, but still cannot figure it out. There is no list of selectors
    that are sent by doCommandBySelector, so I can't guess which message
    might be appropriate to override.

    But it turns out to work quite well for me if I do just subclass the
    NSTextView rather than trying to get the delegate to receive the
    correct messages. Now I just have a different novice type question. By
    subclassing NSTextView, my window no longer behaves correctly in the
    application; i.e. making changes to the text does not set the window to
    know that its content has been changed. I know I can implement the undo
    manager manually myself, but is there an easy way to re-hook up my
    subclassed nstextview to the default window behavior so I don't have
    to? I gather this is a result of making my own scrollview in IB using
    my subclass rather than the built in scrollview objects...

    Thanks again,
    None Guest

Posting Permissions

  • You may not post new threads
  • You may 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