adam wrote:
> 1) I can't do the "Fl::add_fd(fileno(G_fp), HandleFD, (void*)&brow);" command
> from anywhere except where the browser is initialized.

        Why not; what is preventing you?

        If it's because you don't have access to 'brow' because of the
        variable's scope, either make it a global, or pass it as userdata
        to the callback from main().

> 2) I can't run the window [from] a callback because I can't have
> "return Fl::run();" in there of course

        "Run the window"?
        Not sure what you mean, can you clarify?

        When a callback is invoked, you do what you need to do
        in that function, creating/manipulating the widgets, whatever.
        When you return from the callback, the Fl::run() loop will
        regain control.

        If you're trying to access the window from the callback and can't
        because of the window's variable scope, change the scope by either
        making it a global, or passing a pointer to it as userdata to the
        callback.

> 3)I can't open a browser inside the text editor window (section in the code 
> on line 111)

        I think if I show you a clean example, you'll get a better idea
        of how it works.

> 4)I can't change the command sent to popen.

        What prevents you?
        Make it a global and then you can change it from anywhere in
        the app, and your popen() command can access it.

> 5) the popen command must be there before the "Fl::add_fd(fileno(G_fp), 
> HandleFD, (void*)&brow);"
> command of course.

        My guess is you've got a problem with variable scope, and just need to 
make
        brow a global, so that you can access it from wherever you end up 
putting
        your popen() command.

        I'll try to follow up with a rewrite of your app, so that you can get
        an idea of how it should be laid out. Shouldn't be hard.
_______________________________________________
fltk mailing list
[email protected]
http://lists.easysw.com/mailman/listinfo/fltk

Reply via email to