[gtkmm] Application: Added run() with no parameters.
- From: Murray Cumming <murrayc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtkmm] Application: Added run() with no parameters.
- Date: Fri, 21 Jan 2011 13:37:18 +0000 (UTC)
commit 1ddc38abbb9a032c3c91d030183721d820f228db
Author: Murray Cumming <murrayc murrayc com>
Date: Fri Jan 21 14:36:40 2011 +0100
Application: Added run() with no parameters.
* gtk/src/application.[hg|ccg]: Add a run() that takes no argc, argv
parameters, though see my TODO comments.
ChangeLog | 7 +++++++
gtk/src/application.ccg | 10 ++++++++++
gtk/src/application.hg | 22 +++++++++++++++++++---
3 files changed, 36 insertions(+), 3 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index 37ecdb0..91fecd3 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2011-01-21 Murray Cumming <murrayc murrayc com>
+
+ Application: Added run() with no parameters.
+
+ * gtk/src/application.[hg|ccg]: Add a run() that takes no argc, argv
+ parameters, though see my TODO comments.
+
2011-01-20 Murray Cumming <murrayc murrayc com>
Gtk::Application: Let run(window) actually return.
diff --git a/gtk/src/application.ccg b/gtk/src/application.ccg
index 962d210..d8273d7 100644
--- a/gtk/src/application.ccg
+++ b/gtk/src/application.ccg
@@ -156,5 +156,15 @@ int Application::run(Window& window)
return result;
}
+int Application::run()
+{
+ g_assert(m_argc);
+ g_assert(m_argv);
+
+ const int result = Gio::Application::run(m_argc, m_argv);
+ init_gtkmm_internals();
+ return result;
+}
+
} // namespace Gtk
diff --git a/gtk/src/application.hg b/gtk/src/application.hg
index 2e9131d..b8caba0 100644
--- a/gtk/src/application.hg
+++ b/gtk/src/application.hg
@@ -106,7 +106,7 @@ public:
* It is an error to call this function if @a application is a proxy for
* a remote application.
*
- * @newin{2,28}
+ * @newin{3,0}
*/
int run(int argc, char** argv);
@@ -120,10 +120,12 @@ public:
*
* @param window The window to show. This method will return when the window is hidden.
*
- * @newin{2,28}
+ * @newin{3,0}
*/
int run(Window& window, int argc, char** argv);
+ //TODO: If argc and argv are necessary at all, document the need to call that constructor first.
+ //See https://bugzilla.gnome.org/show_bug.cgi?id=639925#c4
/** Starts the application.
*
* The default implementation of this virtual function will simply run
@@ -134,9 +136,23 @@ public:
*
* @param window The window to show. This method will return when the window is hidden.
*
- * @newin{2,28}
+ * @newin{3,0}
*/
int run(Window& window);
+
+ //TODO: If argc and argv are necessary at all, document the need to call that constructor first.
+ //See https://bugzilla.gnome.org/show_bug.cgi?id=639925#c4
+ /** Starts the application.
+ *
+ * The default implementation of this virtual function will simply run
+ * a main loop.
+ *
+ * It is an error to call this function if @a application is a proxy for
+ * a remote application.
+ *
+ * @newin{3,0}
+ */
+ int run();
private:
/** This is just a way to call Glib::init() (which calls g_type_init()) before
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]