[IronPython] newbie getting started problem

Peter Howard peterhoward42 at gmail.com
Wed Aug 11 15:54:01 PDT 2010


I've eventually found what was wrong myself, but will post it here to
potentially help other newcomers:

The Python code was fine, the problem lay in the html.

Specifically the default behaviour of this:

<script src="http://gestalt.ironpython.net/dlr-latest.js"
type="text/javascript"></script>

is to make the Silverlight control just one pixel wide, and one pixel tall -
and thus you cannot see any Silverlight graphics you subsequently add.

So to fix it, you pre-initialise the control's width and height settings
before running dlr-latest.js as shown in this complete html example:

<html>
  <head>
    <script type="text/javascript">
        if (!window.DLR)
            window.DLR = {};
        DLR.settings =  {width: "100%", height: "100%" };
    </script>

    <script src="http://gestalt.ironpython.net/dlr-latest.js"
            type="text/javascript"></script>
  </head>
  <body>
    <script type="text/python" src="app.py"></script>
  </body>
</html>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.ironpython.com/pipermail/users-ironpython.com/attachments/20100811/40349e4b/attachment.htm>


More information about the Users mailing list