Debian Codegraph @

fltk/test/wrapper.py

raw symbols SCIP
1 #
2 # "$Id: wrapper.py 532 2020-05-11 20:10:32Z andreasheld $"
3 #
4 # Dial 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
28 from fltk import *
29 import sys
30
31 def theCancelButtonCallback(ptr):
32 sys.exit(0)
33
34 def theDialChangedCallback(dial):
35 value = dial.value()
36 theTextOutputBox.value(str(value))
37 if (value>65):
38 theTextOutputBox.textcolor(1)
39 else:
40 theTextOutputBox.textcolor(0)
41
42
43 mainWindow = Fl_Window(100, 100, 268, 159, sys.argv[0])
44 mainWindow.box(FL_EMBOSSED_BOX)
45 mainWindow.color(215)
46
47 theDial = Fl_Roller(35, 60, 195, 25)
48 theDial.type(1)
49 theDial.maximum(100.0)
50 theDial.step(0.5)
51 theDial.callback(theDialChangedCallback)
52
53 theTextOutputBox = Fl_Output(85, 20, 85, 25)
54 theTextOutputBox.box(FL_ENGRAVED_BOX)
55
56 theCancelButton = Fl_Button(70, 110, 125, 35, "Cancel")
57 theCancelButton.color(214)
58 theCancelButton.selection_color(133)
59 theCancelButton.callback(theCancelButtonCallback)
60
61 mainWindow.end()
62 mainWindow.show(len(sys.argv), sys.argv)
63
64 Fl.run()