Re: [racket-users] redundancy in GUI callback functions

2019-05-26 Thread Travis Hinkelman
Ah, well, that was more straightforward than I expected. I was lazy with my Saturday-night learning session and didn't push very hard to solve it on my own. Thank you for taking the time to help. I also appreciate that you caught those bugs and improved the code style. Thanks again. On

Re: [racket-users] redundancy in GUI callback functions

2019-05-25 Thread Sorawee Porncharoenwase
Just abstract the common part out? E.g., (define (update-text-field read-field write-field converter) (define text (send read-field get-value)) (cond [(string=? text "") (send read-field set-field-background (make-object color% 255 255 255 1)) (send write-field set-value "")]

[racket-users] redundancy in GUI callback functions

2019-05-25 Thread Travis Hinkelman
Hi All, I'm working through the tasks in 7guis to learn about GUI programming in Racket. My code for the temperature converter task works as expected but there is a lot of