[goocanvasmm] Examples/Tests: Use Gtk::Application instead of Gtk::Main.



commit 76776856ee6f850fcc00c35adcbc7e971abc72e7
Author: Murray Cumming <murrayc murrayc com>
Date:   Wed Jul 29 14:26:59 2015 +0200

    Examples/Tests: Use Gtk::Application instead of Gtk::Main.
    
    Because Gtk::Main is deprecated in gtkmm.

 examples/coordinates/main.cc    |    6 ++----
 examples/custom_item/main.cc    |    4 ++--
 examples/demo/main.cc           |    5 ++---
 examples/drag_to_canvas/main.cc |    4 ++--
 examples/moving_shapes/main.cc  |    4 ++--
 examples/simple/main.cc         |    4 ++--
 examples/table/main.cc          |    6 ++----
 examples/tablemodel/main.cc     |    4 ++--
 examples/text/main.cc           |    6 ++----
 tests/child_properties/main.cc  |    3 +--
 10 files changed, 19 insertions(+), 27 deletions(-)
---
diff --git a/examples/coordinates/main.cc b/examples/coordinates/main.cc
index 869e86d..be6b6ca 100644
--- a/examples/coordinates/main.cc
+++ b/examples/coordinates/main.cc
@@ -19,13 +19,11 @@
 
 int main(int argc, char* argv[])
 {
-  Gtk::Main app(&argc, &argv);
+  auto app = Gtk::Application::create(argc, argv);
   Goocanvas::init();
 
   ExampleWindow win;
-  Gtk::Main::run(win);
-
-  return 0;
+  return app->run(win);
 }
 
 
diff --git a/examples/custom_item/main.cc b/examples/custom_item/main.cc
index 5988746..b86ff5c 100644
--- a/examples/custom_item/main.cc
+++ b/examples/custom_item/main.cc
@@ -21,11 +21,11 @@
 int
 main(int argc, char* argv[])
 {
-  Gtk::Main app(&argc, &argv);
+  auto app = Gtk::Application::create(argc, argv);
   Goocanvas::init();
 
   ExampleWindow sw ;
-  Gtk::Main::run(sw);
+  return app->run(sw);
 }
 
 
diff --git a/examples/demo/main.cc b/examples/demo/main.cc
index 81b2bfd..b1323fe 100644
--- a/examples/demo/main.cc
+++ b/examples/demo/main.cc
@@ -22,11 +22,10 @@
 int
 main(int argc, char* argv[])
 {
-
-  Gtk::Main app(&argc, &argv);
+  auto app = Gtk::Application::create(argc, argv);
   Goocanvas::init();
 
   DemoWindow sw ;
-  Gtk::Main::run(sw);
+  return app->run(sw);
 }
 
diff --git a/examples/drag_to_canvas/main.cc b/examples/drag_to_canvas/main.cc
index 5988746..b86ff5c 100644
--- a/examples/drag_to_canvas/main.cc
+++ b/examples/drag_to_canvas/main.cc
@@ -21,11 +21,11 @@
 int
 main(int argc, char* argv[])
 {
-  Gtk::Main app(&argc, &argv);
+  auto app = Gtk::Application::create(argc, argv);
   Goocanvas::init();
 
   ExampleWindow sw ;
-  Gtk::Main::run(sw);
+  return app->run(sw);
 }
 
 
diff --git a/examples/moving_shapes/main.cc b/examples/moving_shapes/main.cc
index 8949b70..6012ebf 100644
--- a/examples/moving_shapes/main.cc
+++ b/examples/moving_shapes/main.cc
@@ -20,11 +20,11 @@
 int
 main(int argc, char* argv[])
 {
-  Gtk::Main app(&argc, &argv);
+  auto app = Gtk::Application::create(argc, argv);
   Goocanvas::init();
 
   Window w ;
-  Gtk::Main::run(w);
+  return app->run(w);
 }
 
 
diff --git a/examples/simple/main.cc b/examples/simple/main.cc
index 5988746..b86ff5c 100644
--- a/examples/simple/main.cc
+++ b/examples/simple/main.cc
@@ -21,11 +21,11 @@
 int
 main(int argc, char* argv[])
 {
-  Gtk::Main app(&argc, &argv);
+  auto app = Gtk::Application::create(argc, argv);
   Goocanvas::init();
 
   ExampleWindow sw ;
-  Gtk::Main::run(sw);
+  return app->run(sw);
 }
 
 
diff --git a/examples/table/main.cc b/examples/table/main.cc
index c4c8102..a2969d4 100644
--- a/examples/table/main.cc
+++ b/examples/table/main.cc
@@ -21,13 +21,11 @@
 int
 main(int argc, char* argv[])
 {
-  Gtk::Main app(&argc, &argv);
+  auto app = Gtk::Application::create(argc, argv);
   Goocanvas::init();
 
   ExampleWindow sw;
-  Gtk::Main::run(sw);
-
-  return 0;
+  return app->run(sw);
 }
 
 
diff --git a/examples/tablemodel/main.cc b/examples/tablemodel/main.cc
index 5988746..b86ff5c 100644
--- a/examples/tablemodel/main.cc
+++ b/examples/tablemodel/main.cc
@@ -21,11 +21,11 @@
 int
 main(int argc, char* argv[])
 {
-  Gtk::Main app(&argc, &argv);
+  auto app = Gtk::Application::create(argc, argv);
   Goocanvas::init();
 
   ExampleWindow sw ;
-  Gtk::Main::run(sw);
+  return app->run(sw);
 }
 
 
diff --git a/examples/text/main.cc b/examples/text/main.cc
index 869e86d..be6b6ca 100644
--- a/examples/text/main.cc
+++ b/examples/text/main.cc
@@ -19,13 +19,11 @@
 
 int main(int argc, char* argv[])
 {
-  Gtk::Main app(&argc, &argv);
+  auto app = Gtk::Application::create(argc, argv);
   Goocanvas::init();
 
   ExampleWindow win;
-  Gtk::Main::run(win);
-
-  return 0;
+  return app->run(win);
 }
 
 
diff --git a/tests/child_properties/main.cc b/tests/child_properties/main.cc
index 45d7a5c..3180421 100644
--- a/tests/child_properties/main.cc
+++ b/tests/child_properties/main.cc
@@ -20,9 +20,8 @@
 #include <iostream>
 
 int
-main(int argc, char* argv[])
+main()
 {
-  Gtk::Main app(&argc, &argv);
   Goocanvas::init();
 
   auto table = Goocanvas::Table::create();


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