[pygtk] TextView: signal when cursor changes position
Hi, I need to know when the cursor inside a TextView changes position. I tried to link to move_cursor signal, but if I move the cursor with a mouse-click, the signal doesn't get emitted. Is there a proper signal to link or must I catch both move_cursor and button_released? Thanks. -- Alessandro Pellizzari ___ pygtk mailing list pygtk@daa.com.au http://www.daa.com.au/mailman/listinfo/pygtk Read the PyGTK FAQ: http://www.async.com.br/faq/pygtk/
Re: [pygtk] TextView: signal when cursor changes position
Alessandro Pellizzari: Hi, I need to know when the cursor inside a TextView changes position. I tried to link to move_cursor signal, but if I move the cursor with a mouse-click, the signal doesn't get emitted. Is there a proper signal to link or must I catch both move_cursor and button_released? I'm using cursor-changed, which seems to get emitted on all changes. Works great for me. -- Hans-Joachim Widmaier ___ pygtk mailing list pygtk@daa.com.au http://www.daa.com.au/mailman/listinfo/pygtk Read the PyGTK FAQ: http://www.async.com.br/faq/pygtk/
Re: [pygtk] TextView: signal when cursor changes position
Hans-Joachim Widmaier: I'm using cursor-changed, which seems to get emitted on all changes. Works great for me. Gah! Have to follow up on my own post. (Never post when in a hurry!) Sorry, I misread TextView for TreeView. There's probably no cursor-changed signal on the former. -- Hans-Joachim Widmaier ___ pygtk mailing list pygtk@daa.com.au http://www.daa.com.au/mailman/listinfo/pygtk Read the PyGTK FAQ: http://www.async.com.br/faq/pygtk/
Re: [pygtk] TextView: signal when cursor changes position
Brian: On Fri, 2005-25-03 at 17:40 +0100, Hans-Joachim Widmaier wrote: Hans-Joachim Widmaier: I'm using cursor-changed, which seems to get emitted on all changes. Works great for me. Gah! Have to follow up on my own post. (Never post when in a hurry!) Sorry, I misread TextView for TreeView. There's probably no cursor-changed signal on the former. It is cursor_changed for list and tree views Sorry, I can't see your point. There isn't a gtk.List nor a gtk.ListView, and the signal is shown with a hyphen in the pygtk 2 reference. And it definately works in that spelling in my code. Again, the OP was talking about a TextView, which I, being in a hurry (and having had lots of fun lately with TreeViews), read as TreeView, triggering me to a recommendation that didn't apply here. So many words for nothing ... :-) No offence meant, really, -- Hans-Joachim Widmaier ___ pygtk mailing list pygtk@daa.com.au http://www.daa.com.au/mailman/listinfo/pygtk Read the PyGTK FAQ: http://www.async.com.br/faq/pygtk/
Re: [pygtk] TextView: signal when cursor changes position
Alessandro Pellizzari wrote: Hi, I need to know when the cursor inside a TextView changes position. I tried to link to move_cursor signal, but if I move the cursor with a mouse-click, the signal doesn't get emitted. Is there a proper signal to link or must I catch both move_cursor and button_released? I have been using the mark-set signal on the TextBuffer associated with the TextView for this. I am getting more two signals everytime the cursor moves so I save the offset from the iter argument and check to see if it has changed from the last time before I start doing any expensive processing. suggestions of improvements to this approach are welcome. ___ pygtk mailing list pygtk@daa.com.au http://www.daa.com.au/mailman/listinfo/pygtk Read the PyGTK FAQ: http://www.async.com.br/faq/pygtk/
Re: [pygtk] TextView: signal when cursor changes position
On Fri, 2005-25-03 at 21:54 +0100, Hans-Joachim Widmaier wrote: Brian: On Fri, 2005-25-03 at 17:40 +0100, Hans-Joachim Widmaier wrote: Hans-Joachim Widmaier: I'm using cursor-changed, which seems to get emitted on all changes. Works great for me. Gah! Have to follow up on my own post. (Never post when in a hurry!) Sorry, I misread TextView for TreeView. There's probably no cursor-changed signal on the former. It is cursor_changed for list and tree views Sorry, I can't see your point. There isn't a gtk.List nor a gtk.ListView, and the signal is shown with a hyphen in the pygtk 2 reference. And it definately works in that spelling in my code. No offence meant, really, None taken. :) I know, the list stuff was deprecated I believe. I just checked, the spelling cursor_changed has been working in our code for a year now. I wasn't the one to code that one, but I just double checked, and it works both spellings. I just checked glade and it shows the signal with the underscore, while in Idle's shell a help(gtk.TreeView) shows it with a hyphen. -- Brian [EMAIL PROTECTED] ___ pygtk mailing list pygtk@daa.com.au http://www.daa.com.au/mailman/listinfo/pygtk Read the PyGTK FAQ: http://www.async.com.br/faq/pygtk/