Module blingbling.value_text_box
A text box that can display value and text with colors.
Functions
set_background_color (color) | Fill all the widget with this color (default is transparent). |
set_text_background_color (color) | Fill the text area (text height/width + padding) background with this color (default is none). |
set_text_background_border (color) | Set a border on the text area background (default is none ). |
set_v_margin (margin) | Define the top and bottom margin for the text background. |
set_h_margin (margin) | Define the left and right margin for the text background. |
set_h_margin (padding) | Define the padding between the text and it's background. |
set_rounded_size (rounded_size) | Set rounded corners for background and text background. |
set_text_color (color) | Define the color for all the text of the widget (white by default). |
set_values_text_color (table) | Define the value text color depending on the limit given ( if value >= limit, we apply the color). |
set_font_size (size) | Define the text font size. |
set_label (text) | Define the template of the text to display. |
value_text_box:set_height (height) | Set the vt_box height. |
value_text_box:set_width (width) | Set the vt_box width. |
new (args) | Create a vt_box widget. |
Functions
- set_background_color (color)
-
Fill all the widget with this color (default is transparent).
Parameters:
- color a string "#rrggbbaa" or "#rrggbb"
Usage:
myvt_box:set_background_color(string) -->"#rrggbbaa"
- set_text_background_color (color)
-
Fill the text area (text height/width + padding) background with this color (default is none).
Parameters:
- color a string "#rrggbbaa" or "#rrggbb"
Usage:
myvt_box:set_text_background_color(string) -->"#rrggbbaa"
- set_text_background_border (color)
-
Set a border on the text area background (default is none ).
Parameters:
- color a string "#rrggbbaa" or "#rrggbb"
Usage:
myvt_box:set_text_background_border(string) -->"#rrggbbaa"
- set_v_margin (margin)
-
Define the top and bottom margin for the text background.
Parameters:
- margin an integer for top and bottom margin
Usage:
myvt_box:set_v_margin(integer)
- set_h_margin (margin)
-
Define the left and right margin for the text background.
Parameters:
- margin an integer for left and right margin
Usage:
myvt_box:set_h_margin(integer)
- set_h_margin (padding)
-
Define the padding between the text and it's background.
Parameters:
- padding an integer for the text padding
Usage:
myvt_box:set_padding(integer)
- set_rounded_size (rounded_size)
-
Set rounded corners for background and text background.
Parameters:
- rounded_size float in [0,1]
Usage:
myvt_box:set_rounded_size(a) -> a in [0,1]
- set_text_color (color)
-
Define the color for all the text of the widget (white by default).
Parameters:
- color a string "#rrggbbaa" or "#rrggbb
Usage:
myvt_box:set_text_color(string) -->"#rrggbbaa"
- set_values_text_color (table)
-
Define the value text color depending on the limit given ( if value >= limit, we apply the color).
Parameters:
- table table like { {"#rrggbbaa", limit 1}, {"#rrggbbaa", limit 2}}
Usage:
myvt_box:set_values_text_color(table) -->{ {"#rrggbbaa", limit 1}, {"#rrggbbaa", limit 2}} By default the color is text_color(another example: {{"#88aa00ff",0},{"#d4aa00ff", 0.5},{"#d45500ff",0.75}})
- set_font_size (size)
-
Define the text font size.
Parameters:
- size the font size
Usage:
myvt_box:set_font_size(integer)
- set_label (text)
-
Define the template of the text to display.
Parameters:
- text the text to display
Usage:
myvt_box:set_label(string) By default the text is : (value_send_to_the_widget *100) static string: example set_label("CPU usage:") will display "CUP usage:" on the vt_box dynamic string: use $percent in the string example set_label("Load $percent %") will display "Load 10%"
- value_text_box:set_height (height)
-
Set the vt_box height.
Parameters:
- height The height to set.
- value_text_box:set_width (width)
-
Set the vt_box width.
Parameters:
- width The width to set.
- new (args)
-
Create a vt_box widget.
Parameters:
- args Standard widget() arguments. You can add width and height keys to set vt_box geometry.
Returns:
-
A vt_box widget.