{"size": 2638, "ext": "scrbl", "max_stars_repo_path": "gui-doc/scribblings/gui/check-box-class.scrbl", "max_stars_repo_name": "jjsimpso/gui", "max_stars_repo_stars_event_min_datetime": "2015-03-17T22:11:52.000Z", "max_stars_repo_stars_event_max_datetime": "2022-03-12T15:09:34.000Z", "max_issues_repo_path": "gui-doc/scribblings/gui/check-box-class.scrbl", "max_issues_repo_name": "jjsimpso/gui", "max_issues_repo_issues_event_min_datetime": "2015-01-09T15:53:25.000Z", "max_issues_repo_issues_event_max_datetime": "2022-03-31T16:21:29.000Z", "max_forks_repo_path": "gui-doc/scribblings/gui/check-box-class.scrbl", "max_forks_repo_name": "jjsimpso/gui", "max_forks_repo_forks_event_min_datetime": "2015-01-08T13:03:07.000Z", "max_forks_repo_forks_event_max_datetime": "2022-03-26T21:49:09.000Z"}
{"max_stars_count": 65, "max_issues_count": 231, "max_forks_count": 89, "avg_line_length": 30.3218390805, "max_line_length": 96, "alphanum_fraction": 0.6239575436}
#lang scribble/doc
@(require "common.rkt")

@centered{@image[#:suffixes @list[".png"]]{image/check-box}}

@defclass/title[check-box% object% (control<%>)]{

A check box is a labeled box which is either checked or unchecked.

Whenever a check box is clicked by the user, the check box's value is
 toggled and its callback procedure is invoked. A callback procedure
 is provided as an initialization argument when each check box is
 created.




@defconstructor[([label (or/c label-string? (is-a?/c bitmap%))]
                 [parent (or/c (is-a?/c frame%) (is-a?/c dialog%)
                               (is-a?/c panel%) (is-a?/c pane%))]
                 [callback ((is-a?/c check-box%) (is-a?/c control-event%)
                            . -> . any) (lambda (c e) (void))]
                 [style (listof (or/c 'deleted)) null]
                 [value any/c #f]
                 [font (is-a?/c font%) normal-control-font]
                 [enabled any/c #t]
                 [vert-margin spacing-integer? 2]
                 [horiz-margin spacing-integer? 2]
                 [min-width (or/c dimension-integer? #f) #f]
                 [min-height (or/c dimension-integer? #f) #f]
                 [stretchable-width any/c #f]
                 [stretchable-height any/c #f])]{

Creates a check box with a string or bitmap label. @bitmaplabeluse[label]

@labelstripped[@racket[label]
  @elem{ (when @racket[label] is a string)}
  @elem{effectively click the check box}]

The @racket[callback] procedure is called (with the event type
 @indexed-racket['check-box]) whenever the user clicks the check box.

@DeletedStyleNote[@racket[style] @racket[parent]]{check box}

If @racket[value] is true, it is passed to
@method[check-box% set-value] so that the box is initially checked.

@FontKWs[@racket[font]] @WindowKWs[@racket[enabled]] @SubareaKWs[] @AreaKWs[]



}

@defmethod[(get-value)
           boolean?]{
Gets the state of the check box: @racket[#t] if it is checked, @racket[#f]
 otherwise.

}

@defmethod[#:mode override
           (set-label [label (or/c label-string? (is-a?/c bitmap%))])
           void?]{

The same as @xmethod[window<%> set-label] when @racket[label] is a
 string.

Otherwise, sets the bitmap label for a bitmap check box.
@bitmaplabeluseisbm[label] @|bitmapiforiglabel|

}

@defmethod[(set-value [state any/c])
           void?]{

Sets the check box's state. (The control's callback procedure is
@italic{not} invoked.)

@MonitorCallback[@elem{The check box's state} @elem{the user clicking the control} @elem{state}]


If @racket[state] is @racket[#f], the box is
 unchecked, otherwise it is checked.

}}

