Re: [racket-users] Re: Requesting feedback on CSS3 parser and tokenizer

2020-05-12 Thread Sage Gerard
> I now very little about web technologies and web development, so this might
> be a stupid question:  could you explain what types of applications might
> need a to parse CSS files?

Linters and minifiers.

Linters are proofreaders for your code. They need to parse code to alert users 
to things like two items not being alphabetized, or inconsistent indentation. A 
good linter for CSS in particular is https://stylelint.io

Minifiers rewrite code to use the fewest possible characters. Good CSS 
minifiers need a parser to find repetition in some styles, and reorganize them 
accordingly.


> Are you working towards a web browser in Racket?

Gosh, no. A bare-bones browser is a summer project if you rush. A GOOD browser 
is a monstrous piece of software and I couldn't dream of implementing one 
without a dedicated team.

My needs are a little different. Right now if I move my website's files around, 
all of my files "follow" each other by updating their own relative paths. The 
part that does that for my CSS is precariously balanced on regular expressions. 
Having a CSS parser helps me do that better, and it gives me more processing 
options as a bonus. So if I later want to implement a minifier or a small 
linter, I can do so.


~slg

‐‐‐ Original Message ‐‐‐
On Tuesday, May 12, 2020 11:39 PM, Hendrik Boom  wrote:

> On Tue, May 12, 2020 at 05:35:59PM -0700, Alex Harsanyi wrote:
>
> > I now very little about web technologies and web development, so this might
> > be a stupid question: could you explain what types of applications might
> > need a to parse CSS files? I can only think of one, and that is a web
> > browser. Are you working towards a web browser in Racket?
>
> I think CSS can also be used in .odt format files. Not sure, though.
> Don't have my .odt manual at hand.
> And in .epub files.
>
> -- hendrik
>
> > Alex.
> > On Wednesday, May 13, 2020 at 6:37:22 AM UTC+8, Sage Gerard wrote:
> >
> > > I'm working to release a CSS3 tokenizer and parser to the catalog
> > > tomorrow.
> > > https://github.com/zyrolasting/css3-syntax
> > > The current state lacks tests, so any logic errors should keep me busy for
> > > a little longer. I'm here to ask for bug reports and feedback in the issue
> > > tracker since I had my head in the weeds long enough.
> >
> > --
> > You received this message because you are subscribed to the Google Groups 
> > "Racket Users" group.
> > To unsubscribe from this group and stop receiving emails from it, send an 
> > email to racket-users+unsubscr...@googlegroups.com.
> > To view this discussion on the web visit 
> > https://groups.google.com/d/msgid/racket-users/268eace0-f69e-44d4-b59c-13ef767d1108%40googlegroups.com.
>
> --
>
> You received this message because you are subscribed to the Google Groups 
> "Racket Users" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to racket-users+unsubscr...@googlegroups.com.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/racket-users/20200513033923.h4tbljscffhi3v66%40topoi.pooq.com.


-- 
You received this message because you are subscribed to the Google Groups 
"Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to racket-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/racket-users/Ccb2yGxs6DvC5aRHlpu-EUaziv5GQtNOlDP78G2gHjJawjlH825IKbGFMBIsR07DMIYxXet5AmmW7xCRj5xiZ_7Mf_AXXA_7lJVkBLVTEIw%3D%40sagegerard.com.


Re: [racket-users] Re: Typing lag with DrRacket on Linux

2020-05-12 Thread evdubs
I did some more digging and found locations in racket/draw that control 
antialiasing. I tried changing them around, and saw no impact on 
performance.

However, I eventually stumbled upon the environment variable 
PLT_DISPLAY_BACKING_SCALE. By using an integer value for this variable, 
performance is nice and smooth (I tried 1 and 2; trying 1.25 and 1.5 hurt 
performance). In Ubuntu, I do not have my display set to a fractional 
scaling value, but I do have "Large Text" enabled. I am unsure if this 
setting interferes with whatever PLT_DISPLAY_BACKING_SCALE defaults to.

