diff options
author | Murray Cumming <murrayc@murrayc.com> | 2007-02-10 19:07:04 +0000 |
---|---|---|
committer | Murray Cumming <murrayc@src.gnome.org> | 2007-02-10 19:07:04 +0000 |
commit | 228c886f2774a4b84c76291605ccc7a4bd812e1e (patch) | |
tree | 5cfd1db2bb08350bd83fd8fdb88f36c54134cc77 /examples/options | |
parent | 058cc62ae0b04ba887d6c2babe38caa46c9107af (diff) | |
download | glibmm-228c886f2774a4b84c76291605ccc7a4bd812e1e.tar.gz |
Use a default value, to show that it can be done. (This change, from
2007-02-10 Murray Cumming <murrayc@murrayc.com>
* examples/options/main.cc: Use a default value, to show that it
can be done.
(This change, from 2006-03-30 was restored after being accidentally lost on Apr 12 2006)
2007-02-10 Armin Burgmeier <armin@arbur.net>
* glib/src/optiongroup.ccg: default_c_arg(): Set the initial
value of the C argument to the value the C++ argument has, to avoid
that glibmm resets arguments to zero that were not given on the
command line.
(This change, from 2006-03-30 was restored after being accidentally lost on Apr 12 2006)
svn path=/trunk/; revision=378
Diffstat (limited to 'examples/options')
-rw-r--r-- | examples/options/main.cc | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/examples/options/main.cc b/examples/options/main.cc index 2fa85376..cdc097e2 100644 --- a/examples/options/main.cc +++ b/examples/options/main.cc @@ -58,6 +58,7 @@ ExampleOptionGroup::ExampleOptionGroup() entry3.set_long_name("goo"); entry3.set_short_name('g'); entry3.set_description("The Goo"); + m_arg_goo = "default-goo-value"; //We can choose a default to be used if the user doesn't specify this option. add_entry(entry3, m_arg_goo); Glib::OptionEntry entry4; @@ -75,12 +76,16 @@ ExampleOptionGroup::ExampleOptionGroup() bool ExampleOptionGroup::on_pre_parse(Glib::OptionContext& context, Glib::OptionGroup& group) { //This is called before the m_arg_* instances are given their values. + // You do not need to override this method. This is just here to show you how, + // in case you want to do any extra processing. return Glib::OptionGroup::on_pre_parse(context, group); } bool ExampleOptionGroup::on_post_parse(Glib::OptionContext& context, Glib::OptionGroup& group) { //This is called after the m_arg_* instances are given their values. + // You do not need to override this method. This is just here to show you how, + // in case you want to do any extra processing. return Glib::OptionGroup::on_post_parse(context, group); } |