tkintertools.toolbox.tools¶
字数 325 个 代码 51 行 阅读时间 2 分钟 访问量
Some useful utility classes or utility functions
🟢_Trigger
¶
class
protected
| object
Single trigger
It can only be triggered once before the reset, and multiple triggers are invalid. When triggered, the callback function is called.
command
: the function that is called when triggered
🟡get
¶
method
public
🟡lock
¶
method
public
🟡reset
¶
method
public
🟡unlock
¶
method
public
🟡update
¶
method
public
Update the status of the trigger
value
: updated value
🔵embed_window
¶
function
public
Embed a widget into another widget
window
: Widget that will be embedded inparent
: parent widget,None
indicates that the parent widget is the screenfocus
: whether direct input focus to this window
🔵get_hwnd
¶
function
public
tkinter.Widget
🔵get_text_size
¶
function
public
Get the size of a text with a special font family and font size
text
: the textfontsize
: font size of the textfamily
: font family of the textpadding
: extra padding of the size
ATTENTION:
- This function only works when the fontsize is negative number!
- When there is a line break, the return value will be inaccurate!
🔵load_font
¶
function
public
Make fonts located in file font_path
available to the font system, and return True
if the operation succeeds, False
otherwise
font_path
: the font file pathprivate
: if True, other processes cannot see this font(Only Windows OS), and this font will be unloaded when the process diesenumerable
: if True, this font will appear when enumerating fonts(Only Windows OS)
ATTENTION:
- This function is referenced from
customtkinter.FontManager.load_font
, CustomTkinter: TomSchimansky/CustomTkinter - This function only works on Windows and Linux OS
🔵screen_size
¶
function
public
🔵set_mouse_position
¶
function
public
Set mouse cursor position
ATTENTION:
This function only works on Windows OS!
🟣_LINUX_FONTS_DIR
¶
constant
protected