> I have written a small programm (see below). The scrollbar hesitates
> to work properly.
Did you mean something like this?
This appears to work correctly, as a guess at what you were trying to
achieve...
Built with "fltk2-config --compile test.cxx"
/* w.szukalski fltk2 scroll demo */
#include <stdlib.h>
#include <fltk/run.h>
#include <fltk/draw.h>
#include <fltk/Widget.h>
#include <fltk/Window.h>
#include <fltk/ScrollGroup.h>
#include <fltk/Button.h>
#include <fltk/Box.h>
#include <fltk/Input.h>
#include <fltk/Color.h>
static fltk::Window *win;
static fltk::ScrollGroup *scrollG;
static fltk::Input *inp;
static fltk::Button *but;
class Canvas : public fltk::Widget {
void draw();
public:
Canvas(int X,int Y,int W,int H) : fltk::Widget(X,Y,W,H)
{
box(fltk::FLAT_BOX);
}
};
void Canvas::draw() {
fltk::setfont(fltk::HELVETICA, h());
fltk::setcolor(fltk::RED);
fltk::drawtext("A", fltk::Rectangle(w(),h()),
fltk::ALIGN_CENTER);
}
static Canvas *canvas;
void cancel_cb(fltk::Widget* o, void*) {
win->hide();
}
int main(int argc, char** argv) {
win = new fltk::Window(417,340);
win->begin();
scrollG = new fltk::ScrollGroup(0,0,400,300);
scrollG->begin();
canvas = new Canvas(0,0,400,375);
int X = 10, Y = 320;
inp = new fltk::Input(X, Y, 100, 25);
inp->text("HELLO");
X += 110;
but = new fltk::Button(X, Y, 50,25);
but->copy_label("But");
scrollG->end();
scrollG->type(fltk::ScrollGroup::VERTICAL);//scrollbar type
scrollG->box(fltk::DOWN_BOX);
win->begin();
fltk::Button *b = new fltk::Button(50, 310, 60, 25, "Cancel");
b->callback(cancel_cb);
win->resizable(scrollG);
win->end();
win->show();
return fltk::run();
}
/* end of file */
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