Tkinter (26) input unit ttk.Entry

Time:2021-1-12

Creation of TTK input part and its options

w = ttk.Entry(parent, option=value, ...)
option explain
class_ Component classification name cannot be changed after creation
cursor The mouse that appears when the mouse hovers over a button
exportselection Can text be copied to clipboard 0 / 1
font Text font cannot be set in style
invalidcommand Enter the callback to call when validation errors occur
justify The relative position of the text in the input part is defined as left, right / center
show Display characters that replace input strings, such as’ * ‘for password input
style Generate the style of the part
takefocus Keyboard focus, 0 or 1 (internal)
textvariable Stringvar (), changing the variable updates the input text on the part
validate Specifies when to use callback function validation
validatecommand Verify input callback function
width The component character is defined as 20 standard characters
xscrollcommand Horizontal scroll bar scrollbar.set () method

The method of TTK input unit

  • TTK general method, and
  • tk.ENTRY How to do it

To be continued

This work adoptsCC agreementReprint must indicate the author and the link of this article


Jason Yang

Recommended Today

General method of Tkinter (21) components

method explain after(delay_ms, callback=None, *args) At least delay_ Ms after calling callback, no callback, equivalent time.sleep (); returns an ID to cancel after_ The cancel () method uses after_cancel(id) Cancel the callback of after method call after_idle(func, *args) Similar to the after method, but called when there is no event idle bell() A beep bind(sequence=None, […]