bound textview display glitch

  • I have two windows, both containing various interface items bound to the
    selection of an NSArrayController.

    When both windows are open and, in one of them, I navigate the selection,
    the other window (visible in the background) shows a display glitch in its
    NSTextViews. I've put a screen shot of the glitch here:

    <http://www.tidbits.com/matt/images/glitch.png>

    The screen shot shows the NSTextView in three states.

    * First, before: the word "igne" appears in the text view.

    * Second, after: I have changed the NSArrayController's selection using
    selectNext, and the word "Euclioni" appears in the text view, except that
    the descenders from "igne" are still present. That's the glitch. (If I had
    used a different word, you would also see that descenders from the new word
    are cut off. It is as if only the main part of the first line changes - its
    descenders, and all subsequent lines, forget to change.)

    * Third, after after: I have clicked on the background window, bringing it
    to the front. As soon as I do this, the display glitch disappears.

    Perhaps someone has dealt with this and has some advice on avoiding the
    glitch? Thx - m.

    --
    matt neuburg, phd = <matt...>, <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>
  • On Fri, 29 Dec 2006 11:03:27 -0800, Matt Neuburg <matt...> said:
    > I have two windows, both containing various interface items bound to the
    > selection of an NSArrayController.
    >
    > When both windows are open and, in one of them, I navigate the selection,
    > the other window (visible in the background) shows a display glitch in its
    > NSTextViews. I've put a screen shot of the glitch here:
    >
    > < http://www.tidbits.com/matt/images/glitch.png >
    >
    > The screen shot shows the NSTextView in three states.
    >
    > * First, before: the word "igne" appears in the text view.
    >
    > * Second, after: I have changed the NSArrayController's selection using
    > selectNext, and the word "Euclioni" appears in the text view, except that
    > the descenders from "igne" are still present. That's the glitch. (If I had
    > used a different word, you would also see that descenders from the new word
    > are cut off. It is as if only the main part of the first line changes - its
    > descenders, and all subsequent lines, forget to change.)
    >
    > * Third, after after: I have clicked on the background window, bringing it
    > to the front. As soon as I do this, the display glitch disappears.
    >
    > Perhaps someone has dealt with this and has some advice on avoiding the
    > glitch? Thx - m.

    Looks like what I've hit is an instance of the problem noted here:

    <http://www.cocoabuilder.com/archive/message/cocoa/2004/5/3/106055>

    I can't be certain because the OP (Steve Spencer) has taken down his
    example. m.

    --
    matt neuburg, phd = <matt...>, <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>
  • On Dec 30, 2006, at 11:40 AM, Matt Neuburg wrote:

    > Looks like what I've hit is an instance of the problem noted here:
    >
    > <http://www.cocoabuilder.com/archive/message/cocoa/2004/5/3/106055>

    One potential workaround may be to have a delegate of the textviews
    do an explicit redraw when their content changes.  You'd have to of
    course minimize the redraws to only do so when needed (i.e. not upon
    every single character insert).

    I suppose you could rewrite things to handle your bindings more
    "manually" and thus may then have decent hooks into where to drop in
    the redraw code.

    ___________________________________________________________
    Ricky A. Sharp        mailto:<rsharp...>
    Instant Interactive(tm)  http://www.instantinteractive.com
  • On or about 12/30/06 3:56 PM, thus spake "Ricky Sharp" <rsharp...>:

    >
    > On Dec 30, 2006, at 11:40 AM, Matt Neuburg wrote:
    >
    >> Looks like what I've hit is an instance of the problem noted here:
    >>
    >> <http://www.cocoabuilder.com/archive/message/cocoa/2004/5/3/106055>
    >
    > One potential workaround may be to have a delegate of the textviews
    > do an explicit redraw when their content changes.

    Yes, something like that is just what I am doing. There seems to be a Cocoa
    bug, and it seems to involve an incomplete redraw of the textviews in
    question. What I'd like to do now is pin down the exact preconditions for
    demonstrating the bug; that's why I'd like to see the earlier example, as
    I'm having trouble reproducing the bug in a separate project. m.

    --
    matt neuburg, phd = <matt...>, http://www.tidbits.com/matt/
    pantes anthropoi tou eidenai oregontai phusei
    AppleScript: the Definitive Guide - Second Edition!
    http://www.amazon.com/gp/product/0596102119
    Take Control of Word 2004, Tiger, and more -
    http://www.takecontrolbooks.com/tiger-customizing.html
    Subscribe to TidBITS! It's free and smart. http://www.tidbits.com/
previous month december 2006 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 30 31
Go to today