Is there a way to figure out the current virtual x and virtual y position of the (0,0) point of the client area when using automatic-scrollbars in a canvas? I would like to use these values to optimize my rendering.<br><br>
Thanks in advance,<br><br>-pp<br><br><br><br><br><div><span class="gmail_quote">On 12/7/06, <b class="gmail_sendername"><a href="mailto:plt-scheme-request@list.cs.brown.edu">plt-scheme-request@list.cs.brown.edu</a></b> <
<a href="mailto:plt-scheme-request@list.cs.brown.edu">plt-scheme-request@list.cs.brown.edu</a>> wrote:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Send plt-scheme mailing list submissions to<br> <a href="mailto:plt-scheme@list.cs.brown.edu">plt-scheme@list.cs.brown.edu</a><br><br>To subscribe or unsubscribe via the World Wide Web, visit<br> <a href="http://list.cs.brown.edu/mailman/listinfo/plt-scheme">
http://list.cs.brown.edu/mailman/listinfo/plt-scheme</a><br>or, via email, send a message with subject or body 'help' to<br> <a href="mailto:plt-scheme-request@list.cs.brown.edu">plt-scheme-request@list.cs.brown.edu
</a><br><br>You can reach the person managing the list at<br> <a href="mailto:plt-scheme-owner@list.cs.brown.edu">plt-scheme-owner@list.cs.brown.edu</a><br><br>When replying, please edit your Subject line so it is more specific
<br>than "Re: Contents of plt-scheme digest..."<br><br><br>[Please handle PLT Scheme list administrative tasks through the Web:<br> <a href="http://list.cs.brown.edu/mailman/listinfo/plt-scheme">http://list.cs.brown.edu/mailman/listinfo/plt-scheme
</a>]<br><br><br>Today's Topics:<br><br> 1. Re: [Mred] - syntax coloring in editor canvas (Robby Findler)<br> 2. Re: Syntax objects and strings (or "stupid infix tricks")<br> (Corey Sweeney)<br> 3. Shadowing syntax at the top (David Van Horn)
<br> 4. Re: Syntax objects and strings (or "stupid infix tricks")<br> (John Clements)<br> 5. Re: Shadowing syntax at the top (Matthew Flatt)<br> 6. double on-paint (pedro pinto)<br> 7. Re: double on-paint (Matthew Flatt)
<br><br><br>----------------------------------------------------------------------<br><br>Message: 1<br>Date: Thu, 7 Dec 2006 14:27:32 -0600<br>From: Robby Findler <<a href="mailto:robby@cs.uchicago.edu">robby@cs.uchicago.edu
</a>><br>Subject: Re: [plt-scheme] [Mred] - syntax coloring in editor canvas<br>To: "jack jack" <<a href="mailto:jack4746@hotmail.com">jack4746@hotmail.com</a>><br>Cc: <a href="mailto:plt-scheme@list.cs.brown.edu">
plt-scheme@list.cs.brown.edu</a><br>Message-ID: <<a href="mailto:20061207202734.1E2BB6C696@laime.cs.uchicago.edu">20061207202734.1E2BB6C696@laime.cs.uchicago.edu</a>><br>Content-Type: text/plain; charset=UTF-8<br><br>
color:text does significantly more than what you write below. It takes<br>a higher-level spec (namely a lexer spec), and it does the coloring<br>online in an efficient manner.<br><br>FWIW, that's the colorer that drscheme uses for its own code.
<br><br>Robby<br><br>At Thu, 07 Dec 2006 21:05:28 +0100, "jack jack" wrote:<br>> Here is what i got before viewing Framework GUI manual.<br>> For the moment i used a button, but like you said, i could make the same
<br>> using after-insert.<br>><br>> ;; changes style of the given word<br>> (define (button_fonc x y)<br>> (let* ((txt (send Canvas1 get-editor))<br>> (mot (get-text-from-user "Color Test" "whichword"))
<br>> (start (send txt find-string mot 'forward 0 'eof #t #f))<br>> (end (send txt find-string mot 'forward 0 'eof #f #f))<br>> ;(start (send txt get-start-position))<br>> ;(end (send txt get-end-position))
<br>> (delta (make-object style-delta% )))<br>> (send delta set-weight-on 'bold)<br>> (send delta set-delta-foreground (make-object color% 255 0 0) )<br>> (send txt change-style delta start end)))
<br>><br>><br>> Ok, I said i read the framework GUI (especially the color:text%), but i<br>> didn't get the main idea of it (i'll retry tomorrow ;)).<br>><br>> What would it bring me more than this code?
<br>><br>> Plus, text:color% seems to work with multiple lexeme values on a lexeme<br>> whereas in the precedent source, i can make it without changing the<br>> lexer/parser part of my code.<br>><br>> As i said, i might have missed something with text:color% ;)
<br>><br>><br>> One more question, let such a definition be:<br>><br>> (define if<br>> ....)<br>><br>> in my case, define AND if would be colored, whereas only define should be...<br>><br>> Could text:color% do the right job for me? :D
<br>><br>> _________________________________________________________________<br>> Les révélations de la starac 6 commentées par Jérémy!<br>> <a href="http://starac2006.spaces.live.com/">http://starac2006.spaces.live.com/
</a><br><br><br>------------------------------<br><br>Message: 2<br>Date: Thu, 7 Dec 2006 14:46:11 -0600<br>From: "Corey Sweeney" <<a href="mailto:corey.sweeney@gmail.com">corey.sweeney@gmail.com</a>><br>Subject: Re: [plt-scheme] Syntax objects and strings (or "stupid infix
<br> tricks")<br>To: "Danny Yoo" <<a href="mailto:dyoo@hkn.eecs.berkeley.edu">dyoo@hkn.eecs.berkeley.edu</a>><br>Cc: PLT Scheme <<a href="mailto:plt-scheme@list.cs.brown.edu">plt-scheme@list.cs.brown.edu
</a>><br>Message-ID:<br> <<a href="mailto:d1c0755b0612071246h1790aac5g689c0f3f6ff2e489@mail.gmail.com">d1c0755b0612071246h1790aac5g689c0f3f6ff2e489@mail.gmail.com</a>><br>Content-Type: text/plain; charset="iso-8859-1"
<br><br>That works. (eval `(infix ,(read-syntax `thingy1 (open-input-string "(2 +<br>3)")))) does produce 5.<br><br>Thanks<br><br>For fun I decided to test it's generality, I tried:<br><br>(read-syntax `thingy2 (open-input-string "((("))
<br><br>Which immedately complained about missmatched parenthisis. I don't really<br>need to do this, but do you know what one would one do if they needed to<br>parse a language that didn't use parenthisis charactors in the traditional
<br>maner?<br><br>Corey<br><br><br><br>On 12/7/06, Danny Yoo <<a href="mailto:dyoo@hkn.eecs.berkeley.edu">dyoo@hkn.eecs.berkeley.edu</a>> wrote:<br>><br>><br>><br>> > Is there a way to turn a string into a syntax object without calling
<br>> read?<br>> > Something feels wrong with what i'm doing. {I mean someting feels wrong<br>> > beond the fact that i'm dealing with infix notation ;)}<br>><br>> Hi Corey,<br>><br>> The function READ-SYNTAX, coupled with making a string look like a port
<br>> through the OPEN-INPUT-STRING function, should do the trick. Take a look<br>> at READ-SYNTAX in the help desk first, because it needs to take an extra<br>> argument, compared to regular READ.<br>><br>>
<br>> > i've written a re-infixer that does the reverse of Dannys "infix"<br>> > package.<br>><br>> [some code cut]<br>><br>> Ack! I didn't mean for things to get this perverse.<br>><br>
<br><br><br>--<br>((lambda (y) (y y)) (lambda (y) (y y)))<br>-------------- next part --------------<br>An HTML attachment was scrubbed...<br>URL: <a href="http://list.cs.brown.edu/pipermail/plt-scheme/attachments/20061207/94287ee3/attachment.html">
http://list.cs.brown.edu/pipermail/plt-scheme/attachments/20061207/94287ee3/attachment.html</a><br><br>------------------------------<br><br>Message: 3<br>Date: Thu, 07 Dec 2006 16:10:47 -0500<br>From: David Van Horn <
<a href="mailto:dvanhorn@cs.brandeis.edu">dvanhorn@cs.brandeis.edu</a>><br>Subject: [plt-scheme] Shadowing syntax at the top<br>To: <a href="mailto:plt-scheme@list.cs.brown.edu">plt-scheme@list.cs.brown.edu</a><br>Message-ID: <
<a href="mailto:ela018$bfo$1@sea.gmane.org">ela018$bfo$1@sea.gmane.org</a>><br>Content-Type: text/plain; charset=ISO-8859-1; format=flowed<br><br>Welcome to DrScheme, version 360-svn20nov2006.<br>Language: Standard (R5RS).
<br> > (define (let) (let))<br>let: bad syntax in: (let)<br><br>I'm pretty sure this should loop, and not be a syntax error. Is this<br>intended?<br><br>David<br><br><br><br>------------------------------<br><br>Message: 4
<br>Date: Thu, 7 Dec 2006 14:13:20 -0800<br>From: John Clements <<a href="mailto:clements@brinckerhoff.org">clements@brinckerhoff.org</a>><br>Subject: Re: [plt-scheme] Syntax objects and strings (or "stupid infix
<br> tricks")<br>To: Corey Sweeney <<a href="mailto:corey.sweeney@gmail.com">corey.sweeney@gmail.com</a>><br>Cc: Danny Yoo <<a href="mailto:dyoo@hkn.eecs.berkeley.edu">dyoo@hkn.eecs.berkeley.edu</a>>, PLT Scheme
<br> <<a href="mailto:plt-scheme@list.cs.brown.edu">plt-scheme@list.cs.brown.edu</a>><br>Message-ID: <<a href="mailto:4430CFB5-0013-4667-84B0-F1C07B26F2F7@brinckerhoff.org">4430CFB5-0013-4667-84B0-F1C07B26F2F7@brinckerhoff.org
</a>><br>Content-Type: text/plain; charset="us-ascii"<br><br><br>On Dec 7, 2006, at 12:46 PM, Corey Sweeney wrote:<br><br>> That works. (eval `(infix ,(read-syntax `thingy1 (open-input-<br>> string "(2 + 3)")))) does produce 5.
<br>><br>> Thanks<br>><br>> For fun I decided to test it's generality, I tried:<br>><br>> (read-syntax `thingy2 (open-input-string "((("))<br>><br>> Which immedately complained about missmatched parenthisis. I don't
<br>> really need to do this, but do you know what one would one do if<br>> they needed to parse a language that didn't use parenthisis<br>> charactors in the traditional maner?<br><br>You'd probably want to use a traditional parser. One such parser is
<br>Scott Owens' parser-tools package, which (IIRC) is a part of the<br>standard DrScheme distribution.<br><br>HTH,<br><br>John Clements<br><br><br>-------------- next part --------------<br>A non-text attachment was scrubbed...
<br>Name: smime.p7s<br>Type: application/pkcs7-signature<br>Size: 2484 bytes<br>Desc: not available<br>Url : <a href="http://list.cs.brown.edu/pipermail/plt-scheme/attachments/20061207/35d52434/smime-0001.bin">http://list.cs.brown.edu/pipermail/plt-scheme/attachments/20061207/35d52434/smime-0001.bin
</a><br><br>------------------------------<br><br>Message: 5<br>Date: Fri, 8 Dec 2006 06:18:22 0800<br>From: Matthew Flatt <<a href="mailto:mflatt@cs.utah.edu">mflatt@cs.utah.edu</a>><br>Subject: Re: [plt-scheme] Shadowing syntax at the top
<br>To: David Van Horn <<a href="mailto:dvanhorn@cs.brandeis.edu">dvanhorn@cs.brandeis.edu</a>><br>Cc: <a href="mailto:plt-scheme@list.cs.brown.edu">plt-scheme@list.cs.brown.edu</a><br>Message-ID: <<a href="mailto:20061207221808.31F3765008F@mail-svr1.cs.utah.edu">
20061207221808.31F3765008F@mail-svr1.cs.utah.edu</a>><br>Content-Type: text/plain; charset=UTF-8<br><br>At Thu, 07 Dec 2006 16:10:47 -0500, David Van Horn wrote:<br>> Welcome to DrScheme, version 360-svn20nov2006.<br>
> Language: Standard (R5RS).<br>> > (define (let) (let))<br>> let: bad syntax in: (let)<br>><br>> I'm pretty sure this should loop, and not be a syntax error. Is this<br>> intended?<br><br>Yes, this is as intended.
<br><br>The new binding for `let' does not exist until the definition is<br>evaluated, so the old definition of `let' applies when the RHS of the<br>definition is expanded.<br><br>It's possible for the expander to notice that `let' is being defined,
<br>and thus expand the RHS of the definition with the special assumption<br>that `let' is a variable instead of a syntactic keyword. But then<br>consider a pair of definitions grouped with `begin':<br><br> (begin<br> (define (other) (let))
<br> (define (let) 10))<br><br>If you want this to work, then `begin' has to look ahead to other<br>definitions before expanding a definition. That's certainly possible,<br>but then it's no longer the case that wrapping a sequence of top-level
<br>forms with `begin' is the same as splicing the forms into the top<br>level. So, the choice is to make this work or keep the splicing nature<br>of `begin'. If you don't make it work but change the sngle-definition<br>case, then it seems inconsistent to me. If you drop the splicing nature
<br>of `begin' then other dominoes start to fall over, such as the handling<br>of `load' in a `begin' sequence.<br><br>In short, the top level is hopeless. I'm not entirely happy with the<br>current set of compromises, but I doubt that it's worth trying to
<br>change them.<br><br>Matthew<br><br><br><br>------------------------------<br><br>Message: 6<br>Date: Thu, 7 Dec 2006 16:31:00 -0600<br>From: "pedro pinto" <<a href="mailto:pedro.e.pinto@gmail.com">pedro.e.pinto@gmail.com
</a>><br>Subject: [plt-scheme] double on-paint<br>To: <a href="mailto:plt-scheme@list.cs.brown.edu">plt-scheme@list.cs.brown.edu</a><br>Message-ID:<br> <<a href="mailto:a9ba9b560612071431i19490c96qe9536a9c7f0d4759@mail.gmail.com">
a9ba9b560612071431i19490c96qe9536a9c7f0d4759@mail.gmail.com</a>><br>Content-Type: text/plain; charset="iso-8859-1"<br><br>Hi there,<br><br>On Windows XP, with DrScheme v360, the following code:<br><br>(define f (new frame% (label "Hello")))
<br><br>(define c (new canvas% (parent f)<br> (paint-callback (lambda _ (printf "painting~n")))))<br><br>(send f show #t)<br><br>Will print "painting" twice, with a noticeable delay between the two
<br>messages, every time the frame is resized. That's not right is it?<br><br>-pp<br>-------------- next part --------------<br>An HTML attachment was scrubbed...<br>URL: <a href="http://list.cs.brown.edu/pipermail/plt-scheme/attachments/20061207/381ecf79/attachment-0001.html">
http://list.cs.brown.edu/pipermail/plt-scheme/attachments/20061207/381ecf79/attachment-0001.html</a><br><br>------------------------------<br><br>Message: 7<br>Date: Fri, 8 Dec 2006 06:48:54 0800<br>From: Matthew Flatt <
<a href="mailto:mflatt@cs.utah.edu">mflatt@cs.utah.edu</a>><br>Subject: Re: [plt-scheme] double on-paint<br>To: <a href="mailto:pedro.e.pinto@gmail.com">pedro.e.pinto@gmail.com</a><br>Cc: <a href="mailto:plt-scheme@list.cs.brown.edu">
plt-scheme@list.cs.brown.edu</a><br>Message-ID: <<a href="mailto:20061207224842.2AEC9650097@mail-svr1.cs.utah.edu">20061207224842.2AEC9650097@mail-svr1.cs.utah.edu</a>><br>Content-Type: text/plain; charset=UTF-8<br>
<br>At Thu, 7 Dec 2006 16:31:00 -0600, "pedro pinto" wrote:<br>> On Windows XP, with DrScheme v360, the following code:<br>><br>> (define f (new frame% (label "Hello")))<br>><br>> (define c (new canvas% (parent f)
<br>> (paint-callback (lambda _ (printf "painting~n")))))<br>><br>> (send f show #t)<br>><br>> Will print "painting" twice, with a noticeable delay between the two<br>> messages, every time the frame is resized. That's not right is it?
<br><br>My guess is that both resize and refresh events from from the OS, and<br>MrEd at some point triggers a refresh to handle the resize event. I may<br>be able to improve that.<br><br>Is the delay you see just a delay in DrScheme's output? I see a
<br>significant delay, too, but when I include the result of<br>`(current-milliseconds)' in the printed message, then the printed<br>numbers usually differ by only 20 or 30 milliseconds.<br><br>Matthew<br><br><br><br>End of plt-scheme Digest, Vol 16, Issue 14
<br>******************************************<br></blockquote></div><br>