Davy Mitchell wrote:
> import clr
> clr.AddReference('System.Windows.Forms')
> from System.Windows.Forms import DialogResult
> if DialogResult.OK:
> print "Boo!"
>
> The above prints Boo! in 1.1 and early 2.0 Alphas i.e. DialogResult.OK
> resolves to TRUE.
>
> A6 and A7 (didn't try any others!) nothing is printed i.e.
> DialogResult.OK resolves to FALSE.
>
> Now, I am changing my dialog code anyway but is this a deliberate change?
>
>
Hmm.. (IP2.0 A7)
>>> import clr
>>> clr.AddReference('System.Windows.Forms')
>>> from System.Windows.Forms import DialogResult
>>> bool(DialogResult.OK)
False
>>> DialogResult.OK.value__
1
Odd.
Of course the right thing to be doing is:
if result == DialogResult.OK:
but it is still odd that this enumeration now evaluates to False.
Michael
http://www.manning.com/foord
> Cheers,
> Davy
>
>
_______________________________________________
Users mailing list
[email protected]
http://lists.ironpython.com/listinfo.cgi/users-ironpython.com