1998-10-20 00:46:58 +04:00
|
|
|
//
|
|
|
|
// Optional argument initialization code for the Fast Light Tool Kit (FLTK).
|
|
|
|
//
|
2022-02-22 21:55:11 +03:00
|
|
|
// Copyright 1998-2022 by Bill Spitzak and others.
|
1998-10-20 00:46:58 +04:00
|
|
|
//
|
2011-07-19 08:49:30 +04:00
|
|
|
// This library is free software. Distribution and use rights are outlined in
|
|
|
|
// the file "COPYING" which should have been included with this file. If this
|
|
|
|
// file is missing or damaged, see the license at:
|
1998-10-20 00:46:58 +04:00
|
|
|
//
|
2020-07-01 19:03:10 +03:00
|
|
|
// https://www.fltk.org/COPYING.php
|
1998-10-20 00:46:58 +04:00
|
|
|
//
|
2020-07-01 19:03:10 +03:00
|
|
|
// Please see the following page on how to report bugs and issues:
|
2005-04-16 04:13:17 +04:00
|
|
|
//
|
2020-07-01 19:03:10 +03:00
|
|
|
// https://www.fltk.org/bugs.php
|
1998-10-20 00:46:58 +04:00
|
|
|
//
|
1998-10-06 22:21:25 +04:00
|
|
|
|
2018-02-09 17:39:42 +03:00
|
|
|
// OPTIONAL initialization code for a program using FLTK.
|
1998-10-06 22:21:25 +04:00
|
|
|
// You do not need to call this! Feel free to make up your own switches.
|
|
|
|
|
|
|
|
#include <FL/Fl.H>
|
|
|
|
#include <FL/Fl_Window.H>
|
2022-11-01 22:01:17 +03:00
|
|
|
#include <FL/Fl_Tooltip.H>
|
2018-06-26 16:43:18 +03:00
|
|
|
#include "Fl_Window_Driver.H"
|
2018-06-26 17:12:43 +03:00
|
|
|
#include "Fl_System_Driver.H"
|
2022-10-23 13:19:44 +03:00
|
|
|
#include "Fl_Screen_Driver.H"
|
1998-10-06 22:21:25 +04:00
|
|
|
#include <ctype.h>
|
|
|
|
|
2002-08-09 07:17:30 +04:00
|
|
|
static int fl_match(const char *a, const char *s, int atleast = 1) {
|
|
|
|
const char *b = s;
|
1998-10-06 22:21:25 +04:00
|
|
|
while (*a && (*a == *b || tolower(*a) == *b)) {a++; b++;}
|
2002-08-09 07:17:30 +04:00
|
|
|
return !*a && b >= s+atleast;
|
1998-10-06 22:21:25 +04:00
|
|
|
}
|
|
|
|
|
|
|
|
// flags set by previously parsed arguments:
|
|
|
|
static char arg_called;
|
|
|
|
static char return_i;
|
|
|
|
static const char *name;
|
|
|
|
static const char *geometry;
|
|
|
|
static const char *title;
|
1998-12-02 19:00:48 +03:00
|
|
|
// these are in Fl_get_system_colors and are set by the switches:
|
|
|
|
extern const char *fl_fg;
|
|
|
|
extern const char *fl_bg;
|
|
|
|
extern const char *fl_bg2;
|
1998-10-06 22:21:25 +04:00
|
|
|
|
2008-09-14 02:33:03 +04:00
|
|
|
/**
|
2010-10-23 20:34:22 +04:00
|
|
|
Parse a single switch from \p argv, starting at word \p i.
|
2008-09-14 02:33:03 +04:00
|
|
|
Returns the number of words eaten (1 or 2, or 0 if it is not
|
2020-07-01 19:03:10 +03:00
|
|
|
recognized) and adds the same value to \p i.
|
|
|
|
|
2010-10-24 16:53:53 +04:00
|
|
|
This is the default argument handler used internally by Fl::args(...),
|
|
|
|
but you can use this function if you prefer to step through the
|
|
|
|
standard FLTK switches yourself.
|
2020-07-01 19:03:10 +03:00
|
|
|
|
2010-10-24 16:53:53 +04:00
|
|
|
All standard FLTK switches except -bg2 may be abbreviated to just
|
|
|
|
one letter and case is ignored:
|
2020-07-01 19:03:10 +03:00
|
|
|
|
2010-10-24 16:53:53 +04:00
|
|
|
\li -bg color or -background color
|
|
|
|
<br>
|
|
|
|
Sets the background color using Fl::background().
|
2020-07-01 19:03:10 +03:00
|
|
|
|
2010-10-24 16:53:53 +04:00
|
|
|
\li -bg2 color or -background2 color
|
|
|
|
<br>
|
|
|
|
Sets the secondary background color using Fl::background2().
|
2020-07-01 19:03:10 +03:00
|
|
|
|
2010-10-24 16:53:53 +04:00
|
|
|
\li -display host:n.n
|
|
|
|
<br>
|
|
|
|
Sets the X display to use; this option is silently
|
2018-02-09 17:39:42 +03:00
|
|
|
ignored under Windows and MacOS.
|
2020-07-01 19:03:10 +03:00
|
|
|
|
2010-10-24 16:53:53 +04:00
|
|
|
\li -dnd and -nodnd
|
|
|
|
<br>
|
|
|
|
Enables or disables drag and drop text operations
|
|
|
|
using Fl::dnd_text_ops().
|
2020-07-01 19:03:10 +03:00
|
|
|
|
2010-10-24 16:53:53 +04:00
|
|
|
\li -fg color or -foreground color
|
|
|
|
<br>
|
|
|
|
Sets the foreground color using Fl::foreground().
|
2020-07-01 19:03:10 +03:00
|
|
|
|
2010-10-24 16:53:53 +04:00
|
|
|
\li -geometry WxH+X+Y
|
|
|
|
<br>
|
|
|
|
Sets the initial window position and size according
|
|
|
|
to the standard X geometry string.
|
2020-07-01 19:03:10 +03:00
|
|
|
|
2010-10-24 16:53:53 +04:00
|
|
|
\li -iconic
|
|
|
|
<br>
|
|
|
|
Iconifies the window using Fl_Window::iconize().
|
2020-07-01 19:03:10 +03:00
|
|
|
|
2010-10-24 16:53:53 +04:00
|
|
|
\li -kbd and -nokbd
|
|
|
|
<br>
|
|
|
|
Enables or disables visible keyboard focus for
|
|
|
|
non-text widgets using Fl::visible_focus().
|
2020-07-01 19:03:10 +03:00
|
|
|
|
2010-10-24 16:53:53 +04:00
|
|
|
\li -name string
|
|
|
|
<br>
|
|
|
|
Sets the window class using Fl_Window::xclass().
|
2020-07-01 19:03:10 +03:00
|
|
|
|
2010-10-24 16:53:53 +04:00
|
|
|
\li -scheme string
|
|
|
|
<br>
|
|
|
|
Sets the widget scheme using Fl::scheme().
|
2020-07-01 19:03:10 +03:00
|
|
|
|
2010-10-24 16:53:53 +04:00
|
|
|
\li -title string
|
|
|
|
<br>
|
|
|
|
Sets the window title using Fl_Window::label().
|
2020-07-01 19:03:10 +03:00
|
|
|
|
2010-10-24 16:53:53 +04:00
|
|
|
\li -tooltips and -notooltips
|
|
|
|
<br>
|
|
|
|
Enables or disables tooltips using Fl_Tooltip::enable().
|
2020-07-01 19:03:10 +03:00
|
|
|
|
|
|
|
|
2010-10-24 16:53:53 +04:00
|
|
|
If your program requires other switches in addition to the standard
|
|
|
|
FLTK options, you will need to pass your own argument handler to
|
|
|
|
Fl::args(int,char**,int&,Fl_Args_Handler) explicitly.
|
2008-09-14 02:33:03 +04:00
|
|
|
*/
|
1998-10-06 22:21:25 +04:00
|
|
|
int Fl::arg(int argc, char **argv, int &i) {
|
|
|
|
arg_called = 1;
|
|
|
|
const char *s = argv[i];
|
|
|
|
|
2020-07-01 19:03:10 +03:00
|
|
|
if (!s) {i++; return 1;} // something removed by calling program?
|
1998-10-06 22:21:25 +04:00
|
|
|
|
|
|
|
// a word that does not start with '-', or a word after a '--', or
|
|
|
|
// the word '-' by itself all start the "non-switch arguments" to
|
|
|
|
// a program. Return 0 to indicate that we don't understand the
|
|
|
|
// word, but set a flag (return_i) so that args() will return at
|
|
|
|
// that point:
|
1998-10-20 00:46:58 +04:00
|
|
|
if (s[0] != '-' || s[1] == '-' || !s[1]) {return_i = 1; return 0;}
|
1998-10-06 22:21:25 +04:00
|
|
|
s++; // point after the dash
|
|
|
|
|
2002-08-09 07:17:30 +04:00
|
|
|
if (fl_match(s, "iconic")) {
|
2023-11-17 18:55:37 +03:00
|
|
|
Fl_Window::show_next_window_iconic(1);
|
1998-10-06 22:21:25 +04:00
|
|
|
i++;
|
|
|
|
return 1;
|
2002-08-09 07:17:30 +04:00
|
|
|
} else if (fl_match(s, "kbd")) {
|
2001-11-03 22:24:22 +03:00
|
|
|
Fl::visible_focus(1);
|
|
|
|
i++;
|
|
|
|
return 1;
|
2002-08-09 07:17:30 +04:00
|
|
|
} else if (fl_match(s, "nokbd", 3)) {
|
2001-11-03 22:24:22 +03:00
|
|
|
Fl::visible_focus(0);
|
|
|
|
i++;
|
|
|
|
return 1;
|
2002-08-09 07:17:30 +04:00
|
|
|
} else if (fl_match(s, "dnd", 2)) {
|
2002-04-14 02:17:46 +04:00
|
|
|
Fl::dnd_text_ops(1);
|
|
|
|
i++;
|
|
|
|
return 1;
|
2002-08-09 07:17:30 +04:00
|
|
|
} else if (fl_match(s, "nodnd", 3)) {
|
2002-04-14 02:17:46 +04:00
|
|
|
Fl::dnd_text_ops(0);
|
|
|
|
i++;
|
|
|
|
return 1;
|
2002-08-09 07:17:30 +04:00
|
|
|
} else if (fl_match(s, "tooltips", 2)) {
|
2002-04-14 06:43:48 +04:00
|
|
|
Fl_Tooltip::enable();
|
|
|
|
i++;
|
|
|
|
return 1;
|
2002-08-09 07:17:30 +04:00
|
|
|
} else if (fl_match(s, "notooltips", 3)) {
|
2002-04-14 06:43:48 +04:00
|
|
|
Fl_Tooltip::disable();
|
|
|
|
i++;
|
|
|
|
return 1;
|
2016-04-01 13:28:03 +03:00
|
|
|
} else if (Fl::system_driver()->single_arg(s)) {
|
2002-10-28 22:43:24 +03:00
|
|
|
i++;
|
2016-04-03 18:34:31 +03:00
|
|
|
return 1;
|
2016-02-02 02:39:07 +03:00
|
|
|
}
|
1998-10-06 22:21:25 +04:00
|
|
|
|
|
|
|
const char *v = argv[i+1];
|
|
|
|
if (i >= argc-1 || !v)
|
2020-07-01 19:03:10 +03:00
|
|
|
return 0; // all the rest need an argument, so if missing it is an error
|
1998-10-06 22:21:25 +04:00
|
|
|
|
2002-08-09 07:17:30 +04:00
|
|
|
if (fl_match(s, "geometry")) {
|
1998-10-06 22:21:25 +04:00
|
|
|
|
|
|
|
int flags, gx, gy; unsigned int gw, gh;
|
2022-11-07 08:49:40 +03:00
|
|
|
flags = Fl::screen_driver()->XParseGeometry(v, &gx, &gy, &gw, &gh);
|
1998-10-06 22:21:25 +04:00
|
|
|
if (!flags) return 0;
|
|
|
|
geometry = v;
|
|
|
|
|
2002-08-09 07:17:30 +04:00
|
|
|
} else if (fl_match(s, "display", 2)) {
|
2022-10-23 13:19:44 +03:00
|
|
|
Fl::screen_driver()->display(v);
|
1998-10-06 22:21:25 +04:00
|
|
|
|
2016-04-01 13:28:03 +03:00
|
|
|
} else if (Fl::system_driver()->arg_and_value(s, v)) {
|
2016-02-02 02:39:07 +03:00
|
|
|
// nothing to do
|
|
|
|
|
2002-08-09 07:17:30 +04:00
|
|
|
} else if (fl_match(s, "title", 2)) {
|
1998-10-06 22:21:25 +04:00
|
|
|
title = v;
|
|
|
|
|
2002-08-09 07:17:30 +04:00
|
|
|
} else if (fl_match(s, "name", 2)) {
|
1998-10-06 22:21:25 +04:00
|
|
|
name = v;
|
|
|
|
|
2002-08-09 07:17:30 +04:00
|
|
|
} else if (fl_match(s, "bg2", 3) || fl_match(s, "background2", 11)) {
|
1998-12-02 19:00:48 +03:00
|
|
|
fl_bg2 = v;
|
1998-10-06 22:21:25 +04:00
|
|
|
|
2002-08-09 07:17:30 +04:00
|
|
|
} else if (fl_match(s, "bg", 2) || fl_match(s, "background", 10)) {
|
1998-12-02 19:00:48 +03:00
|
|
|
fl_bg = v;
|
1998-10-06 22:21:25 +04:00
|
|
|
|
2002-08-09 07:17:30 +04:00
|
|
|
} else if (fl_match(s, "fg", 2) || fl_match(s, "foreground", 10)) {
|
1998-12-02 19:00:48 +03:00
|
|
|
fl_fg = v;
|
1998-10-06 22:21:25 +04:00
|
|
|
|
2002-08-09 07:17:30 +04:00
|
|
|
} else if (fl_match(s, "scheme", 1)) {
|
2001-12-20 17:41:44 +03:00
|
|
|
Fl::scheme(v);
|
|
|
|
|
2016-03-28 12:25:11 +03:00
|
|
|
} else {
|
|
|
|
return 0; // unrecognized
|
|
|
|
}
|
1998-10-06 22:21:25 +04:00
|
|
|
|
|
|
|
i += 2;
|
|
|
|
return 2;
|
|
|
|
}
|
|
|
|
|
2008-09-14 02:33:03 +04:00
|
|
|
|
2010-10-23 20:34:22 +04:00
|
|
|
/**
|
|
|
|
Parse command line switches using the \p cb argument handler.
|
2020-07-01 19:03:10 +03:00
|
|
|
|
2010-10-24 16:53:53 +04:00
|
|
|
Returns 0 on error, or the number of words processed.
|
2020-07-01 19:03:10 +03:00
|
|
|
|
2010-10-23 20:34:22 +04:00
|
|
|
FLTK provides this as an <i>entirely optional</i> command line
|
|
|
|
switch parser. You don't have to call it if you don't want to.
|
2010-10-24 16:53:53 +04:00
|
|
|
Everything it can do can be done with other calls to FLTK.
|
2020-07-01 19:03:10 +03:00
|
|
|
|
2010-10-23 20:34:22 +04:00
|
|
|
To use the switch parser, call Fl::args(...) near the start
|
|
|
|
of your program. This does \b not open the display, instead
|
|
|
|
switches that need the display open are stashed into static
|
|
|
|
variables. Then you \b must display your first window by calling
|
|
|
|
<tt>window->show(argc,argv)</tt>, which will do anything stored
|
|
|
|
in the static variables.
|
2020-07-01 19:03:10 +03:00
|
|
|
|
2010-10-24 16:53:53 +04:00
|
|
|
Providing an argument handler callback \p cb lets you define
|
|
|
|
your own switches. It is called with the same \p argc and \p argv,
|
|
|
|
and with \p i set to the index of the switch to be processed.
|
|
|
|
The \p cb handler should return zero if the switch is unrecognized,
|
|
|
|
and not change \p i. It should return non-zero to indicate the
|
|
|
|
number of words processed if the switch is recognized, i.e. 1 for
|
|
|
|
just the switch, and more than 1 for the switch plus associated
|
|
|
|
parameters. \p i should be incremented by the same amount.
|
2020-07-01 19:03:10 +03:00
|
|
|
|
2010-10-24 16:53:53 +04:00
|
|
|
The \p cb handler is called \b before any other tests, so
|
2010-10-23 20:34:22 +04:00
|
|
|
<i>you can also override any standard FLTK switch</i>
|
|
|
|
(this is why FLTK can use very short switches instead of
|
2008-09-14 02:33:03 +04:00
|
|
|
the long ones all other toolkits force you to use).
|
2010-10-24 16:53:53 +04:00
|
|
|
See Fl::arg() for descriptions of the standard switches.
|
2020-07-01 19:03:10 +03:00
|
|
|
|
2010-10-23 20:34:22 +04:00
|
|
|
On return \p i is set to the index of the first non-switch.
|
2008-09-14 02:33:03 +04:00
|
|
|
This is either:
|
2020-07-01 19:03:10 +03:00
|
|
|
|
2010-10-24 16:53:53 +04:00
|
|
|
\li The first word that does not start with '-'.
|
|
|
|
\li The word '-' (used by many programs to name stdin as a file)
|
|
|
|
\li The first unrecognized switch (return value is 0).
|
|
|
|
\li \p argc
|
2020-07-01 19:03:10 +03:00
|
|
|
|
2010-10-23 20:34:22 +04:00
|
|
|
The return value is \p i unless an unrecognized switch is found,
|
2010-10-24 16:53:53 +04:00
|
|
|
in which case it is zero. If your program takes no arguments other
|
2008-09-14 02:33:03 +04:00
|
|
|
than switches you should produce an error if the return value is less
|
2010-10-23 20:34:22 +04:00
|
|
|
than \p argc.
|
2020-07-01 19:03:10 +03:00
|
|
|
|
|
|
|
|
2010-10-23 20:34:22 +04:00
|
|
|
A usage string is displayed if Fl::args() detects an invalid argument
|
|
|
|
on the command-line. You can change the message by setting the
|
2008-09-14 02:33:03 +04:00
|
|
|
Fl::help pointer.
|
2020-07-01 19:03:10 +03:00
|
|
|
|
2010-10-24 16:53:53 +04:00
|
|
|
A very simple command line parser can be found in <tt>examples/howto-parse-args.cxx</tt>
|
2020-07-01 19:03:10 +03:00
|
|
|
|
2010-10-23 20:34:22 +04:00
|
|
|
The simpler Fl::args(int argc, char **argv) form is useful if your program
|
2010-10-24 16:53:53 +04:00
|
|
|
does not have command line switches of its own.
|
2008-09-14 02:33:03 +04:00
|
|
|
*/
|
1998-10-06 22:21:25 +04:00
|
|
|
|
2010-03-25 17:37:46 +03:00
|
|
|
int Fl::args(int argc, char** argv, int& i, Fl_Args_Handler cb) {
|
1998-10-06 22:21:25 +04:00
|
|
|
arg_called = 1;
|
|
|
|
i = 1; // skip argv[0]
|
|
|
|
while (i < argc) {
|
|
|
|
if (cb && cb(argc,argv,i)) continue;
|
|
|
|
if (!arg(argc,argv,i)) return return_i ? i : 0;
|
|
|
|
}
|
|
|
|
return i;
|
|
|
|
}
|
|
|
|
|
|
|
|
// show a main window, use any parsed arguments
|
|
|
|
void Fl_Window::show(int argc, char **argv) {
|
2003-08-02 17:49:17 +04:00
|
|
|
if (argc && !arg_called) Fl::args(argc,argv);
|
|
|
|
|
|
|
|
Fl::get_system_colors();
|
2003-07-29 19:12:36 +04:00
|
|
|
|
2016-03-23 23:42:13 +03:00
|
|
|
pWindowDriver->show_with_args_begin();
|
1998-10-06 22:21:25 +04:00
|
|
|
|
2022-02-22 21:55:11 +03:00
|
|
|
// note: background_pixel is no longer used since 1.4.0, but anyway ...
|
1998-10-06 22:21:25 +04:00
|
|
|
// set colors first, so background_pixel is correct:
|
2022-11-09 03:34:52 +03:00
|
|
|
static char beenhere = 0;
|
1998-10-06 22:21:25 +04:00
|
|
|
if (!beenhere) {
|
|
|
|
if (geometry) {
|
2002-08-09 07:17:30 +04:00
|
|
|
int fl = 0, gx = x(), gy = y(); unsigned int gw = w(), gh = h();
|
2022-11-07 08:49:40 +03:00
|
|
|
fl = Fl::screen_driver()->XParseGeometry(geometry, &gx, &gy, &gw, &gh);
|
|
|
|
if (fl & Fl_Screen_Driver::fl_XNegative) gx = Fl::w()-w()+gx;
|
|
|
|
if (fl & Fl_Screen_Driver::fl_YNegative) gy = Fl::h()-h()+gy;
|
1998-10-06 22:21:25 +04:00
|
|
|
// int mw,mh; minsize(mw,mh);
|
|
|
|
// if (mw > gw) gw = mw;
|
|
|
|
// if (mh > gh) gh = mh;
|
|
|
|
Fl_Widget *r = resizable();
|
|
|
|
if (!r) resizable(this);
|
2018-02-09 17:39:42 +03:00
|
|
|
// for Windows we assume window is not mapped yet:
|
2022-11-07 08:49:40 +03:00
|
|
|
if (fl & (Fl_Screen_Driver::fl_XValue | Fl_Screen_Driver::fl_YValue))
|
2020-07-01 19:03:10 +03:00
|
|
|
x(-1), resize(gx,gy,gw,gh);
|
1998-10-06 22:21:25 +04:00
|
|
|
else
|
2020-07-01 19:03:10 +03:00
|
|
|
size(gw,gh);
|
1998-10-06 22:21:25 +04:00
|
|
|
resizable(r);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2001-03-20 21:02:52 +03:00
|
|
|
// set the class, which is used by X version of get_system_colors:
|
1998-10-06 22:21:25 +04:00
|
|
|
if (name) {xclass(name); name = 0;}
|
2002-03-26 00:08:42 +03:00
|
|
|
else if (!xclass()) xclass(fl_filename_name(argv[0]));
|
2001-03-20 21:02:52 +03:00
|
|
|
|
1998-10-06 22:21:25 +04:00
|
|
|
if (title) {label(title); title = 0;}
|
|
|
|
else if (!label()) label(xclass());
|
|
|
|
|
2001-03-20 21:02:52 +03:00
|
|
|
if (!beenhere) {
|
|
|
|
beenhere = 1;
|
2001-12-20 17:41:44 +03:00
|
|
|
Fl::scheme(Fl::scheme()); // opens display! May call Fl::fatal()
|
2001-03-20 21:02:52 +03:00
|
|
|
}
|
|
|
|
|
2005-05-26 18:03:44 +04:00
|
|
|
// Show the window AFTER we have set the colors and scheme.
|
|
|
|
show();
|
|
|
|
|
2016-03-23 23:42:13 +03:00
|
|
|
pWindowDriver->show_with_args_end(argc, argv);
|
1998-10-06 22:21:25 +04:00
|
|
|
}
|
|
|
|
|
|
|
|
// Calls useful for simple demo programs, with automatic help message:
|
|
|
|
|
|
|
|
static const char * const helpmsg =
|
|
|
|
"options are:\n"
|
2001-12-20 17:41:44 +03:00
|
|
|
" -bg2 color\n"
|
|
|
|
" -bg color\n"
|
2002-04-14 06:43:48 +04:00
|
|
|
" -di[splay] host:n.n\n"
|
|
|
|
" -dn[d]\n"
|
2001-12-20 17:41:44 +03:00
|
|
|
" -fg color\n"
|
1998-12-02 19:00:48 +03:00
|
|
|
" -g[eometry] WxH+X+Y\n"
|
|
|
|
" -i[conic]\n"
|
2001-12-20 17:41:44 +03:00
|
|
|
" -k[bd]\n"
|
2002-04-14 06:43:48 +04:00
|
|
|
" -na[me] classname\n"
|
|
|
|
" -nod[nd]\n"
|
2001-12-20 17:41:44 +03:00
|
|
|
" -nok[bd]\n"
|
2002-04-14 06:43:48 +04:00
|
|
|
" -not[ooltips]\n"
|
2001-12-20 17:41:44 +03:00
|
|
|
" -s[cheme] scheme\n"
|
2002-04-14 16:51:56 +04:00
|
|
|
" -ti[tle] windowtitle\n"
|
2002-04-14 06:43:48 +04:00
|
|
|
" -to[oltips]";
|
1998-10-06 22:21:25 +04:00
|
|
|
|
|
|
|
const char * const Fl::help = helpmsg+13;
|
2010-10-23 20:34:22 +04:00
|
|
|
|
|
|
|
/**
|
2010-10-24 16:53:53 +04:00
|
|
|
Parse all command line switches matching standard FLTK options only.
|
2020-07-01 19:03:10 +03:00
|
|
|
|
2010-10-24 16:53:53 +04:00
|
|
|
It parses all the switches, and if any are not recognized it calls
|
|
|
|
Fl::abort(Fl::help), i.e. unlike the long form, an unrecognized
|
|
|
|
switch generates an error message and causes the program to exit.
|
2020-07-01 19:03:10 +03:00
|
|
|
|
2010-10-23 20:34:22 +04:00
|
|
|
*/
|
1998-10-06 22:21:25 +04:00
|
|
|
void Fl::args(int argc, char **argv) {
|
|
|
|
int i; if (Fl::args(argc,argv,i) < argc) Fl::error(helpmsg);
|
|
|
|
}
|