From bc709c4184c985d4e721f9ea7d1b3dad5e9153a7 Mon Sep 17 00:00:00 2001 From: appel_c Date: Thu, 13 Jun 2024 08:08:20 +0200 Subject: [PATCH] docs: add documentation --- docs/user/widgets/text_box.md | 33 +++++++++++++++++++++++++++++++++ docs/user/widgets/widgets.md | 1 + 2 files changed, 34 insertions(+) create mode 100644 docs/user/widgets/text_box.md 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("

Welcome to BEC Widgets

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/ ```