Welcome to the MacNN Forums.

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

You are here: MacNN Forums > Software - Troubleshooting and Discussion > Developer Center > Getting a gworld from a NSWindow pointer

Getting a gworld from a NSWindow pointer
Thread Tools
Junior Member
Join Date: Sep 2000
Location: Bremen, Germany
Status: Offline
Reply With Quote
Jun 15, 2002, 05:02 AM
 
How can I get a gworld (or port ... or windowref) from a NSWindow (nib) or NSView pointer ?
"Eine gute Basis ist die Grundlage für ein solides Fundament", Unknown
"If people do not believe that mathematics is simple, it is only because they do not realize how complicated life is", John von Neumann
     
Junior Member
Join Date: Jul 2001
Location: Mos Eisley Cantina
Status: Offline
Reply With Quote
Jun 15, 2002, 11:43 AM
 
Unless you're using an NSQuickDrawView, or initialized your NSWindow with a Carbon WindowRef, I don't believe that there is a way.

What are you trying to do? If you want to use some of your already existing code that uses CopyBits, etc, but display it in an AppKit window; then your best bet is to use an NSQuickDrawView.
     
mahrz  (op)
Junior Member
Join Date: Sep 2000
Location: Bremen, Germany
Status: Offline
Reply With Quote
Jun 15, 2002, 12:42 PM
 
</font><blockquote><font size="1" face="Geneva, Verdana, Arial, sans-serif">quote:</font><hr /><font size="1" face="Geneva, Verdana, Arial, sans-serif">Originally posted by PipelineStall:
<strong>Unless you're using an NSQuickDrawView, or initialized your NSWindow with a Carbon WindowRef, I don't believe that there is a way.

What are you trying to do? If you want to use some of your already existing code that uses CopyBits, etc, but display it in an AppKit window; then your best bet is to use an NSQuickDrawView.</strong></font><hr /></blockquote><font size="1" face="Geneva, Verdana, Arial, sans-serif">I want to use a sequence grabber to capture and preview a quicktime movie, I found a sample on the developer pages how to solve this with a NSQuickDrawView ....

Currntly my program crashes when i try to capture something to disk, I looked at the HackTV code and did it the same way, but the SGIdle function just returns error -34 (but my disk isn't full ...) and when SGStop is called the app crashes with signal 10 ....

Any ideas ?
"Eine gute Basis ist die Grundlage für ein solides Fundament", Unknown
"If people do not believe that mathematics is simple, it is only because they do not realize how complicated life is", John von Neumann
     
Forum Regular
Join Date: Jan 2001
Location: Boston, MA
Status: Offline
Reply With Quote
Jun 15, 2002, 01:57 PM
 
</font><blockquote><font size="1" face="Geneva, Verdana, Arial, sans-serif">quote:</font><hr /><font size="1" face="Geneva, Verdana, Arial, sans-serif">Originally posted by mahrz:
<strong>How can I get a gworld (or port ... or windowref) from a NSWindow (nib) or NSView pointer ?</strong></font><hr /></blockquote><font size="1" face="Geneva, Verdana, Arial, sans-serif">You can just do [yourNSWindow windowRef] to get a Carbon WindowRef pointer from your NSWindow object. I'm not sure how you do it from an NSView though. Probably some combination of getting the NSGraphicsContext from the NSView, NSGraphicsContext is a peer to Carbon's CoreGraphic's CGContextRef so you can probably do some massaging to get at the GWorld pointer from there.
     
mahrz  (op)
Junior Member
Join Date: Sep 2000
Location: Bremen, Germany
Status: Offline
Reply With Quote
Jun 15, 2002, 03:37 PM
 
</font><blockquote><font size="1" face="Geneva, Verdana, Arial, sans-serif">quote:</font><hr /><font size="1" face="Geneva, Verdana, Arial, sans-serif">Originally posted by SoClose:
<strong>You can just do [yourNSWindow windowRef] to get a Carbon WindowRef pointer from your NSWindow object. </strong></font><hr /></blockquote><font size="1" face="Geneva, Verdana, Arial, sans-serif">But only if you create the window using a windowRef it doesn't work with a nib window ...
"Eine gute Basis ist die Grundlage für ein solides Fundament", Unknown
"If people do not believe that mathematics is simple, it is only because they do not realize how complicated life is", John von Neumann
     
   
Thread Tools
Forum Links
Forum Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Top
Privacy Policy
All times are GMT -5. The time now is 01:24 PM.
All contents of these forums © 1995-2011 MacNN. All rights reserved.
Branding + Design: www.gesamtbild.com
vBulletin v.3.8.7 © 2000-2011, Jelsoft Enterprises Ltd., Content Relevant URLs by vBSEO 3.3.2