{"size": 2613, "ext": "scrbl", "max_stars_repo_path": "gui-table/docs/gui-table.scrbl", "max_stars_repo_name": "AlexKnauth/racket-gui-table", "max_stars_repo_stars_event_min_datetime": "2015-04-04T08:27:39.000Z", "max_stars_repo_stars_event_max_datetime": "2015-04-05T09:21:23.000Z", "max_issues_repo_path": "gui-table/docs/gui-table.scrbl", "max_issues_repo_name": "AlexKnauth/racket-gui-table", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "gui-table/docs/gui-table.scrbl", "max_forks_repo_name": "AlexKnauth/racket-gui-table", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": 2, "max_issues_count": null, "max_forks_count": null, "avg_line_length": 35.7945205479, "max_line_length": 99, "alphanum_fraction": 0.4890929966}
#lang scribble/manual

@(require (for-label gui-table
                     racket
                     racket/gui/base
                     ))

@title{gui-table}

@defmodule[gui-table]

@defclass[table% vertical-panel% ()]{
@defconstructor/auto-super[([content (listof (listof cell-content/c))]
                            [style (listof (or/c 'border 'deleted
                                                 'hscroll 'auto-hscroll
                                                 'vscroll 'auto-vscroll))
                                   '(vscroll)]
                            [cell-alignment (list/c (or/c 'left 'center 'right)
                                                    (or/c 'top 'center 'bottom))
                                            '(center center)]
                            [min-column-width (and/c real? (not/c negative?))
                                              0]
                            [min-row-height (and/c real? (not/c negative?))
                                            0]
                            )]{
An example use:
@(racketblock
  (define frame
    (new frame% [label "The Frame"] [width 400] [height 400]))
  (define my-table
    (new table%
         [parent frame]
         [content
          (list (list (λ (parent) (new message% [label "Hi!"] [parent parent]))
                      (λ (parent) (new message% [label "Hello!"] [parent parent])))
                (list (λ (parent) (new button% [label "I am a button!"] [parent parent]
                                       [callback (λ (b e) (displayln "You pressed the button!"))]))
                      (λ (parent) (new message% [label "Bye!"] [parent parent]))))]))
  (send frame show #t))
}
}

@defthing[cell-content/c
          chaperone-contract?
          #:value (recursive-contract
                   (or/c [panel? . -> . (or/c area? cell-content/c)]
                         string?)
                   #:chaperone)]{
Represents a cell in a @racket[table%].

It should either be a function of one argument, or a string.

If it's a function, then it should produce a gui object, and the argument to the
function should be passed as the parent to that object. 

An example would be:
@(racketblock
  (λ (parent)
    (new message% [label "Hello!"] [parent parent])))

If it's a string, then it is converted to a procedure that produces a
@racket[message%] object with the given string and the given parent.
}

@defproc[(panel? [v any/c]) boolean?]{
Returns true if @racket[v] is a @racket[panel%].
}

@defproc[(area? [v any/c]) boolean?]{
Returns true if @racket[v] is an @racket[area<%>].
}

