On Wed, Aug 20, 2003 at 07:26:03PM -0500, Jason Stitt wrote:
> I just noticed that, in the python version, calling queue_draw() and 
> mainiteration() at the end of the signal callback causes characters inserted 
> at the end of the buffer to be immediately green if there is more than one 
> line.  Funky, eh?

It indeed sounds odd. You might consider trying to run a loop:

    while gtk.events_pending():
        gtk.mainiteration()

> The program is fairly short, so I'm including the python source here.  I have 
> updated it to use Christian Reis' suggestion of connect_after(), but the 
> result is exactly the same as before.

Okay, last suggestion of the day is connecting to the "changed" signal,
which at least used to be run late enough. I'm not sure this should
change anything, but it's worth a go.

> # Apply the green tag to inserted text
> def bufferInsert(widget, event, *args):
>     end = widget.get_iter_at_mark(widget.get_insert())
>     start = end.copy()
>     start.backward_chars(args[1])
>     widget.apply_tag(green, start, end)
>     view.queue_draw()
>     gtk.mainiteration()

Could it be that your end and start positions are getting set
wrong, for some reason?

Take care,
--
Christian Reis, Senior Engineer, Async Open Source, Brazil.
http://async.com.br/~kiko/ | [+55 16] 261 2331 | NMFL
_______________________________________________
pygtk mailing list   [EMAIL PROTECTED]
http://www.daa.com.au/mailman/listinfo/pygtk
Read the PyGTK FAQ: http://www.async.com.br/faq/pygtk/

Reply via email to