How do I make the Fl_Scroll widget automatically redraw the window when I move 
the sliders?

In the little program below I'm able to move the image with the sliders but to 
refresh the screen I have to resize the main window.

Thanks for any help,
Jens

----------------------------------------------------------------------

#include <FL/Fl.H>
#include <FL/fl_draw.H>
#include <FL/Fl_Double_Window.H>
#include <FL/Fl_Scroll.H>

class Draw : public Fl_Widget {
  public:
    Draw(long int x, long int y, long int w, long int h, const char *l=0) : 
Fl_Widget(x, y ,w ,h, l) {}
    void draw() {
      fl_color(FL_BLACK);
      fl_rect(x(), y(), w(), h());
    }
};

int main() {
  Fl_Double_Window win(Fl::w(),Fl::h());
  Fl_Scroll scroll(win.x(),win.y(),win.w(),win.h());
  Draw * draw;

  for(int i = 0; i < 1000; i+=10) {
    draw = new Draw(win.x()-i,win.y()+i,win.w()+i,win.h()+i);
  }

  scroll.end();
  win.resizable(scroll);
  win.end();
  win.show();
  return(Fl::run());
}

_______________________________________________
fltk mailing list
[email protected]
http://lists.easysw.com/mailman/listinfo/fltk

Reply via email to