If you're having typing lag issues on Linux within Dr Racket or other 
Racket GUI applications, you may want to try PLT_DISPLAY_BACKING_SCALE=1 to 
see if that affects performance.

Evan

On Monday, May 11, 2020 at 2:05:06 PM UTC-10, evdubs wrote:
>
> I think what I have seen previously with setting the canvas style to 
> 'transparent ultimately is turning off antialiasing in Cairo.
>
> Using the sample text editor from this thread, I ran the following:
>
> $ cairo-trace racket text-editor.rkt
> $ cairo-trace racket text-editor-transparent.rkt
>
> In the non-transparent version, we see these two lines:
>
> 16 0 0 16 0 0 matrix 2 0 0 2 0 0 matrix << /antialias //ANTIALIAS_SUBPIXEL 
> /subpixel-order //SUBPIXEL_ORDER_RGB /hint-style //HINT_STYLE_SLIGHT 
> /hint-metrics //HINT_METRICS_ON >> scaled-font /sf0 exch def
> f0 32 0 0 32 0 0 matrix 2 0 0 2 0 0 matrix << /antialias 
> //ANTIALIAS_SUBPIXEL /subpixel-order //SUBPIXEL_ORDER_RGB /hint-style 
> //HINT_STYLE_SLIGHT /hint-metrics //HINT_METRICS_ON >> scaled-font /sf1 
> exch def
>
> These lines look like this in the transparent version:
>
> 16 0 0 16 0 0 matrix 2 0 0 2 0 0 matrix << /hint-metrics //HINT_METRICS_ON 
> >> scaled-font /sf0 exch def
> f0 32 0 0 32 0 0 matrix 2 0 0 2 0 0 matrix << /hint-metrics 
> //HINT_METRICS_ON >> scaled-font /sf1 exch def
>
> I am not really sure how this initialization is happening. Can someone 
> help me poke through the code to see how I might disable antialiasing? 
> Should I try to make changes to gui-lib/mred/private/wx/gtk/gcwin.rkt?
>
> Evan
>
> On Friday, March 29, 2019 at 12:29:11 AM UTC-10, Bryan Lee wrote:
>>
>> I’m facing the same issues, and I came across an interesting observation. 
>>
>> It seems that DrRacket mimics scrolling behaviour by literally replacing 
>> each line of code with the line above or below, and uses a really 
>> inefficient method of tracking which lines should go where, thereby 
>> limiting how fast you can “scroll”. 
>>
>> I realised that resizing the window horizontally does nothing to improve 
>> performance, but shrinking the window height significantly improved 
>> performance, even if the canvas area is adjusted to remain the same. 
>>
>> In addition to some function definitions in unit.rkt describing the 
>> transposing of lines, that leads me to my conclusion. 
>>
>> Thoughts? 
>>
>>
>>
>> On Friday, 2 November 2018 10:46:29 UTC+8, evdubs  wrote: 
>> > Resurrecting an old thread. 
>> > 
>> > 
>> > I recently tried to see what would happen if I changed the 
>> interactions-canvas% and definitions-canvas% to be the following: 
>> > 
>> > 
>> >   (define interactions-canvas% 
>> > (class editor-canvas% 
>> >   (init [style '(transparent)]) 
>> >   (super-new (style (cons 'auto-hscroll style))) 
>> >   (inherit set-scroll-via-copy) 
>> >   (set-scroll-via-copy #t))) 
>> > 
>> > 
>> > 
>> >   (define definitions-canvas% 
>> > (class editor-canvas% 
>> >   (init [style '(transparent)]) 
>> >   (super-new (style (cons 'auto-hscroll style))) 
>> >   (inherit set-scroll-via-copy) 
>> >   (set-scroll-via-copy #t))) 
>> > 
>> > 
>> > This seemed to work well for entering text into a blank file, but 
>> opening another file still showed the same lag. I was able to remove this 
>> last bit of lag by unchecking Edit / Preferences / Editing / General 
>> Editing / Color syntax interactively. I can now enter text into Dr Racket 
>> as smoothly as I can in most other text editors and even the example 
>> 'transparent editor-canvas% text editor. Background expansion can even be 
>> enabled without incurring a per-character-entered performance hit. 
>> > 
>> > 
>> > 
>> > I do not know why setting 'transparent helps the performance of 
>> editor-canvas%. Likewise, I do not know why interactive syntax coloring 
>> also incurs a noticeable performance hit. As a reminder, this is mostly a 
>> problem for large resolution displays. Shrinking the DrRacket window will 
>> improve performance at the cost of not being able to see as much of the 
>> text. 
>> > 
>> > 
>> > 
>> > If anyone has advice for why this might be so, or how to better profile 
>> this code to determine what can be improved, please share. I do not think 
>> my current modifications merit a PR to the DrRacket repository. 
>> > 
>> > 
>> > Evan 
>> > 
>> > 
>> > On Wednesday, February 21, 2018 at 10:50:58 PM UTC-10, evdubs wrote:

Re: [racket-users] Re: Requesting feedback on CSS3 parser and tokenizer

2020-05-12 Thread Hendrik Boom
On Tue, May 12, 2020 at 05:35:59PM -0700, Alex Harsanyi wrote:
> I now very little about web technologies and web development, so this might 
> be a stupid question:  could you explain what types of applications might 
> need a to parse CSS files?  I can only think of one, and that is a web 
> browser.  Are you working towards a web browser in Racket?

I think CSS can also be used in .odt format files.  Not sure, though.
Don't have my .odt manual at hand.
And in .epub files.

-- hendrik

> 
> Alex.
> 
> On Wednesday, May 13, 2020 at 6:37:22 AM UTC+8, Sage Gerard wrote:
> >
> > I'm working to release a CSS3 tokenizer and parser to the catalog 
> > tomorrow. 
> >
> > https://github.com/zyrolasting/css3-syntax
> >
> > The current state lacks tests, so any logic errors should keep me busy for 
> > a little longer. I'm here to ask for bug reports and feedback in the issue 
> > tracker since I had my head in the weeds long enough. 
> 
> -- 
> You received this message because you are subscribed to the Google Groups 
> "Racket Users" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to racket-users+unsubscr...@googlegroups.com.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/racket-users/268eace0-f69e-44d4-b59c-13ef767d1108%40googlegroups.com.

-- 
You received this message because you are subscribed to the Google Groups 
"Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to racket-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/racket-users/20200513033923.h4tbljscffhi3v66%40topoi.pooq.com.


Re: [racket-users] Re: Racket Program doesn't save

2020-05-12 Thread Sai Ganesh Buchireddy
Tries saving it on desktop, downloads and also Dr.Racket folder but doesn't 
work

On Wednesday, May 13, 2020 at 1:20:32 AM UTC+5:30, Stephen De Gabrielle 
wrote:
>
> What happens if you try to save to Desktop?
>
> S.
>
> On Mon, 11 May 2020 at 22:56, Sai Ganesh Buchireddy  > wrote:
>
>> After I save the file and try to close Dr. Racket, I get the msg saying 
>> the file is not saved as shown in the 2nd image.
>>
>> On Tuesday, May 12, 2020 at 3:23:40 AM UTC+5:30, Sai Ganesh Buchireddy 
>> wrote:
>>>
>>> I'm trying to save a program in Dr. Racket but it doesn't seem to work 
>>> for some reason. I'm using version racket-7.7-x86_64-macosx & running macOS 
>>> Catalina Version 10.15.3
>>>
>> -- 
>> You received this message because you are subscribed to the Google Groups 
>> "Racket Users" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to racket...@googlegroups.com .
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/racket-users/342be18c-653b-4b3c-a157-7201cf698da7%40googlegroups.com
>>  
>> 
>> .
>>
> -- 
> 
>

-- 
You received this message because you are subscribed to the Google Groups 
"Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to racket-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/racket-users/32a7ad5c-874d-401c-bdd3-88656d51cd44%40googlegroups.com.


[racket-users] Re: Requesting feedback on CSS3 parser and tokenizer

2020-05-12 Thread Alex Harsanyi
I now very little about web technologies and web development, so this might 
be a stupid question:  could you explain what types of applications might 
need a to parse CSS files?  I can only think of one, and that is a web 
browser.  Are you working towards a web browser in Racket?

Alex.

On Wednesday, May 13, 2020 at 6:37:22 AM UTC+8, Sage Gerard wrote:
>
> I'm working to release a CSS3 tokenizer and parser to the catalog 
> tomorrow. 
>
> https://github.com/zyrolasting/css3-syntax
>
> The current state lacks tests, so any logic errors should keep me busy for 
> a little longer. I'm here to ask for bug reports and feedback in the issue 
> tracker since I had my head in the weeds long enough. 

-- 
You received this message because you are subscribed to the Google Groups 
"Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to racket-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/racket-users/268eace0-f69e-44d4-b59c-13ef767d1108%40googlegroups.com.


[racket-users] Requesting feedback on CSS3 parser and tokenizer

2020-05-12 Thread Sage Gerard
I'm working to release a CSS3 tokenizer and parser to the catalog tomorrow.

https://github.com/zyrolasting/css3-syntax

The current state lacks tests, so any logic errors should keep me busy for a 
little longer. I'm here to ask for bug reports and feedback in the issue 
tracker since I had my head in the weeds long enough.

-- 
You received this message because you are subscribed to the Google Groups 
"Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to racket-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/racket-users/VOPNtQlIelbalknQ4qnuGfMGIskTTx7CbQXCZIhAz47QejITmyJ1SPGsP8S5XXLGa6GWQuGNPvGG-uj1-1vXOy8ZrFSckamfimz2toEmYUo%3D%40sagegerard.com.


Re: [racket-users] Re: Racket Program doesn't save

2020-05-12 Thread Stephen De Gabrielle
What happens if you try to save to Desktop?

S.

On Mon, 11 May 2020 at 22:56, Sai Ganesh Buchireddy 
wrote:

> After I save the file and try to close Dr. Racket, I get the msg saying
> the file is not saved as shown in the 2nd image.
>
> On Tuesday, May 12, 2020 at 3:23:40 AM UTC+5:30, Sai Ganesh Buchireddy
> wrote:
>>
>> I'm trying to save a program in Dr. Racket but it doesn't seem to work
>> for some reason. I'm using version racket-7.7-x86_64-macosx & running macOS
>> Catalina Version 10.15.3
>>
> --
> You received this message because you are subscribed to the Google Groups
> "Racket Users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to racket-users+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/racket-users/342be18c-653b-4b3c-a157-7201cf698da7%40googlegroups.com
> 
> .
>
-- 


-- 
You received this message because you are subscribed to the Google Groups 
"Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to racket-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/racket-users/CAGHj7-Kms_TnLDLpMKC-hu%2B1Rf6dS9foAVKeNTvfpSum6frsqQ%40mail.gmail.com.


Re: [racket-users] Re: Racket Program doesn't save

2020-05-12 Thread Stephen De Gabrielle
What is the full path for the save?

On Mon, 11 May 2020 at 23:05, Sorawee Porncharoenwase <
sorawee.pw...@gmail.com> wrote:

> Does tst.rkt get created? I use racket-7.7-x86_64-macosx and run macOS
> Catalina too, but could not reproduce the problem.
>
> On Mon, May 11, 2020 at 2:56 PM Sai Ganesh Buchireddy 
> wrote:
>
>> After I save the file and try to close Dr. Racket, I get the msg saying
>> the file is not saved as shown in the 2nd image.
>>
>> On Tuesday, May 12, 2020 at 3:23:40 AM UTC+5:30, Sai Ganesh Buchireddy
>> wrote:
>>>
>>> I'm trying to save a program in Dr. Racket but it doesn't seem to work
>>> for some reason. I'm using version racket-7.7-x86_64-macosx & running macOS
>>> Catalina Version 10.15.3
>>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "Racket Users" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to racket-users+unsubscr...@googlegroups.com.
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/racket-users/342be18c-653b-4b3c-a157-7201cf698da7%40googlegroups.com
>> 
>> .
>>
> --
> You received this message because you are subscribed to the Google Groups
> "Racket Users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to racket-users+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/racket-users/CADcueguBVN0KTaL%2BJimv%2B%3DX7-ctB8Jyr_Xy6qnYH_eU%2BF9ZM_g%40mail.gmail.com
> 
> .
>
-- 


-- 
You received this message because you are subscribed to the Google Groups 
"Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to racket-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/racket-users/CAGHj7-JSfp5v6DbC10qoParowjTipm-tZqUKdW5YJw20TEnftg%40mail.gmail.com.


[racket-users] Re: Button click callback syntax

2020-05-12 Thread gfb
The difference is whether you are evaluating an expression, versus
putting it inside a function to be evaluated when the function is called.

(require racket/gui)

; Call message-box, get an immediate effect ...
(message-box "What do you think?" "hi, would you like a tomato" #f 
'(yes-no))
; The result ('yes or 'no) is printed in the repl/Interactions.

; Create a function/procedure, that takes no arguments, and its body calls 
message-box ...
(lambda () (message-box "Greeting" "hi, would you like a tomatillo" #f 
'(yes-no)))
; That which prints as # since it's a function, and we didn't 
call it.

; To call a function we put parentheses around it ...
((lambda () (message-box "Greeting" "hi, would you like a pomodoro" #f 
'(yes-no)))
 )
; That evaluated the body.

; Name a function ...
(define greeter (lambda () (message-box "Greeting" "hi, would you like a 
green tomato" #f '(yes-no
; That didn't call it, and neither do ...
greeter
greeter
; Those just mention the function, which prints as #.
; Call it to evaluate the body ..
(greeter)

By the way, your examples that don't wait 30 minutes actually do,
and if you wait 30 minutes they will try to call the callback, which
is not a function but the 'ok result from the message-box.

Try setting the timer to something shorter, and then wait after
you click the immediate message box, then when the timer
goes off there will be an error something like ...
application: not a procedure;
 expected a procedure that can be applied to arguments
  given: 'ok
  arguments...: [none]

-- 
You received this message because you are subscribed to the Google Groups 
"Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to racket-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/racket-users/884d5359-b94f-49ec-b9d5-699dfd844c6c%40googlegroups.com.


Re: [racket-users] Button click callback syntax

2020-05-12 Thread David Storrs
Hi Philip,

The essence here is when evaluation happens:

;  All of these are equivalent:
(define foo (lambda () 7)
(define foo (thunk 7))  ; 'thunk' is a term of art meaning "function
of 0 arguments"
(define (foo) 7)

Try running the following code in the repl:
; start code
(define (general-callback msg-name msg-text message-box-text) ;
function of 3 arguments
  'result-of-general-callback)
general-callback
(general-callback "name" "text" "msg box text")
; end code

You'll see that 'general-callback' returns:
#, which is the actual function
and (general-callback ...) returns 'result-of-general-callback, which
is the result of invoking the function.


In your GUI code, you want to be passing the function itself, not the
result of invoking the function.

Does that make sense?


On Tue, May 12, 2020 at 12:34 PM Philip Benade  wrote:
>
> Hi All
>
> I am new to Racket and I have found a situation where I'm not certain why 
> Racket works the way it does. Unfortunately I am not sure of the vocabulary 
> so I will describe the situation with some code:
>
>
> ; A button made this way works as I would expect, it waits for 30 minutes and 
> then shows a message-box and plays a sound.
> (new button% [parent long-break-panel]
>  [label "Long Break"]
>  ; Callback procedure for a button click:
>  [callback (lambda (button event)
>  (send long-break-msg set-label "Long break timer 
> started")
>  (general-timer 30 long-break-callback))])
>
> ; A button made this way immediately shows the message box and plays the 
> sound.
> (new button% [parent long-break-panel]
>  [label "Long Break"]
>  ; Callback procedure for a button click:
>  [callback (lambda (button event)
>  (send long-break-msg set-label "Long break timer 
> started")
>  (general-timer 30 (general-callback long-break-msg 
> "Not on long break" "30 Minutes have passed, back to work.")))])
>
> ; A button made this way also immediately shows the message box and plays the 
> sound. Why is it different when the function name is surrounded by 
> parentheses?
> (new button% [parent long-break-panel]
>  [label "Long Break"]
>  ; Callback procedure for a button click:
>  [callback (lambda (button event)
>  (send long-break-msg set-label "Long break timer 
> started")
>  (general-timer 30 (long-break-callback)))])
>
> ; The documentation for buttons say they require a callback. I interpreted 
> this to mean a function that will execute when the button is clicked.
> (define general-callback
>   (lambda (msg-name msg-text message-box-text)
> (time-expired-sound)
> (send msg-name set-label msg-text)
> (message-box "Timer expired" message-box-text frame)))
>
> ; Why does wrapping the function so that it takes no parameters change how it 
> gets executed?
> (define long-break-callback
>   (lambda ()
> (general-callback long-break-msg "Not on long break" "30 Minutes have 
> passed, back to work.")))
>
>
> Is anyone able to explain why I am getting these different behaviors from 
> these buttons?
>
> Regards
> Philip
>
> --
> You received this message because you are subscribed to the Google Groups 
> "Racket Users" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to racket-users+unsubscr...@googlegroups.com.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/racket-users/3a6effce-915e-42c8-aff7-56fc23524e4c%40googlegroups.com.

-- 
You received this message because you are subscribed to the Google Groups 
"Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to racket-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/racket-users/CAE8gKodGj1dFEcjW-ED9GdXsy37F0gCsxfHbhPuFxOCXwWgToQ%40mail.gmail.com.


[racket-users] Button click callback syntax

2020-05-12 Thread Philip Benade
Hi All

I am new to Racket and I have found a situation where I'm not certain why 
Racket works the way it does. Unfortunately I am not sure of the vocabulary 
so I will describe the situation with some code:


; A button made this way works as I would expect, it waits for 30 minutes 
and then shows a message-box and plays a sound.
(new button% [parent long-break-panel]
 [label "Long Break"]
 ; Callback procedure for a button click:
 [callback (lambda (button event)
 (send long-break-msg set-label "Long break timer 
started")
 (general-timer 30 long-break-callback))])

; A button made this way immediately shows the message box and plays the 
sound.
(new button% [parent long-break-panel]
 [label "Long Break"]
 ; Callback procedure for a button click:
 [callback (lambda (button event)
 (send long-break-msg set-label "Long break timer 
started")
 (general-timer 30 (general-callback long-break-msg 
"Not on long break" "30 Minutes have passed, back to work.")))])

; A button made this way also immediately shows the message box and plays 
the sound. Why is it different when the function name is surrounded by 
parentheses?
(new button% [parent long-break-panel]
 [label "Long Break"]
 ; Callback procedure for a button click:
 [callback (lambda (button event)
 (send long-break-msg set-label "Long break timer 
started")
 (general-timer 30 (long-break-callback)))])

; The documentation for buttons say they require a callback. I interpreted 
this to mean a function that will execute when the button is clicked.
(define general-callback
  (lambda (msg-name msg-text message-box-text)
(time-expired-sound)
(send msg-name set-label msg-text)
(message-box "Timer expired" message-box-text frame)))

; Why does wrapping the function so that it takes no parameters change how 
it gets executed?
(define long-break-callback
  (lambda ()
(general-callback long-break-msg "Not on long break" "30 Minutes have 
passed, back to work.")))


Is anyone able to explain why I am getting these different behaviors from 
these buttons?

Regards
Philip

-- 
You received this message because you are subscribed to the Google Groups 
"Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to racket-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/racket-users/3a6effce-915e-42c8-aff7-56fc23524e4c%40googlegroups.com.