~ubuntu-branches/ubuntu/wily/python-avc/wily

« back to all changes in this revision

Viewing changes to .pc/wxpython3.0.patch/examples/wx_spinctrl.py

  • Committer: Package Import Robot
  • Author(s): Olly Betts
  • Date: 2014-09-19 08:00:20 UTC
  • mfrom: (2.1.5 sid)
  • Revision ID: package-import@ubuntu.com-20140919080020-zyrk2o6ywebz6981
Tags: 0.8.3-1.1
* Non-maintainer upload with maintainer's consent.
* Update for wxPython 3.0 (Closes: #759091):
    + New patch: wxpython3.0.patch
    + Drop alternative dependency on long-obsolete python-wxgtk2.6.
      (Closes: #645890)

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#!/usr/bin/python
 
2
# .+
 
3
#
 
4
# .identifier : $Id:$
 
5
# .context    : Application View Controller
 
6
# .title      : A spin control replicated into a static text (wx)
 
7
# .kind       : python source
 
8
# .author     : Fabrizio Pollastri
 
9
# .site       : Revello - Italy
 
10
# .creation   : 24-Nov-2007
 
11
# .copyright  : (c) 2007 Fabrizio Pollastri.
 
12
# .license    : GNU General Public License (see below)
 
13
#
 
14
# This file is part of "AVC, Application View Controller".
 
15
#
 
16
# AVC is free software; you can redistribute it and/or modify
 
17
# it under the terms of the GNU General Public License as published by
 
18
# the Free Software Foundation; either version 3 of the License, or
 
19
# (at your option) any later version.
 
20
#
 
21
# AVC is distributed in the hope that it will be useful,
 
22
# but WITHOUT ANY WARRANTY; without even the implied warranty of
 
23
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
24
# GNU General Public License for more details.
 
25
#
 
26
# You should have received a copy of the GNU General Public License
 
27
# along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
28
#
 
29
# .-
 
30
 
 
31
 
 
32
import wx                               # wx tool kit bindings
 
33
from wx import xrc                      # xml resource support
 
34
 
 
35
from avc import *                       # AVC
 
36
 
 
37
WXGLADE_XML = 'wx_spinctrl.xrc'         # GUI wxGlade descriptor
 
38
 
 
39
 
 
40
class Example(wx.PySimpleApp,AVC):
 
41
  """
 
42
  A spin control whose value is replicated into a static text
 
43
  """
 
44
 
 
45
  def __init__(self):
 
46
 
 
47
    # init wx application base class
 
48
    wx.PySimpleApp.__init__(self)
 
49
 
 
50
    # create GUI
 
51
    xml_resource = xrc.XmlResource(WXGLADE_XML)
 
52
    self.root = xml_resource.LoadFrame(None,'frame_1')
 
53
    self.root.Show()
 
54
 
 
55
    # the variable holding the spin control value
 
56
    self.spin_value = 0
 
57
 
 
58
 
 
59
#### MAIN
 
60
 
 
61
example = Example()                     # instantiate the application
 
62
example.avc_init()                      # connect widgets with variables
 
63
example.MainLoop()                      # run wx event loop until quit
 
64
 
 
65
#### END