[IronPython] TypeError: expected Size, got Size

Ian Hobson ian at ianhobson.co.uk
Mon Jul 19 09:15:03 PDT 2010


On 19/07/2010 16:57, Lukas Cenovsky wrote:
>> And I need to know how to find out where I can get the correct 
>> definition of Size.
>
> Grid is UIElement and you need System.Windows.Size for 
> UIElement.Measure - not System.Drawing.Size. See 
> http://msdn.microsoft.com/en-us/library/system.windows.uielement.measure.aspx. 
>
Hi Lukas,

Thanks for the info. I went to the page and it told me

*Namespace:* System.Windows 
<http://msdn.microsoft.com/en-us/library/system.windows.aspx>
*Assembly:* PresentationCore (in PresentationCore.dll)

Therefore I ensured my code contained the two lines

clr.AddReference("PresentationCore")
from Systems.Windows import Size

This gives me
ImportError: Cannot import name Size

giving the line numebr of the import line.

Conclusion : I am missing something - and I don't know how to find it out.

Regards

Ian

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.ironpython.com/pipermail/users-ironpython.com/attachments/20100719/ec790570/attachment.htm>


More information about the Users mailing list