[gtkmm/vector] Make tests and demos compilable.



commit a6b9c0eb2a8bea40766a858b4d24633ed4562d1f
Author: Krzesimir Nowak <qdlacz gmail com>
Date:   Sun Jan 23 22:41:48 2011 +0100

    Make tests and demos compilable.

 demos/gtk-demo/example_change_display.cc |    2 +-
 demos/gtk-demo/example_textview.cc       |   16 ++++++++++++----
 tests/refcount_dialog/main.cc            |    6 +++---
 3 files changed, 16 insertions(+), 8 deletions(-)
---
diff --git a/demos/gtk-demo/example_change_display.cc b/demos/gtk-demo/example_change_display.cc
index 40bd742..b212e02 100644
--- a/demos/gtk-demo/example_change_display.cc
+++ b/demos/gtk-demo/example_change_display.cc
@@ -213,7 +213,7 @@ void Example_ChangeDisplay::initialize_displays()
 #ifndef G_OS_WIN32
   Glib::RefPtr<Gdk::DisplayManager> refDisplayManager = Gdk::DisplayManager::get();
 
-  typedef std::list< Glib::RefPtr<Gdk::Display> > type_listDisplays;
+  typedef std::vector< Glib::RefPtr<Gdk::Display> > type_listDisplays;
   type_listDisplays listDisplays = refDisplayManager->list_displays();
 
   for(type_listDisplays::iterator iter = listDisplays.begin(); iter != listDisplays.end(); ++iter)
diff --git a/demos/gtk-demo/example_textview.cc b/demos/gtk-demo/example_textview.cc
index 96c8f60..5dd1a48 100644
--- a/demos/gtk-demo/example_textview.cc
+++ b/demos/gtk-demo/example_textview.cc
@@ -216,9 +216,11 @@ void Example_TextView::insert_text(Glib::RefPtr<Gtk::TextBuffer>& refBuffer)
   iter = refBuffer->insert_with_tag(iter, "a red background", "red_background");
   iter = refBuffer->insert(iter, " or even ");
 
-  typedef const char* type_constpch;
   {
-    type_constpch tag_names[] = {"blue_foreground", "red_background", 0};
+    std::vector<Glib::ustring> tag_names;
+
+    tag_names.push_back ("blue_foreground");
+    tag_names.push_back ("red_background");
     iter = refBuffer->insert_with_tags_by_name(iter, "a blue foreground on red background", tag_names);
   }
 
@@ -250,7 +252,10 @@ void Example_TextView::insert_text(Glib::RefPtr<Gtk::TextBuffer>& refBuffer)
   iter = refBuffer->insert(iter, "You can adjust the amount of space before each line.\n");
 
   {
-    type_constpch tag_names[] = {"big_gap_before_line", "wide_margins", 0};
+    std::vector<Glib::ustring> tag_names;
+
+    tag_names.push_back ("big_gap_before_line");
+    tag_names.push_back ("wide_margins");
     iter = refBuffer->insert_with_tags_by_name(iter,
   					    "This line has a whole lot of space before it.\n", tag_names);
     iter = refBuffer->insert_with_tags_by_name(iter,
@@ -258,7 +263,10 @@ void Example_TextView::insert_text(Glib::RefPtr<Gtk::TextBuffer>& refBuffer)
   }
 
   {
-    type_constpch tag_names[] = {"double_spaced_line", "wide_margins", 0};
+    std::vector<Glib::ustring> tag_names;
+
+    tag_names.push_back ("double_spaced_line");
+    tag_names.push_back ("wide_margins");
     iter = refBuffer->insert_with_tags_by_name(iter,
   					    "You can also adjust the amount of space between wrapped lines; this line has extra space between each wrapped line in the same paragraph. To show off wrapping, some filler text: the quick brown fox jumped over the lazy dog. Blah blah blah blah blah blah blah blah blah.\n",
   					    tag_names);
diff --git a/tests/refcount_dialog/main.cc b/tests/refcount_dialog/main.cc
index fab5ce9..410f107 100644
--- a/tests/refcount_dialog/main.cc
+++ b/tests/refcount_dialog/main.cc
@@ -42,9 +42,9 @@ void MyWindow::on_button_clicked()
     std::cout << "After d.run()" << std::endl;
   }
 
-   std::cout << "before list_toplevel" << std::endl;
-  std::list<Gtk::Window*> toplevelwindows = list_toplevels();
-   std::cout << "after list_toplevel" << std::endl;
+  std::cout << "before list_toplevel" << std::endl;
+  std::vector<Gtk::Window*> toplevelwindows = list_toplevels();
+  std::cout << "after list_toplevel" << std::endl;
 
   std::cout << "toplevelwindows.size = " << toplevelwindows.size() << std::endl;
 }



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