Hi Duncan, I am simply using the solution suggested by Edzard and Greg - just simple window->show(). I am directly using argc and argv from main and I don't want to know what FLTK does with argc and argv and why it stores them inside its own class or namespace.
Basically, my application is supposed to run on Windows as well as Linux. On Windows my application is started by another application that sends command-line arguments in the "/xxx" manner as it goes in Windows world. However, in case of Linux/Unix, I need to parse "-" and "--". I can do all this if I directly parse command-line using the argc and argv args of main(). Or, I can use Boost.Program_Options library to handle all this for me. However, I would be thankful if you can inform me as to the side effects, if there are any at all, if I don't do anything with FLTK's argc and argv and directly use argc and argv of main. Best regards, Asif On Fri, Aug 5, 2011 at 12:19 PM, Duncan Gibson <[email protected]>wrote: > Duncan: > >> Be aware that if you need trailing [non-option] arguments, such as > >> filenames, that you need to put an explicit '--' in the command line. > >> > >> ./flApp [options handled by args()] -- file1 file2 file3 ... > >> > >> I always forget the '--', and then wonder why I get an error message > > Asif: > > I am sure if I understand your point but I am doing just fine with > > the argc and argv that I get from main(). I do that before I do > > anything related with FLTK. > > > I'm afraid that I replied without thinking, and confused things. > I hope that's clear from the later discussions with Ian. > > As Ian pointed out, the simplest command line handling is probably > something like the following: > > #include <stdio.h> > #include <FL/Fl.H> > > int main(int argc, char* argv[]) > { > int argsUsed; > if (!Fl::args(argc, argv, argsUsed)) > Fl::fatal(Fl::help); > > while (argsUsed < argc) > printf("argv[%d] = '%s'\n", argsUsed, argv[argsUsed++]); > > return 0; > } > > The code above, or something like it, should probably be added to > the Fl::args() documentation, or as a comment in the example code. > > The examples/howto-parse-opts.cxx shows you the sort of thing you > need to do if you want to add your own command line switches that > start with '-' > > Cheers > Duncan > _______________________________________________ > fltk mailing list > [email protected] > http://lists.easysw.com/mailman/listinfo/fltk > _______________________________________________ fltk mailing list [email protected] http://lists.easysw.com/mailman/listinfo/fltk

