[pygtk] Entry.connect_after('changed', ...) doesn't see updated cursor position

John Finlay finlay at moeraki.com
Wed Dec 31 07:40:00 WST 2008


Yang Zhang wrote:
> Hi, I have a signal handler connected to an Entry's 'changed' signal, 
> but it never sees the updated cursor position, only the previous cursor 
> position.  E.g., if I start with an empty Entry and then type 'a', 
> Entry.get_text() returns 'a', but Entry.get_position() returns 0, not 1. 
>   I tried both .connect() and .connect_after(), but there doesn't seem 
> to be any difference.  How can I get the updated cursor position?
>   
Connect to the "notify::cursor-position" signal. This should work for 
your app.

John


More information about the pygtk mailing list