[Gimp-developer] meta-data browser: EntryWidget + treemodel = chicken/egg problem
Martin Nordholts
enselic at gmail.com
Mon Jul 13 03:02:29 PDT 2009
On 07/12/2009 03:12 PM, Roman Joost wrote:
> When I enter the first characters in the entry, the following happens:
>
> 1. the schema is set (row-changed signal is emitted)
> 2. the property *value* is set (another row-changed signal)
>
> That raises actually to a big problem, because when I populate two
> of my Entry widgets in the browser I get a pingpong going on between
> the Entries. Funny, but not usable.
>
When a listener makes changes to a the thing it listens to, it typically
will want to have
g_signal_handlers_block_by_func()/g_signal_handlers_unblock_by_func()
around the piece of code that does the change, and/or "if (new_value ==
current_value) return;" at the beginning of the callback to prevent the
pingpong you are describing. Sometimes it's tricky to get this right.
HTH,
Martin
More information about the Gimp-developer
mailing list