• 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: off screen drawing with cocoa
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


  • Follow-Ups:
    • Re: off screen drawing with cocoa
      • From: Warwick Hall <email@hidden>
References: 
 >off screen drawing with cocoa (From: Warwick Hall <email@hidden>)
 >Re: off screen drawing with cocoa (From: Nick Zitzmann <email@hidden>)
 >Re: off screen drawing with cocoa (From: Warwick Hall <email@hidden>)
 >Re: off screen drawing with cocoa (From: Half Activist <email@hidden>)

  • Prev by Date: Re: off screen drawing with cocoa
  • Next by Date: Any way to find out user's default email client?
  • Previous by thread: Re: off screen drawing with cocoa
  • Next by thread: Re: off screen drawing with cocoa
  • Index(es):
    • Date
    • Thread