Logo
AVC, Application View Controller

OUTLINE

Current: 0.10.0

Released: 24-Apr-2015

License: GPL

Common Requirements:
python 2.2 - <3.0

GTK2+ requirements:
Pygtk 2.8 - 2.10
GTK3+ requirements:
PyGObject >=3.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:
GTK2+, GTK3+, Qt, Tk,
wxWidgets, Swing.
User Manual

Release Notes

Changelog

All News

ARTICLES

AVC-Simplifying your GUI Code

SCREENSHOTS

GTK2+ examples

GTK3+ examples

Qt examples

Tk examples

wxWidgets examples

Swing examples

DOWNLOAD

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

Packages:
Arch Linux
Debian
Ubuntu

Quick start examples:
GTK2+ spinbutton + glade file
GTK3+ spinbutton + glade file
ui file
Qt 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: