Home > Mobile >  What is the difference between INSERT and CURRENT?
What is the difference between INSERT and CURRENT?

Time:03-19

Quick question, What is the difference between INSERT and CURRENT? I am using Tkinter text area to display text. My question deals with the insert function, there are 4 options that I am aware of: INSERT, CURRENT, END and raw values.

  1. When I use the INSERT parameter, sometimes the input text would be placed in between existing text rather at the end .

  2. If I use the CURRENT parameter, sometimes the input text will appear at the beginning of the text field.

  3. When I use the END parameter (self explanatory), the input text appears at the end how I prefer it

CodePudding user response:

In short, insert represents the insertion cursor (where text will be inserted via the keyboard), and current represents the character closest to the mouse.

From the official tcl/tk documentation, upon which tkinter is built:

Two marks have special significance. First, the mark insert is associated with the insertion cursor .... Second, the mark current is associated with the character closest to the mouse and is adjusted automatically to track the mouse position and any changes to the text in the widget (one exception: current is not updated in response to mouse motions if a mouse button is down; the update will be deferred until all mouse buttons have been released).

  • Related