[gtkmm-documentation] Correct use of recently-deprecated API.



commit 9739f52eee4ffe96afa275e5e846fca8b202f180
Author: Murray Cumming <murrayc murrayc com>
Date:   Thu Mar 18 10:52:50 2010 +0100

    Correct use of recently-deprecated API.
    
    * examples/book/buttons/radiobutton/radiobuttons.cc:
    * examples/book/custom/custom_container/mycontainer.cc:
    * examples/book/custom/custom_widget/mywidget.cc:
    * examples/book/entry/completion/examplewindow.cc:
    * examples/book/entry/icon/examplewindow.cc:
    * examples/book/entry/progress/examplewindow.cc:
    * examples/book/entry/simple/examplewindow.cc:
    * examples/book/printing/advanced/previewdialog.cc:
    * examples/book/progressbar/examplewindow.cc:
    * examples/book/range_widgets/examplewindow.cc:
    * examples/book/scrolledwindow/examplewindow.cc:
    * examples/others/calendar/calendar.cc:
    * examples/others/cellrenderercustom/popupentry.cc:
        Replace set_flags(Gtk::NO_WINDOW) with set_has_window(false).
        Replace unset_falgs(Gtk::NO_WINDOW) with set_has_window().
        Replace set_flags(Gtk::CAN_DEFAULT) with set_can_default().
        Replace set_flags(Gtk::CAN_FOCUS) with set_can_focus().
        Replace is_realized() with get_realized().

 ChangeLog                                          |   25 +++++++++++++++++++-
 examples/book/buttons/radiobutton/radiobuttons.cc  |    2 +-
 .../book/custom/custom_container/mycontainer.cc    |    2 +-
 examples/book/custom/custom_widget/mywidget.cc     |    4 +-
 examples/book/entry/completion/examplewindow.cc    |    2 +-
 examples/book/entry/icon/examplewindow.cc          |    2 +-
 examples/book/entry/progress/examplewindow.cc      |    2 +-
 examples/book/entry/simple/examplewindow.cc        |    2 +-
 examples/book/printing/advanced/previewdialog.cc   |    8 +++---
 examples/book/progressbar/examplewindow.cc         |    2 +-
 examples/book/range_widgets/examplewindow.cc       |    2 +-
 examples/book/scrolledwindow/examplewindow.cc      |    2 +-
 examples/others/calendar/calendar.cc               |    2 +-
 examples/others/cellrenderercustom/popupentry.cc   |    2 +-
 14 files changed, 41 insertions(+), 18 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index 64f3831..d30788d 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,6 +1,29 @@
+2010-03-18  Murray Cumming  <murrayc murrayc com>
+
+	Correct use of recently-deprecated API.
+
+	* examples/book/buttons/radiobutton/radiobuttons.cc:
+	* examples/book/custom/custom_container/mycontainer.cc:
+	* examples/book/custom/custom_widget/mywidget.cc:
+	* examples/book/entry/completion/examplewindow.cc:
+	* examples/book/entry/icon/examplewindow.cc:
+	* examples/book/entry/progress/examplewindow.cc:
+	* examples/book/entry/simple/examplewindow.cc:
+	* examples/book/printing/advanced/previewdialog.cc:
+	* examples/book/progressbar/examplewindow.cc:
+	* examples/book/range_widgets/examplewindow.cc:
+	* examples/book/scrolledwindow/examplewindow.cc:
+	* examples/others/calendar/calendar.cc:
+	* examples/others/cellrenderercustom/popupentry.cc:
+    Replace set_flags(Gtk::NO_WINDOW) with set_has_window(false).
+    Replace unset_falgs(Gtk::NO_WINDOW) with set_has_window().
+    Replace set_flags(Gtk::CAN_DEFAULT) with set_can_default().
+    Replace set_flags(Gtk::CAN_FOCUS) with set_can_focus().
+    Replace is_realized() with get_realized().
+
 2010-02-27  Murray Cumming  <murrayc murrayc com>
 
-  Fix a typo in the Mixing C and C++ APIs chapter.
+    Fix a typo in the Mixing C and C++ APIs chapter.
   
 	* docs/tutorial/C/gtkmm-tutorial-in.xml: Mixing C and C++ APIs chapter:
 	Fix a typo.
diff --git a/examples/book/buttons/radiobutton/radiobuttons.cc b/examples/book/buttons/radiobutton/radiobuttons.cc
index f12d8a9..3bf77a4 100644
--- a/examples/book/buttons/radiobutton/radiobuttons.cc
+++ b/examples/book/buttons/radiobutton/radiobuttons.cc
@@ -61,7 +61,7 @@ RadioButtons::RadioButtons() :
   m_Box2.pack_start(m_Button_Close);
 
   // Make the button the default widget
-  m_Button_Close.set_flags(Gtk::CAN_DEFAULT);
+  m_Button_Close.set_can_default();
   m_Button_Close.grab_default();
 
   // Connect the clicked signal of the button to
