Package dtk :: Package ui :: Module label :: Class Label

Class Label

source code


Label.

Instance Methods
 
__init__(self, text, text_color=None, text_size=DEFAULT_FONT_SIZE, text_x_align=ALIGN_START, label_width=None, enable_gaussian=False, enable_select=True, enable_double_click=True, gaussian_radious=2, border_radious=1, wrap_width=None)
Initialize Label class.
source code
 
copy_to_clipboard(self)
Copy select text to clipboard.
source code
 
select_all(self)
Select all.
source code
 
get_text(self)
Get text of label.
source code
 
set_text(self, text)
Set text with given value.
source code
Method Details

__init__(self, text, text_color=None, text_size=DEFAULT_FONT_SIZE, text_x_align=ALIGN_START, label_width=None, enable_gaussian=False, enable_select=True, enable_double_click=True, gaussian_radious=2, border_radious=1, wrap_width=None)
(Constructor)

source code 

Initialize Label class.

Parameters:
  • text - Label text.
  • text_color - Label text color, default is None.
  • text_size - Label text size, default is DEFAULT_FONT_SIZE.
  • text_x_align - Horizontal align option, default is ALIGN_START.
  • label_width - Label maximum width, default is None.
  • enable_gaussian - Default is False, if it is True, color option no effect, default gaussian effect is white text and black shadow.
  • enable_select - Default is True, label content can't select if it is False.
  • gaussian_radious - Radious of gaussian.
  • border_radious - Radious of border.
  • wrap_width - Wrap width.

set_text(self, text)

source code 

Set text with given value.

Parameters:
  • text - Label string.