# # "$Id: valuators.py,v 1.5 2003/09/29 21:39:48 andreasheld Exp $" # # Valuators test program for pyFLTK the Python bindings # for the Fast Light Tool Kit (FLTK). # # FLTK copyright 1998-1999 by Bill Spitzak and others. # pyFLTK copyright 2003 by Andreas Held and others. # # This library is free software you can redistribute it and/or # modify it under the terms of the GNU Library General Public # License as published by the Free Software Foundation either # version 2 of the License, or (at your option) any later version. # # This library is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # Library General Public License for more details. # # You should have received a copy of the GNU Library General Public # License along with this library if not, write to the Free Software # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 # USA. # # Please report all bugs and problems to "pyfltk-user@lists.sourceforge.net". # from fltk import * # global object names def theCallback(ptr): print ptr.value() def main(): o_1_0 = Fl_Window(465, 113, 567, 506, "Valuator classes, showing values for type()") o_1_0.pyChildren=[] o_2_0 = Fl_Box(10, 10, 280, 210, "Fl_Slider") o_2_0.pyChildren=[] o_2_0.label('Fl_Slider') o_2_0.align(17) o_2_0.labelfont(1) o_2_0.box(FL_ENGRAVED_BOX) o_1_0.pyChildren.append(o_2_0) o_2_1 = Fl_Slider(30, 45, 20, 145, "") o_2_1.pyChildren=[] o_2_1.label('') o_2_1.labelsize(8) o_2_1.callback(theCallback) o_2_1.align(1) o_2_1.selection_color(1) o_1_0.pyChildren.append(o_2_1) o_2_2 = Fl_Fill_Slider(70, 55, 20, 145, "FL_VERT_FILL_SLIDER") o_2_2.pyChildren=[] o_2_2.label('FL_VERT_FILL_SLIDER') o_2_2.labelsize(8) o_2_2.callback(theCallback) o_2_2.selection_color(1) o_1_0.pyChildren.append(o_2_2) o_2_3 = Fl_Nice_Slider(105, 45, 20, 145, "FL_VERT_NICE_SLIDER") o_2_3.pyChildren=[] o_2_3.label('FL_VERT_NICE_SLIDER') o_2_3.labelsize(8) o_2_3.color(10) o_2_3.callback(theCallback) o_2_3.align(1) o_2_3.selection_color(1) o_2_3.box(FL_FLAT_BOX) o_1_0.pyChildren.append(o_2_3) o_2_4 = Fl_Box(10, 230, 280, 205, "Fl_Value_Slider") o_2_4.pyChildren=[] o_2_4.label('Fl_Value_Slider') o_2_4.align(17) o_2_4.labelfont(1) o_2_4.box(FL_ENGRAVED_BOX) o_1_0.pyChildren.append(o_2_4) o_2_5 = Fl_Value_Slider(30, 260, 30, 145) o_2_5.pyChildren=[] o_2_5.callback(theCallback) o_2_5.align(1) o_2_5.labelsize(8) o_2_5.selection_color(1) o_1_0.pyChildren.append(o_2_5) o_2_6 = Fl_Value_Slider(70, 275, 30, 140, "FL_VERT_FILL_SLIDER") o_2_6.type(2) o_2_6.pyChildren=[] o_2_6.label('FL_VERT_FILL_SLIDER') o_2_6.labelsize(8) o_2_6.callback(theCallback) o_2_6.selection_color(1) o_1_0.pyChildren.append(o_2_6) o_2_7 = Fl_Value_Slider(110, 260, 20, 145, "FL_VERT_NICE_SLIDER") o_2_7.type(4) o_2_7.pyChildren=[] o_2_7.label('FL_VERT_NICE_SLIDER') o_2_7.labelsize(8) o_2_7.color(10) o_2_7.callback(theCallback) o_2_7.align(1) o_2_7.selection_color(1) o_2_7.box(FL_FLAT_BOX) o_1_0.pyChildren.append(o_2_7) o_2_8 = Fl_Hor_Slider(140, 80, 130, 20, "FL_HORIZONTAL") o_2_8.pyChildren=[] o_2_8.label('FL_HORIZONTAL') o_2_8.labelsize(8) o_2_8.callback(theCallback) o_2_8.selection_color(1) o_1_0.pyChildren.append(o_2_8) o_2_9 = Fl_Hor_Fill_Slider(140, 120, 130, 20, "FL_HOR_FILL_SLIDER") o_2_9.pyChildren=[] o_2_9.label('FL_HOR_FILL_SLIDER') o_2_9.labelsize(8) o_2_9.callback(theCallback) o_2_9.selection_color(1) o_1_0.pyChildren.append(o_2_9) o_2_10 = Fl_Hor_Nice_Slider(140, 160, 130, 20, "FL_HOR_NICE_SLIDER") o_2_10.pyChildren=[] o_2_10.label('FL_HOR_NICE_SLIDER') o_2_10.color(10) o_2_10.labelsize(8) o_2_10.callback(theCallback) o_2_10.selection_color(1) o_2_10.box(FL_FLAT_BOX) o_1_0.pyChildren.append(o_2_10) o_2_11 = Fl_Hor_Value_Slider(140, 290, 130, 20, "FL_HOR_SLIDER") o_2_11.pyChildren=[] o_2_11.label('FL_HOR_SLIDER') o_2_11.labelsize(8) o_2_11.callback(theCallback) o_2_11.selection_color(1) o_1_0.pyChildren.append(o_2_11) o_2_12 = Fl_Value_Slider(140, 330, 130, 20, "FL_HOR_FILL_SLIDER") o_2_12.type(3) o_2_12.pyChildren=[] o_2_12.label('FL_HOR_FILL_SLIDER') o_2_12.labelsize(8) o_2_12.callback(theCallback) o_2_12.selection_color(1) o_1_0.pyChildren.append(o_2_12) o_2_13 = Fl_Box(430, 10, 125, 120, "Fl_Adjuster") o_2_13.pyChildren=[] o_2_13.label('Fl_Adjuster') o_2_13.align(17) o_2_13.labelfont(1) o_2_13.box(FL_ENGRAVED_BOX) o_1_0.pyChildren.append(o_2_13) o_2_14 = Fl_Value_Slider(140, 370, 130, 20, "FL_HOR_NICE_SLIDER") o_2_14.type(5) o_2_14.pyChildren=[] o_2_14.label('FL_HOR_NICE_SLIDER') o_2_14.color(10) o_2_14.labelsize(8) o_2_14.callback(theCallback) o_2_14.selection_color(1) o_2_14.box(FL_FLAT_BOX) o_1_0.pyChildren.append(o_2_14) o_2_15 = Fl_Adjuster(440, 60, 75, 25, "w()>h()") o_2_15.pyChildren=[] o_2_15.label('w()>h()') o_2_15.callback(theCallback) o_2_15.labelsize(8) o_1_0.pyChildren.append(o_2_15) o_2_16 = Fl_Adjuster(520, 35, 25, 75, "w()