Re: [Gimp-developer] meta-data browser: EntryWidget + treemodel = chicken/egg problem

2009-07-14 Thread Roman Joost
Hi Martin,

On Mon, Jul 13, 2009 at 12:02:29PM +0200, Martin Nordholts wrote:
> 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.
Thanks for this hint. I haven't tried it so far, but I looks like I need
it if one of my handlers already dealt with the signal successfully.

It's actually interesting, that I tried various different ideas on
implementing this. When I think I already tried everything, there is
another idea popping up which I try. So there is progress :)

Cheers,
-- 
Roman Joost
www: http://www.romanofski.de
email: romanof...@gimp.org


signature.asc
Description: Digital signature
___
Gimp-developer mailing list
Gimp-developer@lists.XCF.Berkeley.EDU
https://lists.XCF.Berkeley.EDU/mailman/listinfo/gimp-developer


Re: [Gimp-developer] meta-data browser: EntryWidget + treemodel = chicken/egg problem

2009-07-13 Thread Martin Nordholts
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

___
Gimp-developer mailing list
Gimp-developer@lists.XCF.Berkeley.EDU
https://lists.XCF.Berkeley.EDU/mailman/listinfo/gimp-developer