Re: [racket] display problem

2012-04-13 Thread Roelof Wobben
Op 13-4-2012 20:53, Stephen Bloch schreef: On Apr 13, 2012, at 1:49 PM, Roelof Wobben wrote: I still have to write testcases but it's looking good. That's a bad sign: you should be writing test cases BEFORE writing the function :-) (define verwerker (make-editor "aaa" "")) ; Editor ->

Re: [racket] display problem

2012-04-13 Thread Roelof Wobben
Op 13-4-2012 19:31, Stephen Bloch schreef: On Apr 12, 2012, at 8:18 AM, Roelof Wobben wrote: Why do you need "overlay"? I would think you could do this just with "beside" (unless you wanted to fine-tune the formatting). Only beside. But how can I then take care that the text are displayed i

Re: [racket] display problem

2012-04-13 Thread Stephen Bloch
On Apr 12, 2012, at 8:18 AM, Roelof Wobben wrote: >> Why do you need "overlay"? I would think you could do this just with >> "beside" (unless you wanted to fine-tune the formatting). >> > > Only beside. But how can I then take care that the text are displayed into > the empty-scene. I think

Re: [racket] display problem

2012-04-13 Thread Stephen Bloch
On Apr 13, 2012, at 11:33 AM, Roelof Wobben wrote: > I have problems with place-image/align. > > I have this : > > ; Editor -> Image > ; Function which displays the struct on the screen into a image. > (define (render verwerker) Don't you also have a global variable named verwerker? I find t

Re: [racket] display problem

2012-04-13 Thread Roelof Wobben
Op 12-4-2012 18:30, Roelof Wobben schreef: Op 12-4-2012 18:03, Nick Shelley schreef: Only beside. But how can I then take care that the text are displayed into the empty-scene. I think you need overlay or something for that. Every image function returns an image, so you can use besid

Re: [racket] display problem

2012-04-12 Thread Roelof Wobben
Op 12-4-2012 18:03, Nick Shelley schreef: Only beside. But how can I then take care that the text are displayed into the empty-scene. I think you need overlay or something for that. Every image function returns an image, so you can use beside to create an image of your text with the

Re: [racket] display problem

2012-04-12 Thread Nick Shelley
Only beside. But how can I then take care that the text are displayed into the empty-scene. I think you need overlay or something for that. Every image function returns an image, so you can use beside to create an image of your text with the cursor in the right spot, and then place that i

Re: [racket] display problem

2012-04-12 Thread Roelof Wobben
Op 12-4-2012 14:00, Stephen Bloch schreef: On Apr 11, 2012, at 12:03 PM, Roelof Wobben wrote: I changed the contract to Editor -> Number. When I change the make-editor function the value changed. So I think the check-expect is wrong but I have no clue how to change it. No, the check-expect is

Re: [racket] display problem

2012-04-11 Thread Roelof Wobben
Op 11-4-2012 18:03, Roelof Wobben schreef: Op 11-4-2012 15:10, Stephen Bloch schreef: On Apr 11, 2012, at 7:39 AM, Roelof Wobben wrote: But I see something strange, Both check-expect of the function width gives as output 18. But I expect that on a empty (editor-pre verwerker) gives as output

Re: [racket] display problem

2012-04-11 Thread Roelof Wobben
Op 11-4-2012 15:10, Stephen Bloch schreef: On Apr 11, 2012, at 7:39 AM, Roelof Wobben wrote: But I see something strange, Both check-expect of the function width gives as output 18. But I expect that on a empty (editor-pre verwerker) gives as output 0. Am I mistaken or is there something wro

Re: [racket] display problem

2012-04-11 Thread Stephen Bloch
On Apr 11, 2012, at 7:39 AM, Roelof Wobben wrote: > But I see something strange, Both check-expect of the function width gives as > output 18. > But I expect that on a empty (editor-pre verwerker) gives as output 0. > > Am I mistaken or is there something wrong in my functions ? Yes, there's s

Re: [racket] display problem

2012-04-11 Thread Roelof Wobben
Op 6-4-2012 15:23, Stephen Bloch schreef: On Apr 6, 2012, at 3:39 AM, Roelof Wobben wrote: ;interp. (make-editorst)means the text in the editor is ;(string-append

Re: [racket] display problem

2012-04-06 Thread Danny Yoo
On Fri, Apr 6, 2012 at 1:38 PM, Danny Yoo wrote: >> >> Oke, >> Back to the beginning. >> >> In the text is noted. >> (define-struct editor (pre post)) >> ; Editor = (make-editor String String) >> ; interp. (make-editor s t) means the text in the editor is >> ; (string-append s t) with the cursor d

Re: [racket] display problem

2012-04-06 Thread Danny Yoo
> > Oke, > Back to the beginning. > > In the text is noted. > (define-struct editor (pre post)) > ; Editor = (make-editor String String) > ; interp. (make-editor s t) means the text in the editor is > ; (string-append s t) with the cursor displayed between s and t > > > So for aaa| s has the va

Re: [racket] display problem

2012-04-06 Thread Roelof Wobben
Op 6-4-2012 15:23, Stephen Bloch schreef: On Apr 6, 2012, at 3:39 AM, Roelof Wobben wrote: ;interp. (make-editorst)means the text in the editor is ;(string-append

Re: [racket] display problem

2012-04-06 Thread Roelof Wobben
Op 6-4-2012 9:20, Danny Yoo schreef: On Friday, April 6, 2012, Roelof Wobben wrote: Op 5-4-2012 20:29, Danny Yoo schreef: I start with this : a| Concretely, what does the editor world value look like at this point? You're representing

Re: [racket] display problem

2012-04-06 Thread Roelof Wobben
Op 5-4-2012 20:28, Stephen Bloch schreef: On Apr 5, 2012, at 1:39 PM, Roelof Wobben wrote: Op 5-4-2012 19:28, Danny Yoo schreef: Can you get the position where the cursor should start by taking the image for the left side text, and take its width? ... I start with this : a| now someone

Re: [racket] display problem

2012-04-05 Thread Danny Yoo
> I start with this : > > a| Concretely, what does the editor world value look like at this point? You're representing the state somewhat ambiguously. Can you represent the above in terms of (make-editor ... ...)? > now someone press 3 times the left key. > So I have  aa/aaa Similarly,

Re: [racket] display problem

2012-04-05 Thread Stephen Bloch
On Apr 5, 2012, at 1:39 PM, Roelof Wobben wrote: > Op 5-4-2012 19:28, Danny Yoo schreef: >> Can you get the position where the cursor should start by >> taking the image for the left side text, and take its width? >> > ... > I start with this : > > a| > > now someone press 3 times the left

Re: [racket] display problem

2012-04-05 Thread Nick Shelley
You should look into the composing image functions available. The beside function should make it so you don't need to calculate exactly where the cursor should be displayed. On Thu, Apr 5, 2012 at 11:39 AM, Roelof Wobben wrote: > Op 5-4-2012 19:28, Danny Yoo schreef: > > http://www.ccs.neu.edu/

Re: [racket] display problem

2012-04-05 Thread Roelof Wobben
Op 5-4-2012 19:28, Danny Yoo schreef: http://www.ccs.neu.edu/home/matthias/HtDP2e/htdp2e-part1.html#(part._edit1) We need more context because there's not enough information in the question to tell what you're trying to do yet. Good luck! Yes, I mean that exercise. Ah. Ok. Can you get the

Re: [racket] display problem

2012-04-05 Thread Danny Yoo
>> http://www.ccs.neu.edu/home/matthias/HtDP2e/htdp2e-part1.html#(part._edit1) >> >> We need more context because there's not enough information in the >> question to tell what you're trying to do yet. >> >> >> Good luck! > > Yes, I mean that exercise. Ah. Ok. Can you get the position where the

Re: [racket] display problem

2012-04-05 Thread Roelof Wobben
Op 5-4-2012 18:53, Danny Yoo schreef: I have a struct which contains text and the place of a cursor. The place are 2 strings which contains the character on the left and on the right of the cursor. Now I have to display this. But I wonder how I can set the cursor on the right place when I can't

Re: [racket] display problem

2012-04-05 Thread Danny Yoo
> I have a struct which contains text and the place of a cursor. > The place are 2 strings which contains the character on the left and on the > right of the cursor. > > Now I have to display this. > But I wonder how I can set the cursor on the right place when I can't know > the numbers where betw

[racket] display problem

2012-04-05 Thread Roelof Wobben
Hello, I have a struct which contains text and the place of a cursor. The place are 2 strings which contains the character on the left and on the right of the cursor. Now I have to display this. But I wonder how I can set the cursor on the right place when I can't know the numbers where betwe