Re: off screen drawing with cocoa
Re: off screen drawing with cocoa
- Subject: Re: off screen drawing with cocoa
- From: Michael Watson <email@hidden>
- Date: Tue, 24 Apr 2007 03:14:34 -0400
If this is the case, one could create the window non-deferred and
keep it off-screen while performing drawing.
<http://developer.apple.com/documentation/Cocoa/Reference/
ApplicationKit/Classes/NSWindow_Class/Reference/Reference.html#//
apple_ref/occ/instm/NSWindow/
initWithContentRect:styleMask:backing:defer:>
--
m-s
On 24 Apr, 2007, at 03:05, Half Activist wrote:
Hi Warwick,
I guess you're experiencing at least two problems there.
From the log you posted here, youre locking the focus on a view
that is deffered, that is, it does NOT exist until it is put on
screen, so the window you're creating must not be deffered.
Secondly, a WebView must be contained in a window (it's seems
you're already doing that) and as far as I went with WebView (I did
quite a lot of stuffs now) it needs to be
onscreen to be drawn, so even if you put the WebView in a window
(from what i remember it crashes or doesn't work if you don't) you
need to display it.
I already used it to print/create pictures/pdf and use WebView
because of the formatting ease provided by HTML.
The best solution I came across was to put a transparent window on
screen, so it does not appear as visible to the user but everything
is rendered correctly in the WebView.
[ yourWindow setAlpha: 0.0 ]; should do the trick if you didn't
already know that.
Regards.
On Apr 24, 2007, at 6:47 AM, Warwick Hall wrote:
re last posting of this topic, this is the program output (stderr)
that i get:
--BEGIN--
2007-04-24 14:42:33.982 url2ps[3105] *** Assertion failure in -
[WebView lockFocus], AppKit.subproj/NSView.m:3248
2007-04-24 14:42:33.984 url2ps[3105] An uncaught exception was raised
2007-04-24 14:42:33.985 url2ps[3105] lockFocus sent to a view
whose window is deferred and does not yet have a corresponding
platform window
2007-04-24 14:42:33.985 url2ps[3105] *** Uncaught exception:
<NSInternalInconsistencyException> lockFocus sent to a view whose
window is deferred and does not yet have a corresponding platform
window
Trace/BPT trap
--END--
On 24/04/2007, at 1:29 PM, Nick Zitzmann wrote:
On Apr 23, 2007, at 9:13 PM, Warwick Hall wrote:
i am trying to create a command line tool using cocoa which
requires some html graphics rendering using WebView.
there are no windows (being a command line tool) and the
rendering is not taking place. is there something i am missing
with drawing views?
Are you calling NSApplicationLoad(), creating a graphics context,
and locking focus on the view before drawing it? Can you post
your code?
Nick Zitzmann
<http://www.chronosnet.com/>
_______________________________________________
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:
40gmail.com
This email sent to email@hidden
_______________________________________________
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:
40bungie.org
This email sent to email@hidden
_______________________________________________
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