patch: fixing AutoCombo bug

Christian Robottom Reis kiko at async.com.br
Mon Jan 12 20:22:18 BRDT 2004


On Fri, Jan 09, 2004 at 05:15:07PM -0200, Luis Ricardo Boni wrote:
> AutoCombo was crashing when trying to convert an object to text if
> initialized by a proxy and the attribute already contains data. The
> update can not be done in __initialize because the strings list is
> known only after the prefill.

I'm not sure this is the right place to do this check (it seems quite
ugly to do it in the main Proxy class, and I only do this sort of hack
in setup_widgets because I was too lazy to design that properly).

I'm also confused why OptionMenu works fine in this case but AutoCombo
doesn't -- both have the same sort of problem, I imagine (since prefill
is only done after instantiation).

> Index: Kiwi/Proxies.py
> ===================================================================
> RCS file: /usr/local/cvssrc/Kiwi/Kiwi/Proxies.py,v
> retrieving revision 1.82
> diff -u -p -r1.82 Proxies.py
> --- Kiwi/Proxies.py	5 Dec 2003 01:30:46 -0000	1.82
> +++ Kiwi/Proxies.py	9 Jan 2004 18:49:54 -0000
> @@ -145,7 +145,8 @@ mind.
>  
>              update = getattr(self, "tweak_%s" % name, None) or \
>                       self.update
> -            update(name, value)
> +            if not isinstance(proxy, Entry.KiwiComboProxy):
> +                update(name, value)
>  


Take care,
--
Christian Robottom Reis | http://async.com.br/~kiko/ | [+55 16] 261 2331


More information about the Kiwi mailing list