diff --git a/docs/user/widgets/text_box.md b/docs/user/widgets/text_box.md new file mode 100644 index 00000000..6a8aefa5 --- /dev/null +++ b/docs/user/widgets/text_box.md @@ -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("
This is an example of displaying HTML text.
") +``` + + + + + + + + + diff --git a/docs/user/widgets/widgets.md b/docs/user/widgets/widgets.md index f47e449e..2a4d7f31 100644 --- a/docs/user/widgets/widgets.md +++ b/docs/user/widgets/widgets.md @@ -12,6 +12,7 @@ bec_figure/ spiral_progress_bar/ website/ buttons/ +text_box/ ```