#lang racket/gui
(define frame (new frame% [label "Test"] [width 300]
[height 300]))
(define text (new text%))
(define canvas (new editor-canvas% [parent frame]
[editor text]))
(define style-delta (make-object style-delta%))
;; do some red
(send style-delta set-delta-foreground "red")
(send text change-style style-delta)
(send text insert "Hello world in red\n")
;; do some blue
(send style-delta set-delta-foreground "blue")
(send text change-style style-delta)
(send text insert "Now available in blue\n")
;; do some modern
(send style-delta set-delta-foreground "black")
(send style-delta set-family 'modern)
(send text change-style style-delta)
(send text insert "Now available in modern\n(fixed width)")
(send frame show #t)
'Programming' 카테고리의 다른 글
Microsoft Visual studio 2005 express edition offline installation file (ISO) download. (0) | 2015.06.29 |
---|---|
Compiling a C# Project using Command Line Tools (Example) (0) | 2015.06.18 |
Regex Syntax (0) | 2015.06.17 |
(Common Lisp) multiple-value-bind (0) | 2015.06.15 |
Excel VBA Speed and Efficiency (0) | 2015.06.04 |