>       Looks like a bit of both.
My guess too :)

I know I have a old rev, but I'm always hesitating to upgrade. Often
things works just fine, but other times I must spend some time finding
bugs etc. And bugs doesn't appear until I upgrade the programs (only
done when needed), so knowing what breaks isn't always as easy.

I'll try an update and see if some fixes shows up when the svn is online
again.

Dabo is evolving faster than I can keep up!


-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
On Behalf Of Ed Leafe
Sent: 7. januar 2008 14:16
To: Dabo Users list
Subject: Re: [dabo-users] Error binding textboxes toundefined
preferencemanager keys

On Jan 7, 2008, at 5:38 AM, Simen Haugen wrote:

> I don't know if this is a bug or just the wrong use, but...

        Looks like a bit of both.

> dCheckBox(self, DataSource=self.PreferenceManager, DataField="check")
>
> This creates the field "check" if it doesn't exist and stores the
> checkbox as a bool value. All good...
>
> dTextBox(self, DataSource=self.PreferenceManager, DataField="field")
>
> I would have guessed that this would create the key "field" with a  
> blank
> string value, but it doesn't. It creates a dPref key with this  
> name, and
> gives the textbox this instead of the value.
>
> BAD TYPE <class 'dabo.dPref.dPref'>

        The difference is the type coercion that goes on behind the
scenes  
of data controls. Checkboxes can only display bools, but every value  
can be coerced to a bool; however, textboxes can only display  
strings, but we don't have the logic to convert *every* type to and  
from a string. In the case of preferences, creating an empty key  
simply creates another chained instance of dPref; it isn't until a  
value is assigned to that key that it stores a particular value.

> Platform: Win
> Python Version: 2.4.4 on win32
> Dabo Version: Version 0.8.2; Revision ~3767
> UI Version: 2.8.6.1 on wxMSW

        I don't know if the recent changes to dTextBox may have fixed  
things, but when I run your code I don't get the error you report.  
We're up to rev. 3849 on Web Update, so if you uopgraded to at least  
that version (or the current svn), try the code again and see if it  
works now.

-- Ed Leafe
-- http://leafe.com
-- http://dabodev.com




[excessive quoting removed by server]

_______________________________________________
Post Messages to: [email protected]
Subscription Maintenance: http://leafe.com/mailman/listinfo/dabo-users
Searchable Archives: http://leafe.com/archives/search/dabo-users
This message: http://leafe.com/archives/byMID/dabo-users/[EMAIL PROTECTED]

Reply via email to