realbasic-nug
[Top] [All Lists]

Re: REALbasic-NUG Digest #8098

To: REALbasic Network Users Group <realbasic-nug at lists dot realsoftware dot com>
Subject: Re: REALbasic-NUG Digest #8098
From: c hinkle <chuckbo at mac dot com>
Date: Sun, 30 Mar 2003 07:24:13 -0600
Thanks for the advice. You're right -- when I created my snippet, I pasted
one section in twice (which is why the Group2D item was created twice).
What's the value of the Picture object that the manual shows but you're
bypassing? 

Your code is much simpler than what the manual recommends, and I'm getting a
figure to appear now. Let me play a little before sending in my next
questions. 
chuck

> 
> Subject: Re: Trying to understand graphing
> From: "Will Leshner" <leshner at ljug dot com>
> Date: Sat, 29 Mar 2003 16:46:14 -0800
> 
> Your code threw me for a second and I think it's beccause it doesn't
> describe a triangle. But there are other problems as well. For example,
> you create a fig_shape and add lines to it. Then you create a Group2D.
> Then you create another fig_shape, thus throwing away the first one.
> Then you create a Group2d again, thus throwing away the first one of
> those. Try this code in a button (you'll need to have dd be a property
> of your Window, though):
> 
> 
>  dim fs as FigureShape
> 
>  fs = new figureShape
>  fs.fillColor = RGB(0, 0, 0)
>  fs.borderwidth = 100
>  fs.borderColor = RGB(0, 127, 127)
>  fs.addline(50,0,100,100)
>  fs.addline(100,100,0,100)
>  fs.addline(0,100,50,0)
>  fs.fillColor = rgb(255,102,102)
>  dd = new group2D
>  dd.append fs
> 
>  self.Refresh
> 
> Now, Canvas1's Paint event needs to look like this:
> 
> if dd <> nil then g.DrawObject dd, 100, 100
> 
> See if that doesn't give you enough to get going.
> 
> On Saturday, March 29, 2003, at 02:29 PM, c hinkle wrote:
> 
>>    fig_shape = new figureShape
>>     fig_shape.addline(10,10,150,150)
>>     fig_shape.addline(150,150,250,250)
>>     fig_shape.addline(250,250,10,10)
>>     fig_shape.fillColor = rgb(255,102,102)
>>     dd = new group2D
>>     fig_shape.addline(10,10,150,150)
>>     fig_shape.addline(150,150,250,250)
>>     fig_shape.addline(250,250,10,10)
>>     fig_shape.fillColor = rgb(255,102,102)
>>     dd = new group2D
>>     px = new picture(400,400,0)
>>     dd.append fig_shape
>>     canvas1.backdrop = px
>>     canvas1.backdrop.objects=dd
>>     window1.refresh
> 


---
A searchable archive of this list is available at:
<http://support.realsoftware.com/listarchives/search.php>

Unsubscribe:
<mailto:realbasic-nug-off at lists dot realsoftware dot com>

Subscribe to the digest: 
<mailto:realbasic-nug-digest at lists dot realsoftware dot com>
.


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