Debian Codegraph @

fltk/test/sliders.py

raw symbols SCIP
1 #
2 # "$Id: sliders.py 164 2006-01-17 09:56:47Z andreasheld $"
3 #
4 # Slider test program for pyFLTK the Python bindings
5 # for the Fast Light Tool Kit (FLTK).
6 #
7 # FLTK copyright 1998-1999 by Bill Spitzak and others.
8 # pyFLTK copyright 2003 by Andreas Held and others.
9 #
10 # This library is free software you can redistribute it and/or
11 # modify it under the terms of the GNU Library General Public
12 # License, version 2.0 as published by the Free Software Foundation.
13 #
14 # This library is distributed in the hope that it will be useful,
15 # but WITHOUT ANY WARRANTY without even the implied warranty of
16 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17 # Library General Public License for more details.
18 #
19 # You should have received a copy of the GNU Library General Public
20 # License along with this library if not, write to the Free Software
21 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
22 # USA.
23 #
24 # Please report all bugs and problems to "[email protected]".
25 #
26
27 from fltk import *
28 import sys
29
30 window = Fl_Window(100, 100, 600, 470)
31
32 def cb_OK(ptr):
33 sys.exit(0)
34
35
36 horizPack = Fl_Pack( 0, 0, 600, 200)
37 horizPack.type(FL_HORIZONTAL)
38 horizPack.spacing(80)
39 horizPack.children = []
40 vsh = 100
41 vsw = 30
42 horizPack.children.append(Fl_Fill_Slider( 0, 0, vsw, vsh, "Fl_Fill_Slider"))
43 horizPack.children.append(Fl_Nice_Slider( 0, 0, vsw, vsh,"Fl_Nice_Slider"))
44 horizPack.children.append(Fl_Slider( 0, 0, vsw, vsh,"Fl_Slider"))
45 horizPack.children.append(Fl_Value_Slider( 0, 0, vsw, vsh,"Fl_Value_Slider"))
46 horizPack.end()
47
48 vertPack = Fl_Pack( 0, 250, 600, 200)
49 vertPack.type(FL_VERTICAL)
50 vertPack.spacing(30)
51 vertPack.children = []
52 vertPack.children.append(Fl_Hor_Fill_Slider( 10, 10, 10, 20, "Fl_Hor_Fill_Slider"))
53 vertPack.children.append(Fl_Hor_Nice_Slider( 10, 10, 10, 20,"Fl_Hor_Nice_Slider"))
54 vertPack.children.append(Fl_Hor_Slider( 10, 10, 10, 20,"Fl_Hor_Slider"))
55 vertPack.children.append(Fl_Hor_Value_Slider( 10, 10, 10, 30,"Fl_Hor_Value_Slider"))
56 vertPack.end()
57
58 def hcb(slider):
59 v = slider.value()
60 for child in vertPack.children + horizPack.children:
61 child.value(v)
62
63 for child in vertPack.children + horizPack.children:
64 child.callback(hcb)
65
66
67 okButton = Fl_Return_Button( 520, 30, 60, 30, "OK")
68 okButton.callback(cb_OK)
69
70 window.end()
71 window.show(len(sys.argv), sys.argv)
72
73 Fl.run()
74
75
76
77
78
79
80