API Reference
adafruit_checkbox
- A displayio based CheckBox widget. It includes a text label and a box
that can be checked or unchecked.
Author(s): Tim Cocks
Implementation Notes
Hardware:
Any displayio compatible display
Software and Dependencies:
Adafruit CircuitPython firmware for the supported boards: https://circuitpython.org/downloads
- class adafruit_checkbox.CheckBox(*args: Any, **kwargs: Any)
A displayio based CheckBox widget. It includes a text label and a box that can be checked or unchecked.
- Parameters:
font (FontProtocol) – The font to use for the CheckBox’s label
spritesheet – An OnDiskBitmap or Bitmap to use as the sprite sheet for the CheckBox. It should be twice as wide as it is tall, the right half should contain the checked state sprite. If None is provided, a basic checkbox bitmap will be used by default.
pixel_shader – The pixel shader to use if a Bitmap was passed for spritesheet. Unused if spritesheet is not a Bitmap
text (string) – The text to show next to the CheckBox
text_color (int) – The color of the text next to the CheckBox as an RGB hex integer.
text_background_color (int) – The background color of the text next to the CheckBox as an RGB hex integer.
checked (bool) – Whether the CheckBox is checked when created.
- property anchor_point
The anchor point. tuple containing x and y values ranging from 0.0 to 1.0.
- property anchored_position: Tuple[int, int]
Position relative to the anchor_point. Tuple containing x,y pixel coordinates.
- property checked
Whether the CheckBox is currently checked. :return: True if checked, False otherwise.
- contains(point: tuple[int, int] | List[int] | List[Dict[str, int]]) bool
Used to determine if a point is contained within this AnchoredGroup. For example,
anchored_group.contains(touch)wheretouchis the touch point on the screen will allow for determining that the group has been touched.
- property height
The height of the Group in pixels, readonly.
:return int width in pixels
- property size
The width and height of the Group in pixels, readonly.
- Returns:
tuple (width, height)
- property width
The width of the Group in pixels, readonly.
- Returns:
int width in pixels