• 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
Drawing glitches in NSTableView with variable row hight (just like Console.app)
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Drawing glitches in NSTableView with variable row hight (just like Console.app)


  • Subject: Drawing glitches in NSTableView with variable row hight (just like Console.app)
  • From: Marco Masser <email@hidden>
  • Date: Mon, 19 Apr 2010 17:56:40 +0200

Hi,

I'm trying to implement a logging facility for an app that should behave quite the same as OS X's Console.app in terms of displaying the log, i.e. an NSTableView with varying row heights. I got it working so far, but there are major drawing glitches when resizing the window or scrolling through the list.

As in Console.app, I have a string which determines the height of each table row. I found three different approaches to calculating the height for a given width, but they all seem to be very performance-hungry:
1) (my favorite) I set the message string on my message column's NSTextFieldCell directly and call -cellSizeForBounds:
2) Creating an NSAttributedString with the attributes of my cell, calculating its size and then using the string's total width and my column's width to calculate the number of rows (seems to be off some times).
3) Using some code from the docs involving an NSTextStorage, NSLayoutManager, and an NSTextContainer.

I found a few discussions on this and similar topics, but most of them only dealt with performance improvements using caching of row height. But my biggest concern are the drawing errors. If they only occurred while resizing the window, it probably would suffice to force a redraw, but the drawing glitches while scrolling are just bad.


Does anyone have some suggestions regarding these problems?

Thanks in advance,

Marco_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please 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

  • Follow-Ups:
    • Re: Drawing glitches in NSTableView with variable row hight (just like Console.app)
      • From: "Adam R. Maxwell" <email@hidden>
    • Re: Drawing glitches in NSTableView with variable row hight (just like Console.app)
      • From: Jerry Krinock <email@hidden>
  • Prev by Date: Carbon pasteboard/service events not firing in Cocoa app
  • Next by Date: OpenGL Shading Issues on PPC
  • Previous by thread: Re: Carbon pasteboard/service events not firing in Cocoa app
  • Next by thread: Re: Drawing glitches in NSTableView with variable row hight (just like Console.app)
  • Index(es):
    • Date
    • Thread