book%
add-loc
set-page
cycle%
activate
Version: 5.0.2

Books and Cycles

Sam Anklesaria

 (require books)

Books and cycles are two widgets for use with the frtime language. They define modal containers that only displays one of their children at a time.

book% : class?

  superclass: pane%

  extends: area-container<%>
 subarea<%>

(new book% [page page] 
  [parent parent] 
  [[vert-margin vert-margin] 
  [horiz-margin horiz-margin] 
  [min-width min-width] 
  [min-height min-height] 
  [stretchable-width stretchable-width] 
  [stretchable-height stretchable-height]]) 
  (is-a?/c book%)
  page : event?
  parent : 
(or/c (is-a?/c frame%) (is-a?/c dialog%)
      (is-a?/c panel%) (is-a?/c pane%))
  vert-margin : (integer-in 0 1000) = 2
  horiz-margin : (integer-in 0 1000) = 2
  min-width : (integer-in 0 10000) = graphical-minimum-width
  min-height : (integer-in 0 10000) = graphical-minimum-height
  stretchable-width : any/c = #f
  stretchable-height : any/c = #f
The pane% argument takes an event carrying the names of the page to go to on updates

(send a-book add-loc name)  void?
  name : symbol?
Declares the name of the next child added to the book%.

(send a-book set-page name)  void?
  name : symbol?
Sets the starting page for a book%.

cycle% : class?

  superclass: pane%

  extends: area-container<%>
 subarea<%>
(new cycle% [parent parent] 
  [[vert-margin vert-margin] 
  [horiz-margin horiz-margin] 
  [min-width min-width] 
  [min-height min-height] 
  [stretchable-width stretchable-width] 
  [stretchable-height stretchable-height]]) 
  (is-a?/c cycle%)
  parent : 
(or/c (is-a?/c frame%) (is-a?/c dialog%)
      (is-a?/c panel%) (is-a?/c pane%))
  vert-margin : (integer-in 0 1000) = 2
  horiz-margin : (integer-in 0 1000) = 2
  min-width : (integer-in 0 10000) = graphical-minimum-width
  min-height : (integer-in 0 10000) = graphical-minimum-height
  stretchable-width : any/c = #f
  stretchable-height : any/c = #f

(send a-cycle activate)  void?
Must be called before showing a cycle%.