[gtkmm-documentation] Adapt to my SearchBar API change.



commit c5607347f6b4729c9dd6d70fa16e8e1731e082c9
Author: Murray Cumming <murrayc murrayc com>
Date:   Mon Oct 7 09:34:50 2013 +0200

    Adapt to my SearchBar API change.

 examples/book/searchbar/examplewindow.cc |   13 +++++--------
 examples/book/searchbar/examplewindow.h  |    5 +----
 2 files changed, 6 insertions(+), 12 deletions(-)
---
diff --git a/examples/book/searchbar/examplewindow.cc b/examples/book/searchbar/examplewindow.cc
index 6c0a505..efc1181 100644
--- a/examples/book/searchbar/examplewindow.cc
+++ b/examples/book/searchbar/examplewindow.cc
@@ -48,7 +48,7 @@ ExampleWindow::ExampleWindow()
 
   // Switches
   m_search_mode_switch.set_active(false);
-  m_close_button_switch.set_active(true);
+  m_close_button_switch.set_active();
   m_search_mode_switch.property_active().signal_changed().connect(sigc::mem_fun(*this, 
&ExampleWindow::on_search_mode_changed));
   m_close_button_switch.property_active().signal_changed().connect(sigc::mem_fun(*this, 
&ExampleWindow::on_show_close_button_changed));
 
@@ -86,27 +86,24 @@ ExampleWindow::~ExampleWindow()
 
 bool ExampleWindow::on_window_key_press(GdkEventKey* key_event)
 {
-  GdkEvent event;
-
-  event.key = *key_event;
-  return m_search_bar.handle_event(&event);
+  return m_search_bar.handle_event(key_event);
 }
 
 void ExampleWindow::on_search_bar_reveal_changed()
 {
-  bool revealed = m_search_bar.get_search_mode();
+  const bool revealed = m_search_bar.get_search_mode();
   m_search_mode_switch.set_active(revealed);
 }
 
 void ExampleWindow::on_search_mode_changed()
 {
-  bool search_mode = m_search_mode_switch.get_active();
+  const bool search_mode = m_search_mode_switch.get_active();
   m_search_bar.set_search_mode(search_mode);
 }
 
 void ExampleWindow::on_show_close_button_changed()
 {
-  bool show_close_button = m_close_button_switch.get_active();
+  const bool show_close_button = m_close_button_switch.get_active();
   m_search_bar.set_show_close_button(show_close_button);
 }
 
diff --git a/examples/book/searchbar/examplewindow.h b/examples/book/searchbar/examplewindow.h
index dbfa6e4..a439f39 100644
--- a/examples/book/searchbar/examplewindow.h
+++ b/examples/book/searchbar/examplewindow.h
@@ -19,15 +19,13 @@
 
 #include <gtkmm.h>
 
-#include <iostream>
-
 class ExampleWindow : public Gtk::Window
 {
 public:
   ExampleWindow();
   virtual ~ExampleWindow();
 
-protected:
+private:
   // Slots
   bool on_window_key_press(GdkEventKey* key_event);
   void on_search_mode_changed();
@@ -52,7 +50,6 @@ protected:
   Gtk::Label m_close_button_label;
   Gtk::Separator m_separator;
 
-private:
 };
 
 #endif // GTKMM_EXAMPLEWINDOW_H


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