Hi, seems as if widgets placed onto a Fl_Scroll don't keep their positions on scrolling. E.g.: the topmost widget's y-position is 30. There is a vertical scrollbar due to another widget with y-position 300. Pull the vertical scrollbar down and move it back to its top position. The y-value of the topmost widget will be 0. I would expect it keeping its original value. Am I wrong or is FLTK?
Here's my code. OS is Linux Mint 12, FLTK 1.3.0. #include <FL/Fl.H> #include <FL/Fl_Double_Window.H> #include <FL/Fl_Group.H> #include <FL/Fl_Scroll.H> #include <FL/fl_draw.H> #include <FL/Fl_Box.H> class Box : public Fl_Box { public: Box( int x, int y, int w, int h, const char *lbl ) : Fl_Box( x, y, w, h, lbl ) { labelcolor( FL_BLACK ); } protected: void draw() { Fl_Box::draw(); fl_draw_box(FL_UP_BOX, x(), y(), w(), h(), FL_YELLOW ); } }; int main() { Fl_Double_Window *pWin = new Fl_Double_Window( 100, 100, 300, 300, "Scroll Tests" ); pWin->box( FL_NO_BOX ); Fl_Scroll scroll( 0, 0, 300, 300 ); scroll.box( FL_DOWN_BOX ); Box box1( 0, 30, 100, 50, "BOX1" ); Box box2( 300, 300, 100, 50, "BOX2" ); scroll.end(); pWin->end(); pWin->resizable( scroll ); pWin->show(); return Fl::run(); } _______________________________________________ fltk mailing list fltk@easysw.com http://lists.easysw.com/mailman/listinfo/fltk