On Fri, Aug 01, 2003 at 01:10:13PM +0200, Riccardo Galli wrote:
> def on_insert_text(self,buffer,textIter,char,*args):
> buffer.disconnect(self.signal_id)
> if textIter.get_chars_in_line()==6 :
> newIter=buffer.get_iter_at_offset(2)
> buffer.insert(newIter,'X')
> buffer.place_cursor(buffer.get_end_iter())
> self.signal_id=buffer.connect('insert-text',self.on_insert_text)
>
> I understand from the warning that I should use marks, but I don't know how.
Not sure about your specific problem, but there's also something I don't
like here, which is disconnecting and connecting in a signal callback.
I'm surprised it even works, actually; if you want to avoid the signal
being emitted, you can use the venerable emit_stop_by_name() method (or
whatever pygtk2 offers with compatible semantics if it's not there).
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/