On this page:
win-on-tick
win-stop-when
win-to-draw
win-on-mouse
win-on-key
win-on-release
env-key?

4 WIN and big-bang integration

 (require dos/win/big-bang) package: dos

dos/win/big-bang implements some helpers for using dos/win efficiently with 2htdp/universe. A simple example is included in the source, compare it to a version that does not use dos.

procedure

(win-on-tick cur)  win?

  cur : win?
win-boot with a suggestive name. Suitable for use with on-tick.

procedure

(win-stop-when k)  (-> win? boolean?)

  k : symbol?
Returns a function that returns something the environment maps k to. Suitable for use with stop-when.

procedure

(win-to-draw base)  (-> win? any/c)

  base : any/c
Returns a function that composes all the values that the registry maps 'gfx to using base as the initial argument. Suitable for use with to-draw when base is a image? and the function in 'gfx consume and produce image? objects.

procedure

(win-on-mouse w x y me)  win?

  w : win?
  x : integer?
  y : integer?
  me : any/c
Stores x in 'mouse-x and y in 'mouse-y and the state of the mouse button in 'mouse-down? of w’s registry. Suitable for use with on-mouse.

procedure

(win-on-key w ke)  win?

  w : win?
  ke : any/c
Records the state of the key that ke corresponds to in the 'keys entry in w’s environment. Suitable for use with on-key, when win-on-release is used with on-release.

procedure

(win-on-release w ke)  win?

  w : win?
  ke : any/c
Records the state of the key that ke corresponds to in the 'keys entry in w’s environment. Suitable for use with on-release, when win-on-key is used with on-key.

procedure

(env-key? e ke)  boolean?

  e : env?
  ke : any/c
Returns the state of the key ke in the environment e. Suitable for use within processes when win-on-key is used with on-key and win-on-release is used with on-release.