> You can't mean r970?
> Current svn is about r7191, though there have been few if any changes to
> the fltk2 baseline in many months.

Hah, no. that was a typo. that's supposed to be 6970 - the one advertised on 
the frontpage (but the svn checkout might have been slightly different.)

> > ---------------------------------------------
> > #include <fltk/Window.h>
> > #include <fltk/Browser.h>
> > #include <fltk/Button.h>
> > #include <fltk/run.h>
> >
> > #include <stdio.h>
> > #include <stdlib.h>
> >
> > using namespace fltk;
> >
> > Browser *browser=3D0;
> >
> > void change_text(Button *w, long arg) {
> >   static int count =3D 124;
> >   browser->clear();
> >   for(int idx = 0; idx < 123; idx++){
> >     char text[32];
> >     sprintf(text, "Text Line %d", count);
> >     count++;
> >     browser->add(text);
> >   }
> > }
> >
> > int main(int argc,char** argv) {
> >
> >   Window win(280, 340, "Browser Example");
> >   win.begin();
> >
> >   Button change_button(5, 305, 60, 30, "Change");
> >   change_button.callback((Callback*)change_text);
> >
> >   browser = new Browser(5, 5, 260, 295);
> >
> >   for(int idx = 0; idx < 123; idx++){
> >     char text[32];
> >     sprintf(text, "Text Line %d", idx+1);
> >     browser->add(text);
> >   }
> >   browser->end();
> >
> >   win.resizable(browser);
> >   win.end();
> >   win.show(argc,argv);
> >
> >   fltk::run();
> >   return 0;
> > }
> >
> > /* end of file */

And so again, i get stuck with the same problem as i had. But when using your 
code exactly as you've written it, there's no problem and it acts like it's 
supposed to.
I've changed my modify function to include
    this->textBrowser->clear();
    this->textBrowser->redraw();
    for (i = 0; i < numValidWords; i++){
                char text[15];
                // print to the text array the new word + a newline
                sprintf(text, "%s\n", validWords[i]);
                this->textBrowser->add(text);
    }

as it's last set of instructions, and the constructor for my window has nothing 
more than "textBrowser = new Browser(150, 130, 470, 120, "Valid words:");"

It doesnt seem to be honouring the clear() instruction. Which is as strange as 
all can be.
The Browser is in a subclassed Window, and it's a private member of the class. 
The class calls the constructor of the Browser as a method of the classes 
constructor.
I just cant see what's going wrong here.

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

Reply via email to