[gtkmm-documentation] Added missing files.



commit 202ce7b88c979386ff002ee09fa1d84263ef537e
Author: Murray Cumming <murrayc murrayc com>
Date:   Mon Mar 7 12:22:51 2011 +0100

    Added missing files.

 examples/book/application/exampleoptiongroup.cc |   42 +++++++++++++++++++++++
 examples/book/application/exampleoptiongroup.h  |   33 ++++++++++++++++++
 2 files changed, 75 insertions(+), 0 deletions(-)
---
diff --git a/examples/book/application/exampleoptiongroup.cc b/examples/book/application/exampleoptiongroup.cc
new file mode 100644
index 0000000..a3e1fdc
--- /dev/null
+++ b/examples/book/application/exampleoptiongroup.cc
@@ -0,0 +1,42 @@
+/* gtkmm example Copyright (C) 2011 gtkmm development team
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2
+ * as published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+#include "exampleoptiongroup.h"
+#include <iostream>
+
+ExampleOptionGroup::ExampleOptionGroup()
+: Glib::OptionGroup("example_group", "description of example group", "help description of example group"),
+  m_arg_foo(0)
+{
+  //These are just two pointless command-line arguments to show the use 
+  //of the API:
+  Glib::OptionEntry entry1;
+  entry1.set_long_name("foo");
+  entry1.set_short_name('f');
+  entry1.set_description("Enable foo.");
+  add_entry(entry1, m_arg_foo);
+      
+  Glib::OptionEntry entry2;
+  entry2.set_long_name("goo");
+  entry2.set_short_name('g');
+  entry2.set_description("The name of goo to use.");
+  add_entry_filename(entry2, m_arg_goo);
+}
+
+void ExampleOptionGroup::on_error(Glib::OptionContext& /* context */, Glib::OptionGroup& /* group */)
+{
+  std::cout << "on_error called" << std::endl;
+}
diff --git a/examples/book/application/exampleoptiongroup.h b/examples/book/application/exampleoptiongroup.h
new file mode 100644
index 0000000..d275ad4
--- /dev/null
+++ b/examples/book/application/exampleoptiongroup.h
@@ -0,0 +1,33 @@
+/* gtkmm example Copyright (C) 2011 gtkmm development team
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2
+ * as published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+#ifndef GTKMM_EXAMPLEOPTIONGROUP_H
+#define GTKMM_EXAMPLEOPTIONGROUP_H
+
+#include <gtkmm.h>
+
+class ExampleOptionGroup : public Glib::OptionGroup
+{ 
+public:
+  ExampleOptionGroup();
+
+  virtual void on_error(Glib::OptionContext& context, Glib::OptionGroup& group);
+
+  bool m_arg_foo;
+  std::string m_arg_goo;
+};
+
+#endif /* GTKMM_EXAMPLEOPTIONGROUP_H */



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]