• 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
Re: Making an NSTextView have a data source
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Making an NSTextView have a data source


  • Subject: Re: Making an NSTextView have a data source
  • From: Mikey <email@hidden>
  • Date: Fri, 10 May 2002 01:42:19 -0500

On Thursday, May 9, 2002, at 11:49 AM, Ondra Cada wrote:

On Thursday, May 9, 2002, at 07:15 , Mikey wrote:

It actually did work, but I was afraid I might be abusing the intent of the -drawRect: method by changing the contents of the text view while the main thread is trying to draw it. If you say that this has worked for you in the past, that's good enough for me -- you should have told me sooner so I wouldn't re-invent the wheel ;)

Nope, I used -tableViewSelectionDidChange: to update a text view. Never I tried to do that from -drawRect:!

Oh. The problem I was having with the -tableViewSelectionDidChange: method is that when I would update the NSTextView's text storage using the -replaceCharactersInRange:withAttributedString: method, some of the text occasionally didn't appear and the scroll thumb was drawn at the wrong size.
Simply moving the mouse over the view that contained the NSTextView (an NSTabView in this case) all of a sudden caused the NSTextView to display correctly.

When I shifted over to use -drawRect:, the aforementioned problems more or less went away.

Do you know how to get the scrollbar not to flicker? I actually updated the code I posted to surround the updating of the text view's storage object with the -beginEditing and -endEditing methods and it seems to have helped the flicker problem a bit: now it only seems to happen when I go from displaying no scrollbar to displaying a scrollbar with a small scroll thumb; the thumb appears very large for a split second, then it shrinks to the right size.

I am somewhat afraid that I don't understand quite well what are you doing,
but *perhaps* what are you looking for are NSWindow methods enableFlushWindow/disableFlushWindow (provided they still work properly with the Quartz non-server thing, which I somewhat doubt!).

Those are the methods I was looking for, but they didn't seem to fix anything when I tried them :(

Just in case you're unsure of what I meant by scrollbar flicker, I used Snapz Pro X to grab a movie of it called "scrollThumbFlicker.mov" and I stuck it on my iDisk:

http://homepage.mac.com/imikey27511/




Michael Sullivan
email@hidden
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.

References: 
 >Re: Making an NSTextView have a data source (From: Ondra Cada <email@hidden>)

  • Prev by Date: Java to Cocoa help request
  • Next by Date: aqua graphite/blue notification
  • Previous by thread: Re: Making an NSTextView have a data source
  • Next by thread: NSQuickDrawView update problem
  • Index(es):
    • Date
    • Thread