Package dtk :: Package ui :: Module entry :: Class Entry

Class Entry

source code


Entry.

Instance Methods
 
__init__(self, content="", padding_x=5, padding_y=2, text_color=ui_theme.get_color("entry_text"), text_select_color=ui_theme.get_color("entry_select_text"), background_select_color=ui_theme.get_shadow_color("entry_select_background"), font_size=DEFAULT_FONT_SIZE)
Initialize Entry class.
source code
 
set_editable(self, editable)
Set entry editable status.
source code
 
is_editable(self)
Whether entry is editable.
source code
 
set_text(self, text)
Set entry text.
source code
 
get_text(self)
Get entry text.
source code
 
clear_select_status(self)
Clear entry select status.
source code
 
move_to_start(self)
Move cursor to start position of entry.
source code
 
move_to_end(self)
Move cursor to end position of entry.
source code
 
move_to_left(self)
Backward cursor one char.
source code
 
move_to_right(self)
Forward cursor one char.
source code
 
backspace(self)
Do backspace action.
source code
 
select_all(self)
Select all text of entry.
source code
 
cut_to_clipboard(self)
Cut selected text to clipboard.
source code
 
copy_to_clipboard(self)
Copy selected text to clipboard.
source code
 
paste_from_clipboard(self)
Paste text to entry from clipboard.
source code
 
press_return(self)
Do return action.
source code
 
select_to_left(self)
Select text to left char.
source code
 
select_to_right(self)
Select text to right char.
source code
 
select_to_start(self)
Select text to start position.
source code
 
select_to_end(self)
Select text to end position.
source code
 
delete(self)
Delete selected text.
source code
Class Variables
  MOVE_LEFT = 1
  MOVE_RIGHT = 2
  MOVE_NONE = 3
  __gsignals__ = {"edit-alarm":(gobject.SIGNAL_RUN_LAST, gobject...
Method Details

__init__(self, content="", padding_x=5, padding_y=2, text_color=ui_theme.get_color("entry_text"), text_select_color=ui_theme.get_color("entry_select_text"), background_select_color=ui_theme.get_shadow_color("entry_select_background"), font_size=DEFAULT_FONT_SIZE)
(Constructor)

source code 

Initialize Entry class.

Parameters:
  • content - Entry initialize content, default is "".
  • padding_x - Horizontal padding value, default is 5 pixel.
  • padding_y - Vertical padding value, default is 2 pixel.
  • text_color - Color of text in normal status.
  • text_select_color - Color of text in select status.
  • background_select_color - Color of background in select status.
  • font_size - Entry font size, default is DEFAULT_FONT_SIZE.

set_editable(self, editable)

source code 

Set entry editable status.

Parameters:
  • editable - If it is True, entry can edit, else entry not allow edit.

is_editable(self)

source code 

Whether entry is editable.

Returns:
Return True if entry editable, else return False.

set_text(self, text)

source code 

Set entry text.

Parameters:
  • text - Entry text string.

get_text(self)

source code 

Get entry text.

Returns:
Return entry text string.

Class Variable Details

__gsignals__

Value:
{"edit-alarm":(gobject.SIGNAL_RUN_LAST, gobject.TYPE_NONE, ()), "press\
-return":(gobject.SIGNAL_RUN_LAST, gobject.TYPE_NONE, ()), "changed":(\
gobject.SIGNAL_RUN_LAST, gobject.TYPE_NONE, (str,)), "invalid-value":(\
gobject.SIGNAL_RUN_LAST, gobject.TYPE_NONE, (str,)),}