[racket] plot3d & canvas question
On 02/07/2012 03:56 PM, Nikolaus Klepp wrote:
> Am Dienstag, 7. Februar 2012 schrieb Neil Toronto:
>> 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.
>
> Hi!
>
> Ok, that worked quite straight forward, thank you.
>
> Now my next problem is how to change the size of the sniplet...
Unfortunately, you can't. You'll have to delete the old one from the
read-only-text% and insert a new one.
If this is for resizing, you have another problem: creating a new plot
will reset the viewing angles. I was going to describe how to save and
restore them, but it would require copying much larger sections of
private `plot' code. You're better off letting the viewing angles reset
for now, and waiting for 3d-plot-canvas%, which I'll start on tonight.
Neil ⊥