[racket] Embedding a GUI editor into Slideshows

From: Robby Findler (robby at eecs.northwestern.edu)
Date: Sat Jun 11 14:57:16 EDT 2011

That does work for me, in the latest pre-release under mac os x. I
have a vague recollection that there was a linux bug related to this
that has been fixed, but I'm not sure.

One thing to try to work around it (if upgrading isn't an option) is
to actually create the frame inside the callback:

#lang slideshow
(require racket/gui)

(slide
 #:title "Test"
 (clickback (hyperlinkize (t "Hello"))
            (λ ()
              (define frame (new frame% [label "Example"]))

              (define msg (new message% [parent frame]
                               [label "No events so far..."]))

              (new button% [parent frame]
                   [label "Click Me"]
                   (callback (λ (button event)
                               (send msg set-label "Button click"))))

              (send frame show #t))))


Robby

On Sat, Jun 11, 2011 at 12:10 PM, Rodolfo Carvalho <rhcarvalho at gmail.com> wrote:
> I tried the following, but the new frame is not shown on top of the slide (I
> need to alt-tab to see it):
>
> #lang slideshow
> (require racket/gui)
> (define frame (new frame% [label "Example"]))
> (define msg (new message% [parent frame]
>                  [label "No events so far..."]))
> (new button% [parent frame]
>      [label "Click Me"]
>      (callback (λ (button event)
>                  (send msg set-label "Button click"))))
> (slide
>  #:title "Test"
>  (clickback (hyperlinkize (t "Hello"))
>             (λ () (send frame show #t))))
>
> Suggestions?
> []'s
> Rodolfo Carvalho
>
>
> On Sat, Jun 11, 2011 at 11:00, Matthew Flatt <mflatt at cs.utah.edu> wrote:
>>
>> You could have a clickback in a slide that creates a new frame on top
>> of the Slideshow frame. That approach has worked ok for me.
>>
>> At Fri, 10 Jun 2011 17:58:21 -0300, Rodolfo Carvalho wrote:
>> > Hello everybody,
>> >
>> > Has anyone had the experience of embedding a "live code editor" into
>> > Slideshow?
>> >
>> > I woke up with this idea for a coming presentation, I would talk with
>> > slides
>> > and from time to time I would show a code editor, type, and run a script
>> > (not necessarily racket code) and see the result / show to the audience.
>> >
>> > Of course this could be done alt-tabbing out of the presentation, but it
>> > would be cool to have something that follow along the presentation.
>> >
>> > Was it just a crazy dream?
>> >
>> > []'s
>> >
>> > Rodolfo Carvalho
>>
>
>
> _________________________________________________
>  For list-related administrative tasks:
>  http://lists.racket-lang.org/listinfo/users
>



Posted on the users mailing list.