Nordwolf wrote:

> I'm currently evaluating FLTK 2 to see if it is suitable for a potential 
> project I am doing. 

FLTK 2 is currently not maintained very well. The major development
is focused on FLTK 1.3 now.

Maybe you'd better start with FLTK 1.3 (or 1.1), if you want to
develop a new application. There's much better support...

For the current status of versions, see:

http://www.fltk.org/articles.php?L825

 > 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.

I can see the problem...

> Since I am new, it's possible I'm using the Group widgets entirely 
> wrong.  Any help would be great. Thanks!

I don't think that your code is wrong. However, I can't really help
with FLTK 2.0 :-(

> Here is the sample code that demonstrates the probem:

[Example code removed]

I rewrote your example for FLTK 1.3, and there's no problem with it:

/*
* Just testing layout capabilities of FLTK to see how
* easily we can support multi-paned windows with resizable parts.
*/

#include <FL/Fl.H>
#include <FL/Fl_Window.H>
#include <FL/Fl_Menu_Bar.H>
#include <FL/Fl_Text_Editor.H>
#include <FL/Fl_Text_Buffer.H>
#include <FL/Fl_Pack.H>
#include <FL/Fl_Tile.H>
#include <FL/Fl_Widget.H>

int main()
{
    Fl_Window window(50, 50, 400, 300);
    window.color(FL_WHITE);
    window.begin();
    Fl_Pack pack(0, 0, 400, 300);
    pack.begin();
    Fl_Menu_Bar menubar(0, 0, 0, 30);
    menubar.add("&File");
    menubar.add("&Edit");
    menubar.add("&View");
    menubar.add("&Window");
    menubar.add("&Help");
    Fl_Menu_Bar toolbar(0, 0, 0, 30);
    toolbar.add("@->");
    toolbar.add("@>");
    toolbar.add("@>>");
    toolbar.add("@>|");
    toolbar.add("@|>");
    toolbar.add("@<");
    Fl_Tile tile(0, 0, 400, 300);
    tile.begin();

    Fl_Text_Buffer buffer(1024); // needed for scrollbars

    Fl_Text_Editor editor(0, 0, 400, 100);
    editor.buffer(buffer); // needed for scrollbars

    Fl_Text_Editor editor1(0, 100 ,400, 200);
    editor1.buffer(buffer); // needed for scrollbars

    tile.end();
    pack.resizable(tile);
    pack.end();
    window.resizable(pack);
    window.end();
    window.show();

    return Fl::run();
}

The only things I changed are the different names, and I added
a text buffer (the same buffer for both editor widgets), because
otherwise the scrollbars wouldn't appear.

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

Reply via email to