Get current cursor position in ScrolledText

Fredrik Juhlin laz at strakt.com
Tue Feb 5 03:46:21 EST 2002


On Mon, Feb 04, 2002 at 11:04:46PM -0800, Andrea wrote:
> On every seperate insert i need the cursor-position and the current
> length of all characters together. But if i bind an event to every
> possible key (e.g. <Key-A>) and i make a <ScrolledTextName>.get() i
> get the content of the ScrolledText before the 'A'-insertion happens.
> So the problem is if i paste a longer text i've no possibility to get
> the real length after insertion.
> Do anybody know how i can evade this problem?
You can call your event handler with after_idle(). That way all other
event handlers finish before your is executed.

//FJ




More information about the Python-list mailing list