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)
14
# This file is part of "AVC, Application View Controller".
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.
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.
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/>.
32
import wx # wx tool kit bindings
33
from wx import xrc # xml resource support
35
from avc import * # AVC
37
WXGLADE_XML = 'wx_spinctrl.xrc' # GUI wxGlade descriptor
40
class Example(wx.PySimpleApp,AVC):
42
A spin control whose value is replicated into a static text
47
# init wx application base class
48
wx.PySimpleApp.__init__(self)
51
xml_resource = xrc.XmlResource(WXGLADE_XML)
52
self.root = xml_resource.LoadFrame(None,'frame_1')
55
# the variable holding the spin control value
61
example = Example() # instantiate the application
62
example.avc_init() # connect widgets with variables
63
example.MainLoop() # run wx event loop until quit