Re: Modifieng Text without raising a signal
- From: Owen Taylor <otaylor redhat com>
- To: Andreas Leitner <leitner eiffel com>
- Cc: gtk-list redhat com
- Subject: Re: Modifieng Text without raising a signal
- Date: 19 Aug 1999 22:29:10 -0400
Andreas Leitner <firstname.lastname@example.org> writes:
> "K. M. Hawarden-Ogata" wrote:
> > block the signal, change the text, unblock the signal
> > the above should do it, though I think you need to block each signal that
> > you connected. I don't think (I may be wrong) there is a way to block all
> > signals.
> I see, but I have to be careful not to block those signal handlers that
> actually modify the text. I only need to block those handlers that are
> added by my application. A bit tricky but I think I can get it to work.
> What would be nice after all, would be a second sort of signal for
> GtkEditable that is only emitted when the (runtime-)user modifies a
> text. S.th. like:
> signal: "user_insert_text"
> void gtk_editable_user_insert_text (...)
> The function gtk_editable_user_insert_text should be used by the widget
> itself whenever the user inserts text, and it is available to the
> application-programmer for simulating user input (in case of say s.th.
> like a playback of a Word-like macro).
> If such functionality would be present, I would only connect to the
> "user_*' hierarchy of signals and would not need to do any tricky block
Well, actually you are in luck. A lot of other people have
complained about it, but as long as you use
gtk_text_insert() instead of gtk_editable_insert_text(),
then "insert", "delete", and "changed" will only
be emitted for user chagnes.
] [Thread Prev