~ubuntu-branches/ubuntu/trusty/python-enable/trusty

« back to all changes in this revision

Viewing changes to examples/savage/toggle_demo.py

  • Committer: Bazaar Package Importer
  • Author(s): Varun Hiremath
  • Date: 2010-10-17 23:10:41 UTC
  • mto: (1.2.1 upstream) (8.1.1 experimental)
  • mto: This revision was merged to the branch mainline in revision 10.
  • Revision ID: james.westby@ubuntu.com-20101017231041-rziowhgl7zhxra2i
Tags: upstream-3.3.2
ImportĀ upstreamĀ versionĀ 3.3.2

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
import os
2
 
 
3
 
from enthought.traits.api import HasTraits
4
 
from enthought.traits.ui.api import View, Item
5
 
from enthought.savage.traits.ui.svg_button import SVGButton
6
 
 
7
 
from os.path import dirname, join, abspath
8
 
 
9
 
 
10
 
pause_icon = os.path.join(os.path.dirname(__file__), 'player_pause.svg')
11
 
resume_icon = os.path.join(os.path.dirname(__file__), 'player_play.svg')
12
 
 
13
 
class SVGDemo(HasTraits):
14
 
 
15
 
    pause = SVGButton('Pause', filename=pause_icon,
16
 
                      toggle_filename=resume_icon,
17
 
                      toggle_state=True,
18
 
                      toggle_label='Resume',
19
 
                      toggle_tooltip='Resume',
20
 
                      tooltip='Pause', toggle=True)
21
 
 
22
 
    trait_view = View(Item('pause'))
23
 
 
24
 
SVGDemo().configure_traits()
 
1
import os
 
2
 
 
3
from enthought.traits.api import HasTraits
 
4
from enthought.traits.ui.api import View, Item
 
5
from enthought.savage.traits.ui.svg_button import SVGButton
 
6
 
 
7
 
 
8
pause_icon = os.path.join(os.path.dirname(__file__), 'player_pause.svg')
 
9
resume_icon = os.path.join(os.path.dirname(__file__), 'player_play.svg')
 
10
 
 
11
class SVGDemo(HasTraits):
 
12
 
 
13
    pause = SVGButton('Pause', filename=pause_icon,
 
14
                      toggle_filename=resume_icon,
 
15
                      toggle_state=True,
 
16
                      toggle_label='Resume',
 
17
                      toggle_tooltip='Resume',
 
18
                      tooltip='Pause', toggle=True)
 
19
 
 
20
    trait_view = View(Item('pause'))
 
21
 
 
22
SVGDemo().configure_traits()