You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

48 lines
1.6KB

  1. // generated by Fast Light User Interface Designer (fluid) version 1.0300
  2. #include "fast_slow.h"
  3. Fl_Slider *control=(Fl_Slider *)0;
  4. static void cb_control(Fl_Slider* o, void*) {
  5. fast->value(o->value());
  6. if (!Fl::pushed()) slow->value(o->value());
  7. }
  8. Fl_Slider *fast=(Fl_Slider *)0;
  9. Fl_Slider *slow=(Fl_Slider *)0;
  10. int main(int argc, char **argv) {
  11. Fl_Double_Window* w;
  12. { Fl_Double_Window* o = new Fl_Double_Window(318, 443);
  13. w = o;
  14. { Fl_Slider* o = control = new Fl_Slider(90, 200, 30, 200, "move\nthis");
  15. control->callback((Fl_Callback*)cb_control);
  16. o->when(FL_WHEN_CHANGED|FL_WHEN_RELEASE|FL_WHEN_NOT_CHANGED);
  17. } // Fl_Slider* control
  18. { Fl_Slider* o = fast = new Fl_Slider(140, 200, 30, 200, "fast\nredraw");
  19. o->set_output();
  20. } // Fl_Slider* fast
  21. { Fl_Slider* o = slow = new Fl_Slider(190, 200, 30, 200, "slow\nredraw");
  22. o->set_output();
  23. } // Fl_Slider* slow
  24. { Fl_Box* o = new Fl_Box(10, 10, 300, 180, "The left slider has changed( FL_WHEN_CHANGED | FL_WHEN_RELEASE | FL_WHEN_NOT_\
  25. CHANGED) so it produces a callback on both drag and release mouse events.\nThe\
  26. middle slider (representing a widget with low overhead) is changed on every m\
  27. ouse movement.\nThe right slider (representing a widget with high overhead) is\
  28. only updated when the mouse is released, by checking if Fl::pushed() is zero.");
  29. o->box(FL_DOWN_BOX);
  30. o->color((Fl_Color)53);
  31. o->selection_color(FL_DARK1);
  32. o->labelfont(4);
  33. o->labelsize(12);
  34. o->align(Fl_Align(132|FL_ALIGN_INSIDE));
  35. } // Fl_Box* o
  36. o->end();
  37. o->resizable(o);
  38. } // Fl_Double_Window* o
  39. w->show(argc, argv);
  40. return Fl::run();
  41. }