DO NOT REPLY TO THIS MESSAGE.  INSTEAD, POST ANY RESPONSES TO THE LINK BELOW.

[STR New]

Link: http://www.fltk.org/str.php?L2832
Version: 1.3-current


Attached file "tree-and-inputs-with-labels.cxx"...


Link: http://www.fltk.org/str.php?L2832
Version: 1.3-current
#include <stdio.h>
#include <FL/Fl.H>
#include <FL/Fl_Double_Window.H>
#include <FL/Fl_Tree.H>
#include <FL/Fl_Input.H>
int main(int argc, char *argv[]) {
  Fl_Double_Window *win = new Fl_Double_Window(450, 400, "Tree As FLTK Widget 
Container");
  win->begin();
  {
    Fl_Tree *tree = new Fl_Tree(10, 10, win->w()-20, win->h()-20);
    tree->root()->label("Test Nodes");
    // Add some regular text nodes
    tree->add("Foo/Bar/001");
    tree->add("Foo/Bar/002");
    tree->add("Foo/Bla/Aaa");
    tree->add("Foo/Bla/Bbb");
    // Add items to the 'Data' node
    for ( int t=0; t<1000; t++ ) {
        // Add item to tree
        static char s[80];
        sprintf(s, "FLTK Widgets/%d", t);
        Fl_Tree_Item *item = tree->add(s);
        tree->begin();
        {
            sprintf(s, "Test %04d", t);
            Fl_Input *in = new Fl_Input(0,0,140,25);
            in->align(FL_ALIGN_RIGHT);
            in->copy_label(s);
            item->widget(in);
        }
        tree->end();
    }
  }
  win->end();
  win->resizable(win);
  win->show(argc, argv);
  return(Fl::run());
}
_______________________________________________
fltk-bugs mailing list
fltk-bugs@easysw.com
http://lists.easysw.com/mailman/listinfo/fltk-bugs

Reply via email to