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: "Peter K. Stys" <pkstys at gmail dot com>
Date: Thu, 27 Apr 2006 15:36:57 -0400
Delivered-to: realbasic-nug at lists dot realsoftware dot com
Domainkey-signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:to:subject:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=StA5bpp3QVVU5UbA6qiMeQugJZponr8JiuoiynN7vcZexwaQVRGNS9rretU5n/nf0TpruPs2m7BAJY2ci0RbWqKnLy4IsK4z6acVDGaPF9kmT1fQPS/4SfPs+0f0WCaha/0p3ILQUBRDPIvAABiYZK2QZjIEycBEWbp3RodzOiY=
References: <77124270604271200i7f150dedi5564576b6014167a at mail dot gmail dot com> <3D275A5D-FD15-49B5-9C49-99D58940831E at declareSub dot com>
Yes Charles, you're right:

SetPort GetWindowPort(self.MacWindowPtr)

is the correct call, but this didn't work, still no QD graphics display in self

I tried your suggestion to touch the graphics object:

      self.Graphics.DrawRect 0,0,0,0

But this didn't work either.

Any other ideas on how to get QD calls to draw in a particular window?

P.

On 4/27/06, Charles Yeomans <charles at declaresub dot com> wrote:
> 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>
>


--
-------------------------------------------------------------------------------
Peter K. Stys, MD
Professor of Medicine(Neurology), Senior Scientist
Ottawa Health Research Institute, Div. of Neuroscience
Ottawa Hospital / University of Ottawa
Ontario, CANADA
tel:    (613)761-5444
fax:    (613)761-5330
http://www.ohri.ca/profiles/stys.asp
-------------------------------------------------------------------------------
_______________________________________________
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>


From  Thu 27 Apr 2006 13:37:51 -0600
Return-Path: <realbasic-nug-bounces at lists dot realsoftware dot com>
Received: from lists.realsoftware.com (209.198.132.125) by realsoftware.com
 with ESMTP (Eudora Internet Mail Server 3.1.3);
 Thu, 27 Apr 2006 14:38:05 -0500
Received: from lists.realsoftware.com (localhost [127.0.0.1])
        by lists.realsoftware.com (Postfix) with ESMTP
        id 3F7561225188; Thu, 27 Apr 2006 14:37:56 -0500 (CDT)
X-Original-To: realbasic-nug at lists dot realsoftware dot com
Delivered-To: realbasic-nug at lists dot realsoftware dot com
Received: from hoggle.dreamhost.com (hoggle.dreamhost.com [66.33.197.5])
        by lists.realsoftware.com (Postfix) with ESMTP id DDFFF1225179
        for <realbasic-nug at lists dot realsoftware dot com>;
        Thu, 27 Apr 2006 14:37:50 -0500 (CDT)
Received: from [10.0.1.2] (c-67-174-105-26.hsd1.co.comcast.net [67.174.105.26])
        by hoggle.dreamhost.com (Postfix) with ESMTP id 6FCC2731AB
        for <realbasic-nug at lists dot realsoftware dot com>;
        Thu, 27 Apr 2006 12:37:50 -0700 (PDT)
Date: Thu, 27 Apr 2006 13:37:51 -0600
From: joe at strout dot net
To: REALbasic NUG <realbasic-nug at lists dot realsoftware dot com>
In-Reply-To: <E6C787FE-EF19-4972-8868-5D623BAE184F at teachesme dot com>
X-Mailer: VerEx Email Gateway
Content-type: text/plain;
Content-transfer-encoding: 7bit
Message-Id: <20060427193750 dot 6FCC2731AB at hoggle dot dreamhost dot com>
Subject: Re: examples of rb scripting the ide
X-BeenThere: realbasic-nug at lists dot realsoftware dot com
X-Mailman-Version: 2.1.2
Precedence: list
Reply-To: REALbasic NUG <realbasic-nug at lists dot realsoftware dot com>
Sender: realbasic-nug-bounces at lists dot realsoftware dot com
Errors-To: realbasic-nug-bounces at lists dot realsoftware dot com

Sam DeVore wrote:

> Ok I did this and it does work, though the lack of asynchronous
> building is a PIA, though I did work around it a little bit with some
> external scripting from the shell.

I agree though that this is a PIA.  I suggest signing on to this feature 
request:
  <http://www.realsoftware.com/feedback/viewreport.php?reportidúutqqce>

> But for the life of my old cobwebed brain I can not figure out where to
> save the scripts to have them show up in the menu in the ide.

Save them in a folder next to the IDE called "Scripts".  I agree that the 
current distribution doesn't make this very obvious, since there is no 
"Scripts" folder next to the IDE to begin with.  So you pretty much have to 
glean this information from some other source (like this mailing list).

Once such a folder exists, though, you'll note that the "Save As" command in 
the IDE for scripts defaults to that folder.  So if the good folks at RS 
remember to add an empty Scripts folder to the distribution next time, this 
problem would be solved.

Cheers,
- Joe

--
Joe Strout -- joe at strout dot net
Verified Express, LLC    "Making the Internet a Better Place"
http://www.verex.com
_______________________________________________
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>