Logo
AVC, Application View Controller

OUTLINE

Current: 0.8.3

Released: 15-Feb-2011

License: GPL

Common Requirements:
python 2.2 - <3.0

GTK+ requirements:
Pygtk 2.8 - 2.10
Qt requirements:
Pyqt v3 - v4
Tk requirements:
Tkinter 2.4
wxWidgets requirements:
wxPython 2.6 - 2.8
Swing requirements:
jython 2.5.1

Author: Fabrizio Pollastri

DOCUMENTATION

Quick start examples:
GTK+, Qt3, Qt4, Tk,
wxWidgets, Swing.
User Manual

Release Notes

Changelog

All News

ARTICLES

AVC-Simplifying your GUI Code

SCREENSHOTS

GTK+ examples

Qt3 examples

Qt4 examples

Tk examples

wxWidgets examples

Swing examples

DOWNLOAD

Source:
- current avc-0.8.3.tar.gz
all sources

Packages:
Arch Linux
Debian
Ubuntu

Quick start examples:
GTK+ spinbutton + glade file
Qt3 spinbox + ui file
Qt4 spinbox + ui file
Tk spinbox + tcl file
wxWidgets spincontrol + xrc file
Swing spinner

All examples


Swing quick start

This is the Swing spinner example included in AVC distribution. For full details see the "Swing examples" chapter of the user manual.

Source code: file swing_spinner.py
01: #!/usr/bin/env jython
02: # .+
03: # .context    : Application View Controller
04: # .title      : A spinner replicated into a label (Swing),
05: #               GUI programmatically generated
06: # .kind       : python source
07: # .author     : Fabrizio Pollastri
08: # .site       : Revello - Italy
09: # .creation   : 16-Mar-2009
10: # .copyright  : (c) 2009 Fabrizio Pollastri.
11: # .license    : GNU General Public License (see below)
12: #
13: # This file is part of "AVC, Application View Controller".
14: #
15: # AVC is free software; you can redistribute it and/or modify
16: # it under the terms of the GNU General Public License as published by
17: # the Free Software Foundation; either version 3 of the License, or
18: # (at your option) any later version.
19: #
20: # AVC is distributed in the hope that it will be useful,
21: # but WITHOUT ANY WARRANTY; without even the implied warranty of
22: # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
23: # GNU General Public License for more details.
24: #
25: # You should have received a copy of the GNU General Public License
26: # along with this program.  If not, see <http://www.gnu.org/licenses/>.
27: #
28: # .-
29:
30: from javax import swing                 # swing toolkit bindings
31: from java import awt                    # awt toolkit bindings
32:
33: from avc import *                       # AVC for Swing
34:
35:
36: class Example(AVC):
37:   """
38:   A spinner whose value is replicated into a label
39:   """
40:
41:   def __init__(self):
42:
43:     # create GUI
44:     root = swing.JFrame('AVC Swing spinner example',size=(320,60),
45:       defaultCloseOperation = swing.JFrame.EXIT_ON_CLOSE)
46:     root.layout = awt.FlowLayout()
47:     root.add(swing.JLabel('%s',name='spin_value__label',preferredSize=(80,20)))
48:     root.add(swing.JSpinner(name='spin_value__spinner',preferredSize=(80,20)))
49:     root.show()
50:
51:     # the variable holding the spinner value
52:     self.spin_value = 0
53:
54:
55: #### MAIN
56:
57: example = Example()                     # instantiate the application
58: example.avc_init()                      # connect widgets with variables
59:
60: #### END
61: