[plt-scheme] pasteboard% example

From: Martin DeMello (martindemello at gmail.com)
Date: Mon Apr 13 12:01:00 EDT 2009

On Mon, Apr 13, 2009 at 7:55 PM, Todd O'Bryan <toddobryan at gmail.com> wrote:
> Does anyone have a pointer to an example of how a pasteboard% would be
> used, either in the PLT codebase or elsewhere?

Here's a minimal example of instantiating a pasteboard% and inserting
an editor-snip% into it:

#lang scheme

(require mred framework)

(define f (instantiate frame% ("Pasteboard Test" #f 600 400)))
(define c (instantiate editor-canvas% (f)))
(define p (instantiate pasteboard% ()))
(send c set-editor p)
(send f show #t)
(define t (instantiate text% ()))
(define s (instantiate editor-snip% (t)))
(send t insert "hello pasteboard world" 0)
(send p insert s)


Posted on the users mailing list.