[gtkmm] Fix 'make check' after the massive deprecations.



commit 8090b5aa75e6b8c65f8984fbf2ba8045f78b010b
Author: Kjell Ahlstedt <kjell ahlstedt bredband net>
Date:   Wed Jul 3 16:19:06 2013 +0200

    Fix 'make check' after the massive deprecations.
    
    * demos/Makefile.am:
    * demos/gtk-demo/demos.h: Remove example_stockbrowser.cc and
    example_uimanager.cc from the lists of demo files.
    * demos/gtk-demo/example_buttonbox.cc:
    * demos/gtk-demo/example_change_display.cc:
    * demos/gtk-demo/example_dialog.cc:
    * demos/gtk-demo/example_iconview.cc:
    * demos/gtk-demo/example_sizegroup.cc: Replace Gtk::Stock::* by either a
    label or a named icon, as recommended in the gtk+ file gtkstock.h.
    * tests/dialog_deletethis/main.cc: Replace Gtk::Stock::CLOSE by "_Close".
    Call app->hold(). This is necessary because the dialog window is not added
    to the Gtk::Application.
    * tests/property_notification/main.cc: Use the rgba property instead of the
    deprecated color property.

 ChangeLog                                |   19 +++++++++++++++++++
 demos/Makefile.am                        |    5 +++--
 demos/gtk-demo/demos.h                   |    4 ++--
 demos/gtk-demo/example_buttonbox.cc      |    9 ++++++---
 demos/gtk-demo/example_change_display.cc |    6 +++---
 demos/gtk-demo/example_dialog.cc         |    5 +++--
 demos/gtk-demo/example_iconview.cc       |    7 +++++--
 demos/gtk-demo/example_sizegroup.cc      |    2 +-
 tests/dialog_deletethis/main.cc          |    5 +++--
 tests/property_notification/main.cc      |   12 ++++++------
 10 files changed, 51 insertions(+), 23 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index 9152039..99ee1b4 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,22 @@
+2013-07-03  Kjell Ahlstedt  <kjell ahlstedt bredband net>
+
+       Fix 'make check' after the massive deprecations.
+
+       * demos/Makefile.am:
+       * demos/gtk-demo/demos.h: Remove example_stockbrowser.cc and
+       example_uimanager.cc from the lists of demo files.
+       * demos/gtk-demo/example_buttonbox.cc:
+       * demos/gtk-demo/example_change_display.cc:
+       * demos/gtk-demo/example_dialog.cc:
+       * demos/gtk-demo/example_iconview.cc:
+       * demos/gtk-demo/example_sizegroup.cc: Replace Gtk::Stock::* by either a
+       label or a named icon, as recommended in the gtk+ file gtkstock.h.
+       * tests/dialog_deletethis/main.cc: Replace Gtk::Stock::CLOSE by "_Close".
+       Call app->hold(). This is necessary because the dialog window is not added
+       to the Gtk::Application.
+       * tests/property_notification/main.cc: Use the rgba property instead of the
+       deprecated color property.
+
 2013-07-02  Kjell Ahlstedt  <kjell ahlstedt bredband net>
 
        Update gtk/src/filelist.am and gtk/gtkmm/filelist.am.
diff --git a/demos/Makefile.am b/demos/Makefile.am
index 9a7def5..08694da 100644
--- a/demos/Makefile.am
+++ b/demos/Makefile.am
@@ -39,16 +39,17 @@ gtk_demo_gtkmm_demo_SOURCES =                               \
        gtk-demo/example_panes.cc                       \
        gtk-demo/example_pixbufs.cc                     \
        gtk-demo/example_sizegroup.cc                   \
-       gtk-demo/example_stockbrowser.cc                \
        gtk-demo/example_textview.cc                    \
        gtk-demo/example_treeview_editable_cells.cc     \
        gtk-demo/example_treeview_liststore.cc          \
        gtk-demo/example_treeview_treestore.cc          \
-       gtk-demo/example_uimanager.cc                   \
        gtk-demo/main.cc                                \
        gtk-demo/textwidget.cc                          \
        gtk-demo/textwidget.h
 
+## gtk-demo/example_stockbrowser.cc            \
+## gtk-demo/example_uimanager.cc                       \
+
 dist_noinst_DATA =                     \
        gtk-demo/alphatest.png          \
        gtk-demo/apple-red.png          \
diff --git a/demos/gtk-demo/demos.h b/demos/gtk-demo/demos.h
index 095fb47..bbe8154 100644
--- a/demos/gtk-demo/demos.h
+++ b/demos/gtk-demo/demos.h
@@ -64,10 +64,10 @@ Demo testgtk_demos[] =
   { "Paned Widgets", "example_panes.cc", sigc::ptr_fun(&do_panes), 0 },
   { "Pixbufs", "example_pixbufs.cc", sigc::ptr_fun(&do_pixbufs), 0 },
   { "Size Groups", "example_sizegroup.cc", sigc::ptr_fun(&do_sizegroup), 0 },
