info_box
sleap_nn.config_generator.tui.widgets.info_box
¶
Info box widget variants.
Provides styled information boxes for displaying hints, warnings, and errors.
Classes:
| Name | Description |
|---|---|
ErrorBox |
Convenience class for error-styled info box. |
GuideBox |
Multi-section guide box for parameter explanations. |
InfoBox |
Styled information box widget. |
InfoBoxType |
Types of info boxes with different styling. |
SuccessBox |
Convenience class for success-styled info box. |
TipBox |
Convenience class for tip-styled info box. |
WarningBox |
Convenience class for warning-styled info box. |
ErrorBox
¶
Bases: InfoBox
Convenience class for error-styled info box.
Methods:
| Name | Description |
|---|---|
__init__ |
Initialize an error-styled info box. |
Source code in sleap_nn/config_generator/tui/widgets/info_box.py
__init__(message, title='Error', id=None, classes=None)
¶
Initialize an error-styled info box.
Source code in sleap_nn/config_generator/tui/widgets/info_box.py
GuideBox
¶
Bases: Static
Multi-section guide box for parameter explanations.
Displays structured guidance with multiple sections for explaining configuration parameters.
Methods:
| Name | Description |
|---|---|
__init__ |
Initialize the guide box. |
add_section |
Add a section to the guide. |
render |
Render the guide box content. |
update_sections |
Replace all sections. |
Source code in sleap_nn/config_generator/tui/widgets/info_box.py
__init__(title='Guide', sections=None, id=None, classes=None)
¶
Initialize the guide box.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
title
|
str
|
Main title. |
'Guide'
|
sections
|
Optional[dict]
|
Dict mapping section titles to content. |
None
|
id
|
Optional[str]
|
Widget ID. |
None
|
classes
|
Optional[str]
|
CSS classes. |
None
|
Source code in sleap_nn/config_generator/tui/widgets/info_box.py
add_section(title, content)
¶
Add a section to the guide.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
title
|
str
|
Section title. |
required |
content
|
str
|
Section content. |
required |
render()
¶
Render the guide box content.
Source code in sleap_nn/config_generator/tui/widgets/info_box.py
update_sections(sections)
¶
Replace all sections.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
sections
|
dict
|
Dict mapping section titles to content. |
required |
InfoBox
¶
Bases: Static
Styled information box widget.
Displays informational content with visual styling to indicate the type of information (info, warning, success, error, tip).
Attributes:
| Name | Type | Description |
|---|---|---|
box_type |
The type of info box (affects styling). |
|
title |
Optional title text. |
|
message |
str
|
Main content text. |
Methods:
| Name | Description |
|---|---|
__init__ |
Initialize the info box. |
render |
Render the info box content. |
update_message |
Update the message content. |
update_type |
Update the box type. |
Source code in sleap_nn/config_generator/tui/widgets/info_box.py
22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 | |
message
property
writable
¶
Get the message content.
__init__(message, box_type=InfoBoxType.INFO, title=None, id=None, classes=None)
¶
Initialize the info box.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
message
|
str
|
Content text. |
required |
box_type
|
InfoBoxType
|
Type of info box. |
INFO
|
title
|
Optional[str]
|
Optional title. |
None
|
id
|
Optional[str]
|
Widget ID. |
None
|
classes
|
Optional[str]
|
CSS classes. |
None
|
Source code in sleap_nn/config_generator/tui/widgets/info_box.py
render()
¶
Render the info box content.
Source code in sleap_nn/config_generator/tui/widgets/info_box.py
update_message(message)
¶
Update the message content.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
message
|
str
|
New message text. |
required |
update_type(box_type)
¶
Update the box type.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
box_type
|
InfoBoxType
|
New box type. |
required |
Source code in sleap_nn/config_generator/tui/widgets/info_box.py
InfoBoxType
¶
Bases: str, Enum
Types of info boxes with different styling.
Source code in sleap_nn/config_generator/tui/widgets/info_box.py
SuccessBox
¶
Bases: InfoBox
Convenience class for success-styled info box.
Methods:
| Name | Description |
|---|---|
__init__ |
Initialize a success-styled info box. |
Source code in sleap_nn/config_generator/tui/widgets/info_box.py
__init__(message, title='Success', id=None, classes=None)
¶
Initialize a success-styled info box.
Source code in sleap_nn/config_generator/tui/widgets/info_box.py
TipBox
¶
Bases: InfoBox
Convenience class for tip-styled info box.
Methods:
| Name | Description |
|---|---|
__init__ |
Initialize a tip-styled info box. |
Source code in sleap_nn/config_generator/tui/widgets/info_box.py
__init__(message, title='Tip', id=None, classes=None)
¶
Initialize a tip-styled info box.
Source code in sleap_nn/config_generator/tui/widgets/info_box.py
WarningBox
¶
Bases: InfoBox
Convenience class for warning-styled info box.
Methods:
| Name | Description |
|---|---|
__init__ |
Initialize a warning-styled info box. |
Source code in sleap_nn/config_generator/tui/widgets/info_box.py
__init__(message, title='Warning', id=None, classes=None)
¶
Initialize a warning-styled info box.