source: trunk/essentials/dev-lang/python/Demo/tix/samples/Control.py@ 3226

Last change on this file since 3226 was 3225, checked in by bird, 19 years ago

Python 2.5

File size: 4.1 KB
Line 
1# -*-mode: python; fill-column: 75; tab-width: 8; coding: iso-latin-1-unix -*-
2#
3# $Id: Control.py 36560 2004-07-18 06:16:08Z tim_one $
4#
5# Tix Demostration Program
6#
7# This sample program is structured in such a way so that it can be
8# executed from the Tix demo program "tixwidgets.py": it must have a
9# procedure called "RunSample". It should also have the "if" statment
10# at the end of this file so that it can be run as a standalone
11# program.
12
13# This file demonstrates the use of the tixControl widget -- it is an
14# entry widget with up/down arrow buttons. You can use the arrow buttons
15# to adjust the value inside the entry widget.
16#
17# This example program uses three Control widgets. One lets you select
18# integer values; one lets you select floating point values and the last
19# one lets you select a few names.
20
21import Tix
22
23TCL_ALL_EVENTS = 0
24
25def RunSample (root):
26 control = DemoControl(root)
27 control.mainloop()
28 control.destroy()
29
30class DemoControl:
31 def __init__(self, w):
32 self.root = w
33 self.exit = -1
34
35 global demo_maker, demo_thrust, demo_num_engines
36
37 demo_maker = Tix.StringVar()
38 demo_thrust = Tix.DoubleVar()