summaryrefslogtreecommitdiff
path: root/test/fast_slow.C
diff options
context:
space:
mode:
authorMichael R Sweet <michael.r.sweet@gmail.com>1998-10-06 18:21:25 +0000
committerMichael R Sweet <michael.r.sweet@gmail.com>1998-10-06 18:21:25 +0000
commitf9039b2ae21988783feae9b362818e7923e82d14 (patch)
tree6d6fe3679d73448758f9794e7d4d4f6b22a4adad /test/fast_slow.C
parent67e89232f9ba067825a158734a09e0fa21aacbe3 (diff)
Initial revision
git-svn-id: file:///fltk/svn/fltk/trunk@2 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
Diffstat (limited to 'test/fast_slow.C')
-rw-r--r--test/fast_slow.C50
1 files changed, 50 insertions, 0 deletions
diff --git a/test/fast_slow.C b/test/fast_slow.C
new file mode 100644
index 000000000..42fdff135
--- /dev/null
+++ b/test/fast_slow.C
@@ -0,0 +1,50 @@
+// generated by Fast Light User Interface Designer (fluid) version 0.99
+
+#include "fast_slow.H"
+
+Fl_Slider *control;
+
+static void cb_control(Fl_Slider* o, void*) {
+ fast->value(o->value());
+if (!Fl::pushed()) slow->value(o->value());
+}
+
+Fl_Slider *fast;
+
+Fl_Slider *slow;
+
+int main(int argc, char **argv) {
+ Fl_Window *w;
+ { Fl_Window* o = new Fl_Window(318, 443);
+ w = o;
+ Fl_Group::current()->resizable(o);
+ { Fl_Slider* o = new Fl_Slider(90, 200, 30, 200, "move\nthis");
+ control = o;
+ o->callback((Fl_Callback*)cb_control);
+ o->when(FL_WHEN_CHANGED|FL_WHEN_RELEASE|FL_WHEN_NOT_CHANGED);
+ }
+ { Fl_Slider* o = new Fl_Slider(140, 200, 30, 200, "fast\nredraw");
+ fast = o;
+ o->set_output();
+ }
+ { Fl_Slider* o = new Fl_Slider(190, 200, 30, 200, "slow\nredraw");
+ slow = o;
+ o->set_output();
+ }
+ { Fl_Box* o = new Fl_Box(10, 10, 300, 180, "The left slider has changed( FL_WHEN_CHANGED | FL_WHEN_RELEASE | FL_WHEN_N\
+OT_CHANGED) so it produces a callback on both drag and release mouse events\
+.\nThe middle slider (representing a widget with low overhead) is changed o\
+n every mouse movement.\nThe right slider (representing a widget with high \
+overhead) is only updated when the mouse is released, by checking if Fl::pu\
+shed() is zero.");
+ o->box(FL_DOWN_BOX);
+ o->color(53);
+ o->labelfont(4);
+ o->labelsize(12);
+ o->align(148);
+ }
+ w->end();
+ }
+ w->show(argc, argv);
+ return Fl::run();
+}