window.rml 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. <template name="window" content="content">
  2. <head>
  3. <link type="text/rcss" href="rkt.rcss"/>
  4. <link type="text/rcss" href="window.rcss"/>
  5. <script>
  6. import _rocketcore as rocket
  7. def OnLoad(document):
  8. print "Rocket document loaded"
  9. # event handlers from templates can be overridden in windows using them
  10. def OnKeyDown(event, document):
  11. keyId = event.parameters['key_identifier']
  12. print "Base keydown: unhandled key ",keyId
  13. </script>
  14. </head>
  15. <body class="window" onload='OnLoad(document)' onkeydown='OnKeyDown(event, document)'>
  16. <div id="title_bar">
  17. <handle move_target="#document">
  18. <span id="title">Rocket Sample</span>
  19. <div id="title_bar_content">
  20. </div>
  21. </handle>
  22. </div>
  23. <div id="window">
  24. <div id="content">
  25. </div>
  26. </div>
  27. <!-- drag and drop of window -->
  28. <handle size_target="#document"
  29. style="position: absolute; width: 16px; height: 16px; bottom: 0px; right: 0px;">
  30. </handle>
  31. </body>
  32. </template>