mark.warren
2018-5-23 10:33:06

@ghoetker Have you used just the standard racket/gui package for that? Good stuff.


mark.warren
2018-5-23 13:11:04

Could anyone with racket/gui knowledge tell me if this is a sensible way of defining panels and swapping between them?


mark.warren
2018-5-23 13:11:11

lang racket/gui

(define frame (new frame% [label “Example”] [width 600] [height 400]))

(define start-panel (new horizontal-panel% [parent frame] [alignment ’(center center)]))

(new button% [parent start-panel] [label “Ok”] [callback (λ (button event) (swap-panel))])

(define next-panel (new horizontal-panel% [parent frame] [alignment ’(center center)] [style ’(deleted)]))

(new button% [parent next-panel] [label “Cancel”] [callback (λ (button event) (swap-panel-back))])

(define (swap-panel) (send frame delete-child start-panel) (send frame add-child next-panel))

(define (swap-panel-back) (send frame delete-child next-panel) (send frame add-child start-panel))

(send frame show #t)


ghoetker
2018-5-23 23:23:36

@ghoetker Yep. Just the standard racket/gui package. Whether I used or mis-used it is perhaps up for discussion. Even stumbling through it, I was pretty amazed with what I could do. For a truly amazing demo of what the gui can do, look at the following very recent posting and associated demo video on Reddit, https://www.reddit.com/r/Racket/comments/8lfw0o/running_and_biking_workout_editor_implemented_in/.


mark.warren
2018-5-24 06:29:36

@ghoetker Thanks. I’m just trying to get used to it at the moment.