0
0
mirror of https://github.com/bec-project/bec_widgets.git synced 2025-07-13 19:21:50 +02:00

docs: add documentation

This commit is contained in:
2024-06-13 08:08:20 +02:00
parent b49462abeb
commit bc709c4184
2 changed files with 34 additions and 0 deletions

View File

@ -0,0 +1,33 @@
(user.widgets.text_box)=
# [Text Box Widget](/api_reference/_autosummary/bec_widgets.cli.client.TextBoxWidget)
**Purpose:**
The Text Box Widget is a widget that allows you to display text within the BEC GUI. The widget can be used to display plain text or HTML text.
**Key Features:**
- set the text to display.
- automatically detects if the text is plain text or HTML text.
- set background color and font color.
**Code example:**
The following code snipped demonstrates how to create a `TextBox` widget using BEC Widgets within BEC.
```python
text_box = gui.add_dock().add_widget("TextBox")
# set the text to display
text_box.set_text("Hello, World!")
# set the background color and font color
text_box.set_color(backgroud_color="#FFF", font_color="#000")
# set the text to display as HTML
text_box.set_text("<h1>Welcome to BEC Widgets</h1><p>This is an example of displaying <strong>HTML</strong> text.</p>")
```

View File

@ -12,6 +12,7 @@ bec_figure/
spiral_progress_bar/
website/
buttons/
text_box/
```