Hi all,
I'm currently evaluating FLTK 2 to see if it is suitable for a potential
project I am doing. I've written some sample code just to get used to
some of the widgets and layout managers, but I've run into a problem
with TextEditors combined with a TileGroup. The TextEditor doesn't
account for the size of the scrollbar it seems, so in the sample code
below, when you drag the the TileGroup up to far, the horizontal
scrollbar in the text editor draws into the area occupied by the toolbar
and ends up corrupting the toolbar. The toolbar is not repainted when
you resize the PackGroup again, so the drawing corruption remains.
Since I am new, it's possible I'm using the Group widgets entirely
wrong. Any help would be great. Thanks!
Here is the sample code that demonstrates the probem:
/*
* Just testing layout capabilities of FLTK to see how
* easily we can support multi-paned windows with resizable parts.
*/
#include <fltk/run.h>
#include <fltk/Window.h>
#include <fltk/MenuBar.h>
#include <fltk/TextEditor.h>
#include <fltk/Divider.h>
#include <fltk/PackedGroup.h>
#include <fltk/TiledGroup.h>
#include <fltk/Widget.h>
using namespace fltk;
int main()
{
Window window(50, 50, 400, 300);
window.color(WHITE);
window.begin();
PackedGroup pack(0, 0, 400, 300);
pack.begin();
MenuBar menubar(0, 0, 0, 30);
menubar.add("&File");
menubar.add("&Edit");
menubar.add("&View");
menubar.add("&Window");
menubar.add("&Help");
MenuBar toolbar(0, 0, 0, 30);
toolbar.add("@->");
toolbar.add("@>");
toolbar.add("@>>");
toolbar.add("@>|");
toolbar.add("@|>");
toolbar.add("@<");
TiledGroup tile(0, 0, 400, 300);
tile.begin();
TextEditor editor(0, 0, 400, 100);
TextEditor editor1(0, 100 ,400, 200);
tile.end();
pack.resizable(tile);
pack.end();
window.resizable(pack);
window.end();
window.show();
return run();
}
_______________________________________________
fltk mailing list
[email protected]
http://lists.easysw.com/mailman/listinfo/fltk