[racket] Adding "undo" and "redo" to racket/gui menu item

From: Matthew Flatt (mflatt at cs.utah.edu)
Date: Sat Feb 1 19:22:02 EST 2014

You'll need to enable history saving to support undo with something
like

 (send t set-max-undo-history 512)


At Sat, 1 Feb 2014 15:15:02 -0800, Harry Spier wrote:
> The following code from the racket/gui documentation gives me an "edit"
> menu with "copy', "cut","paste","select all","delete"  working but "redo"
> and "undo" don't appear to be working.
> 
> Do I have to add code to get "undo", "redo" to work in the "edit" menu.  If
> so what code do I need to add?
> 
> Thanks,
> Harry Spier
> ---------------------------------
> #lang racket/gui
> (define frame (new frame% [label "Example"]))
> (send frame show #t)
> 
> (define c (new editor-canvas% [parent frame]))
> (define t (new text%))
> (send c set-editor t)
> 
> (define mb (new menu-bar% [parent frame]))
> (define m-edit (new menu% [label "Edit"] [parent mb]))
> (define m-font (new menu% [label "Font"] [parent mb]))
> (append-editor-operation-menu-items m-edit #t)
> (append-editor-font-menu-items m-font)
> 
> 
> -----------------------------------------------------------------
> ____________________
>   Racket Users list:
>   http://lists.racket-lang.org/users

Posted on the users mailing list.