Hi All,

I need to make an Fl_Tree_Item visible in an Fl_Tree during 
initialization, but it doesn't seem to work.

How can I make it work?


#include <FL/Fl_Window.H>
#include <FL/Fl_Tree.H>

int main(int argc, char* argv[]) {
     Fl_Window* w = new Fl_Window(300, 200);
     w->begin();

     Fl_Tree* tree = new Fl_Tree(10, 10, 280, 180);
     Fl_Tree_Item* p007 = NULL;

     for (int i=30; i>=0; --i) {
         char buf[10];
         sprintf(buf, "%03d", i);

         Fl_Tree_Item* p = tree->add(buf);

         if (i == 7)
             p007 = p;
     }

     p007->select();                // This works
     tree->show_item_middle(p007);  // but this doesn't

     w->end();
     w->show();

     tree->show_item_middle(p007);  // Didn't work above so try again

     return Fl::run();
}

- Howard Rubin

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

Reply via email to