#lang scheme/gui

(define ventana
  (make-object frame% 
    "Coordenadas en x = 400 y = 300" 
    #f 
    450 350 
    400 300))

(define lienzo
  (make-object canvas%
    ventana))

(define dc (send lienzo get-dc))


(send ventana show #t)

;; Esperamos 1 seg. para actualizar el frame
(sleep/yield 1)
;; Ahora las instrucciones de dibujo propiamente
(send dc set-brush (instantiate brush% ("BLUE" 'solid)))
(send dc draw-rectangle 0 0 100 100)

;Experiencias con distintos estilos de brush
(sleep/yield 1)

(send dc set-brush (instantiate brush% ("BLUE" 'transparent)))
(send dc draw-rectangle 100 0 100 100)

(sleep/yield 1)
(send dc set-brush (instantiate brush% ("red" 'opaque)))
(send dc draw-rectangle 200 0 100 100)

(sleep/yield 1)
(send dc set-brush (instantiate brush% ("red" 'xor)))
(send dc draw-rectangle 300 0 100 100)

(sleep/yield 1)
(send dc set-brush (instantiate brush% ("red" 'hilite)))
(send dc draw-rectangle 0 110 100 100)

(sleep/yield 1)
(send dc set-brush (instantiate brush% ("red" 'panel)))
(send dc draw-rectangle 100 110 100 100)

(send dc set-brush (instantiate brush% ("BLUE" 'bdiagonal-hatch)))
(send dc draw-rectangle 200 110 100 100)

(sleep/yield 1)
(send dc set-brush (instantiate brush% ("red" 'fdiagonal-hatch)))
(send dc draw-rectangle 300 110 100 100)

(sleep/yield 1)
(send dc set-brush (instantiate brush% ("red" 'crossdiag-hatch)))
(send dc draw-rectangle 0 220 100 100)

(sleep/yield 1)
(send dc set-brush (instantiate brush% ("red" 'cross-hatch)))
(send dc draw-rectangle 100 220 100 100)

(sleep/yield 1)
(send dc set-brush (instantiate brush% ("red" 'horizontal-hatch)))
(send dc draw-rectangle 200 220 100 100)

(sleep/yield 1)
(send dc set-brush (instantiate brush% ("red" 'vertical-hatch)))
(send dc draw-rectangle 300 220 100 100)
