{"size": 1296, "ext": "scrbl", "max_stars_repo_path": "htdp-doc/teachpack/htdp/scribblings/arrow-gui.scrbl", "max_stars_repo_name": "bdeket/htdp", "max_stars_repo_stars_event_min_datetime": "2015-01-14T20:28:41.000Z", "max_stars_repo_stars_event_max_datetime": "2022-03-20T04:04:26.000Z", "max_issues_repo_path": "htdp-doc/teachpack/htdp/scribblings/arrow-gui.scrbl", "max_issues_repo_name": "bdeket/htdp", "max_issues_repo_issues_event_min_datetime": "2015-01-14T19:50:21.000Z", "max_issues_repo_issues_event_max_datetime": "2022-02-19T21:38:00.000Z", "max_forks_repo_path": "htdp-doc/teachpack/htdp/scribblings/arrow-gui.scrbl", "max_forks_repo_name": "bdeket/htdp", "max_forks_repo_forks_event_min_datetime": "2015-01-14T19:11:38.000Z", "max_forks_repo_forks_event_max_datetime": "2022-03-24T05:11:39.000Z"}
{"max_stars_count": 85, "max_issues_count": 132, "max_forks_count": 81, "avg_line_length": 29.4545454545, "max_line_length": 151, "alphanum_fraction": 0.7037037037}
#lang scribble/doc

@(require scribble/manual "shared.rkt"
          (for-label scheme teachpack/htdp/arrow-gui))

@teachpack["arrow-gui"]{An Arrow GUI}

@defmodule[#:require-form beginner-require htdp/arrow-gui]

The teachpack provides functions for creating and manipulating an arrow
GUI. We recommend using @racketmodname[2htdp/universe] instead.

@deftech{modelT} @racket[(-> button% event% true)]

A @tech{modelT} is a function that accepts and ignores two arguments. 

@defproc[(control) symbol?]{Reads out the current state of the message
field.} 

@defproc[(view [s (or/c string? symbol?)]) true]{Displays @racket[s] in the
message field.} 

@defproc[(connect [l (unsyntax @tech{modelT})][r (unsyntax @tech{modelT})][u (unsyntax @tech{modelT})][d (unsyntax @tech{modelT})]) true]{Connects four
controllers with the four directions in the arrow window.}

Example:
@(begin
#reader scribble/comment-reader
(racketblock
;; Advanced
(define (make-model dir)
  (lambda (b e)
    (begin
      (view dir)
      (printf "~a ~n" (control)))))

(connect (make-model "left")
         (make-model "right")
         (make-model "up")
         (make-model "down"))
))
Now click on the four arrows. The message field contains the current
direction, the print-out the prior contents of the message field.
