NSTextField drawing over itself?

  • I have two NSTextField's in two different windows (the main window
    and a second one).  I display string information in both text fields
    in the exact same way using [field setStringValue: ...].

    The text field in the main window works just fine but the text field
    in the second window overwrites itself.

    What is causing this behavior of a text field overwriting itself?  I
    tried everything that I could come up with and the only solution I
    found was to enable the "Draw" switch for the background color of the
    text field.  What (if anything) am I doing wrong?

    Thanks for any help,

    -- ivan
  • On 30 sep 2006, at 17.36, Ivan Kourtev wrote:

    > The text field in the main window works just fine but the text
    > field in the second window overwrites itself.
    >
    > What is causing this behavior of a text field overwriting itself?
    > I tried everything that I could come up with and the only solution
    > I found was to enable the "Draw" switch for the background color of
    > the text field.  What (if anything) am I doing wrong?

    Are you by any chance setting these values from a non-main thread?

    <http://developer.apple.com/documentation/Cocoa/Conceptual/
    Multithreading/index.html
    >

    j o a r
  • > On 30 sep 2006, at 17.36, Ivan Kourtev wrote:
    >
    >> The text field in the main window works just fine but the text
    >> field in the second window overwrites itself.
    >>
    >> What is causing this behavior of a text field overwriting itself?
    >> I tried everything that I could come up with and the only solution
    >> I found was to enable the "Draw" switch for the background color
    >> of the text field.  What (if anything) am I doing wrong?
    >
    > Are you by any chance setting these values from a non-main thread?
    >
    > <http://developer.apple.com/documentation/Cocoa/Conceptual/
    > Multithreading/index.html>

    Nope, so far I only have one (the main) thread in my app.

    If I move the button from the second window into the main window then
    I get the normal behavior (no need to draw button background).  Does
    this make any sense?  I cannot explain it.

    -- ivan
previous month september 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  
Go to today