| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
|
| 7 |
|
| 8 |
|
| 9 |
|
| 10 |
|
| 11 |
|
| 12 |
|
| 13 |
|
| 14 |
|
| 15 |
|
| 16 |
|
| 17 |
|
| 18 |
|
| 19 |
|
| 20 |
|
| 21 |
|
| 22 |
|
| 23 |
|
| 24 |
|
| 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() |