diff --git a/examples/book/custom/custom_container/mycontainer.cc b/examples/book/custom/custom_container/mycontainer.cc
index e513e56..4a8e461 100644
--- a/examples/book/custom/custom_container/mycontainer.cc
+++ b/examples/book/custom/custom_container/mycontainer.cc
@@ -22,7 +22,7 @@
 MyContainer::MyContainer()
 : m_child_one(0), m_child_two(0)
 {
-  set_flags(Gtk::NO_WINDOW);
+  set_has_window(false);
   set_redraw_on_allocate(false);
 }
 
diff --git a/examples/book/custom/custom_widget/mywidget.cc b/examples/book/custom/custom_widget/mywidget.cc
index ed33347..9025d21 100644
--- a/examples/book/custom/custom_widget/mywidget.cc
+++ b/examples/book/custom/custom_widget/mywidget.cc
@@ -30,7 +30,7 @@ MyWidget::MyWidget() :
   Gtk::Widget(),
   m_scale(1000)
 {
-  set_flags(Gtk::NO_WINDOW);
+  set_has_window(false);
 
   //This shows the GType name, which must be used in the RC file.
   std::cout << "GType name: " << G_OBJECT_TYPE_NAME(gobj()) << std::endl;
@@ -132,7 +132,7 @@ void MyWidget::on_realize()
 
     m_refGdkWindow = Gdk::Window::create(get_window() /* parent */, &attributes,
             GDK_WA_X | GDK_WA_Y);
-    unset_flags(Gtk::NO_WINDOW);
+    set_has_window();
     set_window(m_refGdkWindow);
 
     //set colors
diff --git a/examples/book/entry/completion/examplewindow.cc b/examples/book/entry/completion/examplewindow.cc
index e922e68..b906544 100644
--- a/examples/book/entry/completion/examplewindow.cc
+++ b/examples/book/entry/completion/examplewindow.cc
@@ -34,7 +34,7 @@ ExampleWindow::ExampleWindow() :
   m_Button_Close.signal_clicked().connect( sigc::mem_fun(*this,
               &ExampleWindow::on_button_close) );
   m_VBox.pack_start(m_Button_Close, Gtk::PACK_SHRINK);
-  m_Button_Close.set_flags(Gtk::CAN_DEFAULT);
+  m_Button_Close.set_can_default();
   m_Button_Close.grab_default();
 
   //Add an EntryCompletion:
diff --git a/examples/book/entry/icon/examplewindow.cc b/examples/book/entry/icon/examplewindow.cc
index 5229547..4a8c5f1 100644
--- a/examples/book/entry/icon/examplewindow.cc
+++ b/examples/book/entry/icon/examplewindow.cc
@@ -37,7 +37,7 @@ ExampleWindow::ExampleWindow()
   m_Button_Close.signal_clicked().connect( sigc::mem_fun(*this,
               &ExampleWindow::on_button_close) );
   m_VBox.pack_start(m_Button_Close, Gtk::PACK_SHRINK);
-  m_Button_Close.set_flags(Gtk::CAN_DEFAULT);
+  m_Button_Close.set_can_default();
   m_Button_Close.grab_default();
 
   show_all_children();
diff --git a/examples/book/entry/progress/examplewindow.cc b/examples/book/entry/progress/examplewindow.cc
index 5450262..a3eae19 100644
--- a/examples/book/entry/progress/examplewindow.cc
+++ b/examples/book/entry/progress/examplewindow.cc
@@ -39,7 +39,7 @@ ExampleWindow::ExampleWindow()
   m_Button_Close.signal_clicked().connect( sigc::mem_fun(*this,
               &ExampleWindow::on_button_close) );
   m_VBox.pack_start(m_Button_Close, Gtk::PACK_SHRINK);
-  m_Button_Close.set_flags(Gtk::CAN_DEFAULT);
+  m_Button_Close.set_can_default();
   m_Button_Close.grab_default();
 
   show_all_children();
diff --git a/examples/book/entry/simple/examplewindow.cc b/examples/book/entry/simple/examplewindow.cc
index 9d987c3..ecd683d 100644
--- a/examples/book/entry/simple/examplewindow.cc
+++ b/examples/book/entry/simple/examplewindow.cc
@@ -51,7 +51,7 @@ ExampleWindow::ExampleWindow()
   m_Button_Close.signal_clicked().connect( sigc::mem_fun(*this,
               &ExampleWindow::on_button_close) );
   m_VBox.pack_start(m_Button_Close);
-  m_Button_Close.set_flags(Gtk::CAN_DEFAULT);
+  m_Button_Close.set_can_default();
   m_Button_Close.grab_default();
 
   show_all_children();
diff --git a/examples/book/printing/advanced/previewdialog.cc b/examples/book/printing/advanced/previewdialog.cc
index 027bbdf..eb70916 100644
--- a/examples/book/printing/advanced/previewdialog.cc
+++ b/examples/book/printing/advanced/previewdialog.cc
@@ -122,12 +122,12 @@ void PreviewDialog::on_popreview_got_page_size(
                        const Glib::RefPtr<Gtk::PrintContext>& print_ctx,
                        const Glib::RefPtr<Gtk::PageSetup>& page_setup)
 {
-  Gtk::PaperSize paper_size = page_setup->get_paper_size();
+  const Gtk::PaperSize paper_size = page_setup->get_paper_size();
 
-  double width = paper_size.get_width(Gtk::UNIT_INCH);
-  double height = paper_size.get_height(Gtk::UNIT_INCH);
+  const double width = paper_size.get_width(Gtk::UNIT_INCH);
+  const double height = paper_size.get_height(Gtk::UNIT_INCH);
 
-  if(m_DrawingArea.is_realized()) //Avoid getting an odd allocation.
+  if(m_DrawingArea.get_realized()) //Avoid getting an odd allocation.
   {
     double dpi_x = m_DrawingArea.get_allocation().get_width() / width;
     double dpi_y = m_DrawingArea.get_allocation().get_height() / height;
diff --git a/examples/book/progressbar/examplewindow.cc b/examples/book/progressbar/examplewindow.cc
index 0d2c39c..39bcbe0 100644
--- a/examples/book/progressbar/examplewindow.cc
+++ b/examples/book/progressbar/examplewindow.cc
@@ -67,7 +67,7 @@ ExampleWindow::ExampleWindow()
   m_VBox.pack_start(m_Button_Close, Gtk::PACK_SHRINK);
   m_Button_Close.signal_clicked().connect(sigc::mem_fun(*this,
               &ExampleWindow::on_button_close) );
-  m_Button_Close.set_flags(Gtk::CAN_DEFAULT);
+  m_Button_Close.set_can_default();
   m_Button_Close.grab_default();
 
   show_all_children();
diff --git a/examples/book/range_widgets/examplewindow.cc b/examples/book/range_widgets/examplewindow.cc
index 58859c2..66dbdc6 100644
--- a/examples/book/range_widgets/examplewindow.cc
+++ b/examples/book/range_widgets/examplewindow.cc
@@ -151,7 +151,7 @@ ExampleWindow::ExampleWindow()
   m_VBox_Top.pack_start(m_Separator, Gtk::PACK_SHRINK);
   m_VBox_Top.pack_start(m_Button_Quit, Gtk::PACK_SHRINK);
 
-  m_Button_Quit.set_flags(Gtk::CAN_DEFAULT);
+  m_Button_Quit.set_can_default();
   m_Button_Quit.grab_default();
   m_Button_Quit.signal_clicked().connect(sigc::mem_fun(*this,
     &ExampleWindow::on_button_quit));
diff --git a/examples/book/scrolledwindow/examplewindow.cc b/examples/book/scrolledwindow/examplewindow.cc
index 02e6036..5cba282 100644
--- a/examples/book/scrolledwindow/examplewindow.cc
+++ b/examples/book/scrolledwindow/examplewindow.cc
@@ -63,7 +63,7 @@ ExampleWindow::ExampleWindow()
               &ExampleWindow::on_button_close));
 
   /* this makes it so the button is the default. */
-  m_Button_Close.set_flags(Gtk::CAN_DEFAULT);
+  m_Button_Close.set_can_default();
 
   Gtk::Box* pBox = get_action_area();
   if(pBox)
diff --git a/examples/others/calendar/calendar.cc b/examples/others/calendar/calendar.cc
index 0f5a1ed..73aa985 100644
--- a/examples/others/calendar/calendar.cc
+++ b/examples/others/calendar/calendar.cc
@@ -256,7 +256,7 @@ CalendarExample::CalendarExample()
   button = Gtk::manage(new Gtk::Button("Close"));
   button->signal_clicked().connect(&Gtk::Main::quit);
   bbox->add(*button);
-  button->set_flags(Gtk::CAN_DEFAULT);
+  button->set_can_default();
   button->grab_default();
 
   show_all();
diff --git a/examples/others/cellrenderercustom/popupentry.cc b/examples/others/cellrenderercustom/popupentry.cc
index e6b4180..1e6728c 100644
--- a/examples/others/cellrenderercustom/popupentry.cc
+++ b/examples/others/cellrenderercustom/popupentry.cc
@@ -45,7 +45,7 @@ PopupEntry::PopupEntry(const Glib::ustring& path)
   hbox->pack_start(*Gtk::manage(button_), Gtk::PACK_SHRINK);
   button_->add(*Gtk::manage(new Gtk::Arrow(Gtk::ARROW_DOWN, Gtk::SHADOW_OUT)));
 
-  set_flags(Gtk::CAN_FOCUS);
+  set_can_focus();
   add_events(Gdk::KEY_PRESS_MASK | Gdk::KEY_RELEASE_MASK);
 
   show_all_children();



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