~ubuntu-branches/ubuntu/utopic/python-traitsui/utopic

« back to all changes in this revision

Viewing changes to examples/demo/Extras/windows/flash.py

  • Committer: Bazaar Package Importer
  • Author(s): Varun Hiremath
  • Date: 2011-07-09 13:57:39 UTC
  • Revision ID: james.westby@ubuntu.com-20110709135739-x5u20q86huissmn1
Tags: upstream-4.0.0
ImportĀ upstreamĀ versionĀ 4.0.0

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#  Copyright (c) 2007, Enthought, Inc.
 
2
#  License: BSD Style.
 
3
 
 
4
""" Demo showing how to use the Windows specific Flash editor.
 
5
"""
 
6
 
 
7
# Imports:
 
8
from traitsui.wx.extra.windows.flash_editor \
 
9
    import FlashEditor
 
10
 
 
11
from traits.api \
 
12
    import Enum, HasTraits
 
13
 
 
14
from traitsui.api \
 
15
    import View, HGroup, Item
 
16
 
 
17
# The demo class:
 
18
class FlashDemo ( HasTraits ):
 
19
 
 
20
    # The Flash file to display:
 
21
    flash = Enum( 'http://www.ianag.com/arcade/swf/sudoku.swf',
 
22
                  'http://www.ianag.com/arcade/swf/f-336.swf',
 
23
                  'http://www.ianag.com/arcade/swf/f-3D-Reversi-1612.swf',
 
24
                  'http://www.ianag.com/arcade/swf/game_234.swf',
 
25
                  'http://www.ianag.com/arcade/swf/flashmanwm.swf',
 
26
                  'http://www.ianag.com/arcade/swf/2379_gyroball.swf',
 
27
                  'http://www.ianag.com/arcade/swf/f-1416.swf',
 
28
                  'http://www.ianag.com/arcade/swf/mah_jongg.swf',
 
29
                  'http://www.ianag.com/arcade/swf/game_e4fe4e55fedc2f502be627ee6df716c5.swf',
 
30
                  'http://www.ianag.com/arcade/swf/rhumb.swf' )
 
31
 
 
32
    # The view to display:
 
33
    view = View(
 
34
        HGroup(
 
35
            Item( 'flash', label = 'Pick a game to play' )
 
36
        ),
 
37
        '_',
 
38
        Item( 'flash',
 
39
              show_label = False,
 
40
              editor     = FlashEditor()
 
41
        )
 
42
    )
 
43
 
 
44
# Create the demo:
 
45
demo = FlashDemo()
 
46
 
 
47
# Run the demo (if invoked from the command line):
 
48
if __name__ == '__main__':
 
49
    demo.configure_traits()
 
50