[pygtk] Replacing text with paste

2009-01-05 Thread Walter Leibbrandt
Hi, I manage my own undo buffer of changes made to a gtk.TextView. This necessarily means that the undo controller is connected to the relevant TextBuffer's "delete-range" and "insert-text" signals. Changes made during these signals are stored on the undo stack. Then I ran into some weird beha

Re: [pygtk] How to retrieve all the content in the TextBuffer?

2009-01-05 Thread Frédéric
On lundi 05 janvier 2009, Miguel Ángel García wrote: > tb = gtk.TextBuffer() > tb.get_text(*tb.get_bounds()) > > with "get_bounds" you will get a vector of size 2. The '*' asterisk > transforms the vector into the parameters of 'get_text', so you are > saying: "give me the text from first characte

Re: [pygtk] How to retrieve all the content in the TextBuffer?

2009-01-05 Thread Miguel Ángel García
Hello tb = gtk.TextBuffer() tb.get_text(*tb.get_bounds()) with "get_bounds" you will get a vector of size 2. The '*' asterisk transforms the vector into the parameters of 'get_text', so you are saying: "give me the text from first character till last one". See you! El Sat, 03 Jan 2009 10:31:26

Re: [pygtk] Getting Widget geometry

2009-01-05 Thread Walter Leibbrandt
Hi, Yang Zhang wrote: > Hi, I'm trying to create a pop-up window positioned immediately below an > Entry. How do I figure out the coordinates to pass into > Window.move(x,y)? I couldn't find how to extract this information from > an Entry. Thanks in advance for any hints. > The best way I f

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

2009-01-05 Thread Walter Leibbrandt
Hi everybody, I hope everyone had a very festive season and that 2009 will be a great year for everyone! :) Yang Zhang wrote: > Well, another problem is that I don't want this to just fire when text > is being inserted. I'm building an auto-completion widget, so if > someone deletes text or i