diff options
| author | Greg Ercolano <erco@seriss.com> | 2010-12-15 23:21:32 +0000 |
|---|---|---|
| committer | Greg Ercolano <erco@seriss.com> | 2010-12-15 23:21:32 +0000 |
| commit | 0cd57058de08f9cb2f988cb85b3eb4e8b7e1e9d1 (patch) | |
| tree | 2cf229958d6d6b0715ecf4cfff7c06ba2c28a84e | |
| parent | 9b7e3e9c49b1d74d7711f6ac3e5a213ce0a499dc (diff) | |
Added toggle button to 'navigation' test program to control
new arrow focus behavior.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@8043 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
| -rw-r--r-- | test/navigation.cxx | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/test/navigation.cxx b/test/navigation.cxx index ded919ec2..da7678424 100644 --- a/test/navigation.cxx +++ b/test/navigation.cxx @@ -33,14 +33,23 @@ #include <FL/Fl.H> #include <FL/Fl_Window.H> #include <FL/Fl_Input.H> +#include <FL/Fl_Light_Button.H> #define WIDTH 600 #define HEIGHT 300 #define GRID 25 +void ToggleArrowFocus_CB(Fl_Widget *w, void*) { + Fl_Light_Button *b = (Fl_Light_Button*)w; + Fl::option(Fl::OPTION_ARROW_FOCUS, b->value() ? true : false); +} int main(int argc, char **argv) { if (argc > 1) srand(atoi(argv[1])); - Fl_Window window(WIDTH,HEIGHT,argv[0]); + Fl_Window window(WIDTH,HEIGHT+40,argv[0]); + // Include a toggle button to control arrow focus + Fl_Light_Button arrowfocus_butt(10,HEIGHT+10,130,20," Arrow Focus"); + arrowfocus_butt.callback(ToggleArrowFocus_CB); + arrowfocus_butt.value(Fl::option(Fl::OPTION_ARROW_FOCUS) ? 1 : 0); // use default window.end(); // don't auto-add children for (int i = 0; i<10000; i++) { // make up a random size of widget: |
