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
_______________________________________________
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]