realbasic-nug
[Top] [All Lists]

Re: How do I set the grafport to direct Quickdraw calls to a particular

To: REALbasic NUG <realbasic-nug at lists dot realsoftware dot com>
Subject: Re: How do I set the grafport to direct Quickdraw calls to a particular window?
From: Charles Yeomans <charles at declareSub dot com>
Date: Thu, 27 Apr 2006 15:19:01 -0400
Delivered-to: realbasic-nug at lists dot realsoftware dot com
References: <77124270604271200i7f150dedi5564576b6014167a at mail dot gmail dot com>
The standard trick is to touch the Graphics object by calling of one its drawing methods to get REALbasic to set the graphics port. SetPort and REAL basic do not play well together. MacWindowPtr returns a WindowPtr; you have to pass something else to SetPort. I recall that there is a Window Manager function that takes a WindowPtr and returns a CGrafPtr or whatever you would pass to SetPort.

Charles Yeomans

On Apr 27, 2006, at 3:00 PM, Peter K. Stys wrote:

I have some QD calls that draw stuff. Problem is, often the drawing
occurs at the right coordinates, but in the wrong window.  So I guess
I need to set the grafport of a particular window.

Do I use SetPort?  If so, what do I pass?

SetPort self.macWindowPtr causes a crash so that's not it.

Any ideas?

Incidentally, this wasn't an issue with earlier versions of RB, but
since 2K5 and 2K6, activating a window does not reset the grafport
accordingly.

Thanks,
_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>

Search the archives of this list here:
<http://support.realsoftware.com/listarchives/lists.html>


<Prev in Thread] Current Thread [Next in Thread>