-  { "Stock Item and Icon Browser", "example_stockbrowser.cc", sigc::ptr_fun(&do_stock_browser), 0 },
+//  { "Stock Item and Icon Browser", "example_stockbrowser.cc", sigc::ptr_fun(&do_stock_browser), 0 },
   { "Text Widget", "example_textview.cc", sigc::ptr_fun(&do_textview), 0 },
   { "Tree View", "", type_slotDo(), child0 },
-  { "UI Manager", "example_uimanager.cc", sigc::ptr_fun(&do_ui_manager), 0},
+//  { "UI Manager", "example_uimanager.cc", sigc::ptr_fun(&do_ui_manager), 0},
   { 0, 0, type_slotDo(), 0 }
 };
 
diff --git a/demos/gtk-demo/example_buttonbox.cc b/demos/gtk-demo/example_buttonbox.cc
index 60aede7..6a1d645 100644
--- a/demos/gtk-demo/example_buttonbox.cc
+++ b/demos/gtk-demo/example_buttonbox.cc
@@ -83,13 +83,16 @@ Gtk::Frame* Example_ButtonBox::create_button_box(bool horizontal, const Glib::us
   pButtonBox->set_layout(layout);
   pButtonBox->set_spacing(spacing);
 
-  Gtk::Button* pButton = Gtk::manage(new Gtk::Button(Gtk::Stock::OK));
+  Gtk::Button* pButton = Gtk::manage(new Gtk::Button("_OK"));
   pButtonBox->add(*pButton);
 
-  pButton = Gtk::manage(new Gtk::Button(Gtk::Stock::CANCEL));
+  pButton = Gtk::manage(new Gtk::Button("_Cancel"));
   pButtonBox->add(*pButton);
 
-  pButton = Gtk::manage(new Gtk::Button(Gtk::Stock::HELP));
+  pButton = Gtk::manage(new Gtk::Button());
+  Gtk::Image* pImage = Gtk::manage(new Gtk::Image());
+  pImage->set_from_icon_name("help-browser", Gtk::ICON_SIZE_BUTTON);
+  pButton->add(*pImage);
   pButtonBox->add(*pButton);
 
   return pFrame;
diff --git a/demos/gtk-demo/example_change_display.cc b/demos/gtk-demo/example_change_display.cc
index c93770c..81c2e7c 100644
--- a/demos/gtk-demo/example_change_display.cc
+++ b/demos/gtk-demo/example_change_display.cc
@@ -107,7 +107,7 @@ Example_ChangeDisplay::Example_ChangeDisplay()
   m_pPopup(0),
   m_popup_clicked(false)
 {
-  add_button(Gtk::Stock::CLOSE, Gtk::RESPONSE_CLOSE);
+  add_button("_Close", Gtk::RESPONSE_CLOSE);
   add_button("Change", Gtk::RESPONSE_OK);
 
   set_default_size(300, 400);
@@ -213,8 +213,8 @@ void Example_ChangeDisplay::on_display_closed(bool /* is_error */, Glib::RefPtr<
 void Example_ChangeDisplay::on_button_display_open()
 {
   Gtk::Dialog dialog("Open Display", true);
-  dialog.add_button(Gtk::Stock::CANCEL, Gtk::RESPONSE_CANCEL);
-  dialog.add_button(Gtk::Stock::OK, Gtk::RESPONSE_OK);
+  dialog.add_button("_Cancel", Gtk::RESPONSE_CANCEL);
+  dialog.add_button("_OK", Gtk::RESPONSE_OK);
 
   dialog.set_default_response(Gtk::RESPONSE_OK);
 
diff --git a/demos/gtk-demo/example_dialog.cc b/demos/gtk-demo/example_dialog.cc
index a406b1f..01eca20 100644
--- a/demos/gtk-demo/example_dialog.cc
+++ b/demos/gtk-demo/example_dialog.cc
@@ -135,9 +135,10 @@ Dialog_Interactive::Dialog_Interactive(Gtk::Window& parent, const Glib::ustring&
 : Gtk::Dialog("Interactive Dialog", parent, true),
   m_HBox(Gtk::ORIENTATION_HORIZONTAL, 8),
   m_Label1("_Entry 1", true), m_Label2("E_ntry 2", true),
-  m_Image(Gtk::Stock::DIALOG_QUESTION, Gtk::ICON_SIZE_DIALOG)
+  m_Image()
 {
-  add_button(Gtk::Stock::OK, Gtk::RESPONSE_OK);
+  m_Image.set_from_icon_name("dialog-question", Gtk::ICON_SIZE_DIALOG);
+  add_button("_OK", Gtk::RESPONSE_OK);
   add_button("_Non-stock Button", Gtk::RESPONSE_CANCEL);
 
   m_HBox.set_border_width(8);
diff --git a/demos/gtk-demo/example_iconview.cc b/demos/gtk-demo/example_iconview.cc
index f04fcac..007b055 100644
--- a/demos/gtk-demo/example_iconview.cc
+++ b/demos/gtk-demo/example_iconview.cc
@@ -62,9 +62,12 @@ Gtk::Window* do_iconview()
 
 Example_IconView::Example_IconView()
 : m_VBox(Gtk::ORIENTATION_VERTICAL),
-  m_ButtonUp(Gtk::Stock::GO_UP),
-  m_ButtonHome(Gtk::Stock::HOME)
+  m_ButtonUp(),
+  m_ButtonHome()
 {
+  m_ButtonUp.set_icon_name("go-up");
+  m_ButtonHome.set_icon_name("go-home");
+
   set_title("Icon View");
   set_default_size(650, 400);
   
diff --git a/demos/gtk-demo/example_sizegroup.cc b/demos/gtk-demo/example_sizegroup.cc
index 2522e88..7c88168 100644
--- a/demos/gtk-demo/example_sizegroup.cc
+++ b/demos/gtk-demo/example_sizegroup.cc
@@ -56,7 +56,7 @@ Example_SizeGroup::Example_SizeGroup()
   m_CheckButton("_Enable grouping", true)
 {
   set_resizable(false);
-  add_button(Gtk::Stock::CLOSE, Gtk::RESPONSE_CLOSE);
+  add_button("_Close", Gtk::RESPONSE_CLOSE);
 
   get_content_area()->pack_start(m_VBox);
   m_VBox.set_border_width(5);
diff --git a/tests/dialog_deletethis/main.cc b/tests/dialog_deletethis/main.cc
index 6cd92e9..344ab92 100644
--- a/tests/dialog_deletethis/main.cc
+++ b/tests/dialog_deletethis/main.cc
@@ -13,7 +13,7 @@ class Dlg : public sigc::trackable
       Gtk::Button *btn = manage(new Gtk::Button("ClickMe"));
       btn->signal_clicked().connect(sigc::mem_fun(*this, &Dlg::on_button_clicked));
       dlg_->get_content_area()->pack_start(*btn);
-      dlg_->add_button(Gtk::Stock::OK, 0);
+      dlg_->add_button("_OK", Gtk::RESPONSE_OK);
       dlg_->signal_response().connect(sigc::mem_fun(*this, &Dlg::on_response));
       dlg_->show_all();
     }
@@ -30,7 +30,7 @@ class Dlg : public sigc::trackable
 
     void on_response(int id)
    {
-      if (id == 0)
+      if (id == Gtk::RESPONSE_OK || id == Gtk::RESPONSE_DELETE_EVENT)
         quit();
     }
 
@@ -49,6 +49,7 @@ int main (int argc, char **argv)
 
   new Dlg(); //Not a Gtk::Dialog - it creates one in its constructor.
 
+  app->hold();
   return app->run();
 }
 
diff --git a/tests/property_notification/main.cc b/tests/property_notification/main.cc
index 8190d67..1b4988b 100644
--- a/tests/property_notification/main.cc
+++ b/tests/property_notification/main.cc
@@ -1,14 +1,14 @@
 #include <gtkmm.h>
 #include <iostream>
 
-void on_property_color_changed()
+void on_property_rgba_changed()
 {
-  std::cout << "color property changed" << std::endl;
+  std::cout << "rgba property changed" << std::endl;
 }
 
-void on_property_color_changed_nicer_api()
+void on_property_rgba_changed_nicer_api()
 {
-  std::cout << "color property changed (nicer API)" << std::endl;
+  std::cout << "rgba property changed (nicer API)" << std::endl;
 }
 
 void on_property_name_changed()
@@ -27,9 +27,9 @@ int main (int argc, char **argv)
   Gtk::ColorButton button;
   button.show();
 
-  button.connect_property_changed("color", sigc::ptr_fun(&on_property_color_changed));
+  button.connect_property_changed("rgba", sigc::ptr_fun(&on_property_rgba_changed));
 
-  button.property_color().signal_changed().connect(sigc::ptr_fun(&on_property_color_changed_nicer_api));
+  button.property_rgba().signal_changed().connect(sigc::ptr_fun(&on_property_rgba_changed_nicer_api));
 
   button.connect_property_changed("name", sigc::ptr_fun(&on_property_name_changed));
 


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