Re: Embedding a WebView in a Table
Re: Embedding a WebView in a Table
- Subject: Re: Embedding a WebView in a Table
- From: "I. Savant" <email@hidden>
- Date: Wed, 21 Mar 2007 01:06:08 -0400
On Mar 21, 2007, at 12:41 AM, Steve Israelson wrote:
Well, the drawing is simplistic.
Item things like Name : Joe Number of items: 25
In an html table.
Maybe an image or 2.
Themeable using custom CSS supplied by the user.
...
Okay, so your goal is to create some kind of a themeable list
view. Now we're getting somewhere; WebKit is definitely the path of
least resistance, but is kind of heavyweight and you're looking for
optimization.
Again, I think (as you've already guessed and mentioned) the best
thing would be to use an off-screen WebView to render each "page",
PDF it into an NSImage, and use a standard table view with an image
cell. This eliminates the need to worry over the scrolling issue and
writing your own parser.
See, this is what html is for :)
I see the humor, but I'm sure most people on this list grasp that
concept completely. The point remains: Given the limited details you
had given regarding your actual goal, "what are you trying to do" is
a perfectly valid question.
Maybe I just parse the html myself? Its only 20 lines or so,
I don't mean any condescension by harping on this point, but it's
quite a bit more complicated than that if you're trying to parse and
render actual modern real-world web content (which could've been your
goal for all I knew). In the wild, web pages have errors, conform to
different standards, rely on plugins to display non-HTML content, etc.
This is why I've asked several times now if you're trying to
display actual web content or just do some drawing. It's one of the
most important aspects to consider regarding your approach.
Again, why re-invent the wheel? WebKit already does everything you
need it to do, but moving a view around to draw rows is
inefficient ... think of three or four rows in the table being
visible at once. Scrolling the table view would result (for each
update) in multiple page loads and draws. Using the web view to load
and them once and letting a regular image cell do its thing in the
table view is the optimal approach both performance-wise and in code/
maintenance.
My goal was to be helpful ... hopefully all this was good for at
least something. :-)
--
I.S.
_______________________________________________
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