> I have written a small programm (see below). The scrollbar hesitates
> to work properly.
Can you describe what you want to do?
It is not clear from your program and there are a number of things that
look like serious bugs in your code.
Have you referred to the scroll.cxx demo in the test folder?
Is there some reason that you must use fltk-2?
It is less stable, and much less well supported than fltk-1.x, so you
might do better using fltk-1.1 or fltk-1.3 until you are comfortable
with the fltk way of coding...
> void ScrollGroup::layout()
> {
> canvas = new Canvas(0,0,400,375);
I doubt that you meant that - this must surely be a bug.
The layout method will be called whenever the widget is "layout_damaged"
so this function will run following any resize or possibly even
following a scroll operation.
That means you will be creating new instances of the canvas (and your
other widgets below) all the time.
That can not be what you intended.
Perhaps this is why your code does not appear to be working? You keep
creating new widgets on top of the old ones...?
> canvas->color(fltk::color("orange"));
>
> int X = 10, Y = 320;
>
> inp = new Input(X, Y, 100, 25);
> inp->text("HELLO");
>
> X += 110;
> but = new Button(X, Y, 50,25);
> but->copy_label("But");
>
> add(but); add(inp); add(canvas);
>
> w(canvas->w()+17);
> hscrollbar.hide();
> #ifdef WITH_VBAR_VALUE
> scrollbar.value(0,w()+17,0,375);
> #endif
> scrollbar.resize(w()-17,y(),17,h());
> scrollbar.show();
> }
SELEX Sensors and Airborne Systems Limited
Registered Office: Sigma House, Christopher Martin Road, Basildon, Essex SS14
3EL
A company registered in England & Wales. Company no. 02426132
********************************************************************
This email and any attachments are confidential to the intended
recipient and may also be privileged. If you are not the intended
recipient please delete it from your system and notify the sender.
You should not copy it or use it for any purpose nor disclose or
distribute its contents to any other person.
********************************************************************
_______________________________________________
fltk mailing list
[email protected]
http://lists.easysw.com/mailman/listinfo/fltk