[racket] Matlab like animation in Racket

2014-02-02 Thread Alexandr M
Hello community members, Does anybody know if it's possible to do animations in Racket like in this demonstration: https://www.youtube.com/watch?v=S1sKsaewhpc I also would like to add some control fields into the gui. For example while modelling gas particles I need to change number of particles

[racket] Calculating cumulative sum of the list

2015-01-22 Thread Alexandr M
Hello, I am trying to replicate functionality of this code in Python: https://gist.github.com/m-blog/22b7c5d31b3839ffba50#file-cumsum-py in Racket without usage of any libraries. What would the most optimal / concise way to do it in Racket? Thank you. -- Best regards, Alex __

[racket] Very simple animation in #racket/gui

2015-01-23 Thread Alexandr M
Hello dear community members, I am trying to build a GUI with a very simple animation - just a moving dot (or vertical line) from the left side of the canvas object to it's right side. There is a section called "1.7 Animation in Canvases" in the racket documentation: http://docs.racket-lang.org/

[racket] Drawing in the Canvas from outside

2015-01-27 Thread Alexandr M
Hello, How can I draw the line (for example) in the canvas object defined as: (define frame (new frame% [label ""] [width 700] [height 500])) (define canvas (new canvas% [parent frame] - call from outside: [paint-callback (lambda (c dc) (send dc draw-line 1 1 10 10) )] )) by calling a

Re: [racket] Drawing in the Canvas from outside

2015-01-27 Thread Alexandr M
de is tested. Copy, paste, run, evaluate (my-draw) at repl. If it > doesn't work, report the exact actions you perform to get a failure. > > > > > On Jan 27, 2015, at 1:08 PM, Alexandr M wrote: > > Thanks, > > I copied your example and it seems it doesn't work

Re: [racket] Drawing in the Canvas from outside

2015-01-27 Thread Alexandr M
paint-callback >(lambda (c dc) > (send dc draw-line 1 1 100 100))])) > (send frame show #true) > > (define (my-draw) > (send (send canvas get-dc) draw-line 100 100 0 200)) > > > -- Matthias > > > > On Jan 27, 2015, at 12:09 PM,