Package dtk :: Package ui :: Module entry :: Class ShortcutKeyEntry

Class ShortcutKeyEntry

source code


Shortcut key entry.

Instance Methods
 
__init__(self, content="", action_button=None, background_color=ui_theme.get_alpha_color("text_entry_background"), acme_color=ui_theme.get_alpha_color("text_entry_acme"), point_color=ui_theme.get_alpha_color("text_entry_point"), frame_point_color=ui_theme.get_alpha_color("text_entry_frame_point"), frame_color=ui_theme.get_alpha_color("text_entry_frame"))
Initialize ShortcutKeyEntry class.
source code
 
handle_button_press(self, widget, event)
Internal callback for `action-active` signal.
source code
 
set_shortcut_key(self, shortcut_key)
Set shortcut key.
source code
 
get_shortcut_key(self)
Get shortcut key.
source code
 
set_size(self, width, height)
Set shortcutkey entry size with given value.
source code
 
set_editable(self, editable)
Set editable status of shortcutkey entry.
source code
 
set_text(self, text)
Set text of shortcutkey entry.
source code
 
get_text(self)
Get text of shortcutkey entry.
source code
 
focus_input(self)
Focus input cursor.
source code
Class Variables
  __gsignals__ = {"action-active":(gobject.SIGNAL_RUN_LAST, gobj...
Method Details

__init__(self, content="", action_button=None, background_color=ui_theme.get_alpha_color("text_entry_background"), acme_color=ui_theme.get_alpha_color("text_entry_acme"), point_color=ui_theme.get_alpha_color("text_entry_point"), frame_point_color=ui_theme.get_alpha_color("text_entry_frame_point"), frame_color=ui_theme.get_alpha_color("text_entry_frame"))
(Constructor)

source code 

Initialize ShortcutKeyEntry class.

Parameters:
  • content - Initialize entry text, default is "".
  • action_button - Extra button add at right side of shortcutkey entry, default is None.
  • background_color - Color of shortcutkey entry background.
  • acme_color - Acme point color of shortcutkey entry.
  • point_color - Pointer color of shortcutkey entry.
  • frame_point_color - Frame pointer color of shortcutkey entry.
  • frame_color - Frame color of shortcutkey entry.

set_shortcut_key(self, shortcut_key)

source code 

Set shortcut key.

Parameters:
  • shortcut_key - Key string that return by function `dtk.ui.keymap.get_keyevent_name`.

get_shortcut_key(self)

source code 

Get shortcut key.

Returns:
Return shortcut key string, string format look function `dtk.ui.keymap.get_keyevent_name`.

set_size(self, width, height)

source code 

Set shortcutkey entry size with given value.

Parameters:
  • width - New width of shortcutkey entry.
  • height - New height of shortcutkey entry.

set_editable(self, editable)

source code 

Set editable status of shortcutkey entry.

Parameters:
  • editable - shortcutkey entry can editable if option is True, else can't edit.

set_text(self, text)

source code 

Set text of shortcutkey entry.

Parameters:
  • text - shortcutkey entry string.

get_text(self)

source code 

Get text of shortcutkey entry.

Returns:
Return text of shortcutkey entry.

Class Variable Details

__gsignals__

Value:
{"action-active":(gobject.SIGNAL_RUN_LAST, gobject.TYPE_NONE, (str,)),\
 "wait-key-input":(gobject.SIGNAL_RUN_LAST, gobject.TYPE_NONE, (str,))\
, "shortcut-key-change":(gobject.SIGNAL_RUN_LAST, gobject.TYPE_NONE, (\
str,)),}