• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Chasing odd problem with insertion-point drawing ...
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Chasing odd problem with insertion-point drawing ...


  • Subject: Chasing odd problem with insertion-point drawing ...
  • From: Jay Reynolds Freeman <email@hidden>
  • Date: Thu, 22 Mar 2007 10:48:34 -0700

I am chasing an odd problem with drawing the insertion
point in an instance of NSTextView.  I don't have enough
information to know whether it is my bug or Apple's, much
less to know what the problem is.  I wondered if anyone
on this list might have some useful ideas or clues.

I am using XCode 2.4.1, developing and running on a
Macbook under OS 10.4.9.  I first noticed the problem
while still using 10.4.8.

I am developing a Cocoa application in which, in one
instance of NSTextView, the insertion point ceases to
be drawn after various operations on the text (details
in a minute).  By subclassing NSTextView and reimplementing
"drawInsertionPointInRect:color:turnedOn:" in the subclass,
and then instrumenting it with printf statements to the
console log, I have discovered that ...

  o What happens "normally", is that some entity calls
    "drawInsertionPointInRect:color:turnedOn:" every half
    second, with the boolean associated with "turnedOn:"
    alternating between YES and NO.

  o When my problem occurs, the calls to
    "drawInsertionPointInRect:color:turnedOn:" occur only
    once per second, and with the boolean associated with
    "turnedOn:" always NO.  That is, superficially, it
    looks as if every other call to this method is
    either not being made or is being misdirected.

  o The method "shouldDrawInsertionPoint" returns YES
    at all times, as it should, and

  o When I implement a horrendous hack, using a static
    boolean in my reimplementation of
    "drawInsertionPointInRect:color:turnedOn:" that
    gets toggled on every call, and passing that boolean
    on to "super" as the argument associated with
    "turnedOn:", then lo and behold, the cursor appears
    right where it ought to be, blinking as it should,
    except at only half the normal frequency (as is
    expected from using a static boolean toggled in this
    way).

  o The problem seems to occur only when the user of the
    application is editing text in the last (bottom-most)
    line of the NSTextView, and when that line of text is
    not blank.  I have no sense whether this means something
    or is a red herring.

If I could fix this one I would be delighted, or if I
could narrow it down to something I could convincingly
argue was an Apple bug, I would file it, but I haven't
much of a clue how to proceed.

Does anyone know what it is that calls the method "drawInsertionPointInRect:color:turnedOn:" in normal
operation?


Any other suggestions?

Thanks ...

--  Jay Reynolds Freeman
---------------------
email@hidden
http://web.mac.com/jay_reynolds_freeman (personal web site)


_______________________________________________

Cocoa-dev mailing list (email@hidden)

Do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


  • Prev by Date: Re: toggle new attribute in range of text (was : exponent action in NSTextView subclass)]
  • Next by Date: Possible types of an object inside an NSExpression
  • Previous by thread: Re: toggle new attribute in range of text (was : exponent action in NSTextView subclass)]
  • Next by thread: Possible types of an object inside an NSExpression
  • Index(es):
    • Date
    • Thread