Re: "apply-tag" callback calls gtk_text_buffer_apply_tag() which triggers new "apply-tag" signal and so on...



Am Donnerstag, den 26.04.2007, 22:50 +0100 schrieb Adam Tertial:
Hi

I have some code which needs to call
gtk_text_buffer_apply_tag() when it receives a
"apply-tag" signal. Calling
gtk_text_buffer_apply_tag() in turn generates a new
"apply-tag" signal and the program loops forever.

I'm pretty new to GTK so I may be missing something
obvious. Can anyone think of a workaround?

Thanks

Use g_signal_handler_block and g_signal_handler_unblock calls around
gtk_text_buffer_apply_tag.  There's also
g_signal_handlers_[un]block_by_func, which are useful if you don't keep
the signal handler id around or connect a handler multiple times.

-- 
Regards,
  Renà Stadler




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]