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
|
# (C) Copyright 2004-2023 Enthought, Inc., Austin, TX
# All rights reserved.
#
# This software is provided without warranty under the terms of the BSD
# license included in LICENSE.txt and may be redistributed only under
# the conditions described in the aforementioned license. The license
# is also available online at http://www.enthought.com/licenses/BSD.txt
#
# Thanks for using Enthought open source!
""" Demo showing how to use the Windows specific Flash editor.
"""
# Imports:
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()
|