File: flash.py

package info (click to toggle)
python-traitsui 6.1.3-3
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 11,252 kB
  • sloc: python: 44,765; makefile: 117
file content (53 lines) | stat: -rw-r--r-- 1,438 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
#  Copyright (c) 2007, Enthought, Inc.
#  License: BSD Style.

""" Demo showing how to use the Windows specific Flash editor.
"""

# Imports:
from __future__ import absolute_import
from traitsui.wx.extra.windows.flash_editor \
    import FlashEditor

from traits.api \
    import Enum, HasTraits

from traitsui.api \
    import View, HGroup, Item

# The demo class:


class FlashDemo(HasTraits):

    # The Flash file to display:
    flash = Enum(
        'http://www.ianag.com/arcade/swf/sudoku.swf',
        'http://www.ianag.com/arcade/swf/f-336.swf',
        'http://www.ianag.com/arcade/swf/f-3D-Reversi-1612.swf',
        'http://www.ianag.com/arcade/swf/game_234.swf',
        'http://www.ianag.com/arcade/swf/flashmanwm.swf',
        'http://www.ianag.com/arcade/swf/2379_gyroball.swf',
        'http://www.ianag.com/arcade/swf/f-1416.swf',
        'http://www.ianag.com/arcade/swf/mah_jongg.swf',
        'http://www.ianag.com/arcade/swf/game_e4fe4e55fedc2f502be627ee6df716c5.swf',
        'http://www.ianag.com/arcade/swf/rhumb.swf')

    # The view to display:
    view = View(
        HGroup(
            Item('flash', label='Pick a game to play')
        ),
        '_',
        Item('flash',
             show_label=False,
             editor=FlashEditor()
             )
    )

# Create the demo:
demo = FlashDemo()

# Run the demo (if invoked from the command line):
if __name__ == '__main__':
    demo.configure_traits()