[racket] plot3d & canvas question

From: Robby Findler (robby at eecs.northwestern.edu)
Date: Mon Feb 6 20:48:56 EST 2012

Just to be sure I'm understanding: you can put this into any GUI where
you can put an editor-canvas% object, right? So it should just be a
couple of object creations and method calls to get this going?


On Mon, Feb 6, 2012 at 5:41 PM, Neil Toronto <neil.toronto at gmail.com> wrote:
> On 02/06/2012 04:14 AM, Nikolaus Klepp wrote:
>> Hi!
>> When I create a 3D plot in DrRacket, I can rotate the plot by clicking on
>> it
>> and dragging the mouse. Now I would like to embed the same plot with the
>> same
>> ability in my GUI. Is there an easy way to do that?
> Great idea!
> Unfortunately, I didn't think of making an easy way to do it. Fortunately,
> `plot' already does something similar: if you set (plot-new-window? #t),
> plots appear on a canvas in a new frame. You just need to do that without
> the frame.
> The relevant code is in "<racket-dir>/collects/plot/common/gui.rkt",
> specifically the `make-snip-frame' function.
> The basic idea is to make a canvas containing a single read-only-text% that
> is initially writable, insert the snip (which you get from `plot-snip' or
> `plot3d-snip'), and then set the text to read-only. If you want to change
> the plot, set the text writable, delete the snip, insert the new one, and
> set it read-only again.
> If you don't mind my asking, what are you plotting in your gui?
> Neil ⊥
> ____________________
>  Racket Users list:
>  http://lists.racket-lang.org/users

Posted on the users mailing list.