|
Refreshing TextViews: msg#00140gnome.gtk+.python
How can I force a TextView to refresh itself after applying tags to a TextBuffer? I have some test code that causes everything the user inserts to be made green, but it doesn't display correctly. def bufferInsert(widget, event, *args): widget.stop_emission("insert-text") widget.handler_block(sig_insert) widget.insert_with_tags(widget.get_iter_at_mark(widget.get_insert()), args[0], green) widget.handler_unblock(sig_insert) view.queue_draw() #these two lines seem like they should work, gtk.mainiteration() #but don't appear to do anything sig_insert = buffer.connect("insert-text", bufferInsert) A typed character will appear immediately, but it will not turn green until the next update/event -- for example, typing another character, clicking the mouse, or even a blink of the text cursor. I'd like it to be green immediately :) Any way to do this? Thanks, Jason P.S. I'm working toward syntax highlighting. No, I'm not actually planning to separately tag every character, but it was an easy test case. _______________________________________________ pygtk mailing list pygtk@xxxxxxxxxx http://www.daa.com.au/mailman/listinfo/pygtk Read the PyGTK FAQ: http://www.async.com.br/faq/pygtk/ |
|
| <Prev in Thread] | Current Thread | [Next in Thread> |
|---|---|---|
| Previous by Date: | Re: Two nasty problems of mine: 00140, Christian Reis |
|---|---|
| Next by Date: | Re: Refreshing TextViews: 00140, Malcolm Tredinnick |
| Previous by Thread: | GTKListi: 00140, Steven Bell |
| Next by Thread: | Re: Refreshing TextViews: 00140, Malcolm Tredinnick |
| Indexes: | [Date] [Thread] [Top] [All Lists] |
| News | FAQ | advertise |