racket/collects/mrlib/private/aligned-pasteboard/tests/example.rkt
Eli Barzilay b8034828d0 Sort the mess with aligned-pasteboard tests.
1. Lots of #lang-ization, other racketizations, code improvements, etc.

2. Some files that were not working now do.

3. "collects/tests/aligned-pasteboard" had some files that were near
   duplicates of "collects/mrlib/private/aligned-pasteboard/tests".
   I've removed the former since in a few places it looked like an older
   version (eg, there were bogus references to a non-existent
   "utils.rkt").  The former has more files that are in runnable
   condition now.

4. There are plenty of tests that look like they're failing, but it
   wasn't shown since they just return #f, and when they were running
   with a "-f" these results weren't displayed.

5. I have no idea about the code, this is all just reshuffling and minor
   editing.
2012-06-19 01:42:20 -04:00

30 lines
1.2 KiB
Racket

#lang racket/gui
(require "../aligned-pasteboard.rkt" "../aligned-editor-container.rkt")
(define frame (new frame% [label "Frame"] [width 400] [height 400]))
(define pasteboard (new horizontal-pasteboard%))
(define canvas (new aligned-editor-canvas% [parent frame] [editor pasteboard]))
(define vp1 (new vertical-pasteboard%))
(define ae-snip1 (new aligned-editor-snip% [editor vp1]))
(define vp2 (new vertical-pasteboard%))
(define ae-snip2 (new aligned-editor-snip% [editor vp2]))
(define vp3 (new vertical-pasteboard%))
(define ae-snip3 (new aligned-editor-snip% [editor vp3]))
(define vp4 (new vertical-pasteboard%))
(define ae-snip4 (new aligned-editor-snip% [editor vp4]))
(define vp5 (new vertical-pasteboard%))
(define ae-snip5 (new aligned-editor-snip% [editor vp5]))
(define t-snip1 (new editor-snip% [editor (instantiate text% ())]))
(define t-snip2 (new editor-snip% [editor (instantiate text% ())]))
(send pasteboard insert ae-snip1 false)
(send pasteboard insert ae-snip2 false)
(send pasteboard insert ae-snip5 false)
(send vp2 insert ae-snip3 false)
(send vp2 insert ae-snip4 false)
(send vp1 insert t-snip1 false)
(send vp5 insert t-snip2 false)
(send frame show true)