[gtkmm-documentation] Fix 'make check' with --enable-warnings=fatal.



commit 5b9e69bef5a3a00caeb26fbbd0149bb8758095ea
Author: Kjell Ahlstedt <kjell ahlstedt bredband net>
Date:   Fri Mar 23 16:24:27 2012 +0100

    Fix 'make check' with --enable-warnings=fatal.
    
    * examples/others/cellrenderercustom/popupentry.[h|cc]: Replace the deprecated
    Gtk::Entry::signal_activate() by signal_key_press_event(). Bug #655489.

 ChangeLog                                        |    7 +++++++
 examples/others/cellrenderercustom/popupentry.cc |   21 +++++++++++----------
 examples/others/cellrenderercustom/popupentry.h  |    1 -
 3 files changed, 18 insertions(+), 11 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index 2f09139..ceec549 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2012-03-23  Kjell Ahlstedt <kjell ahlstedt bredband net>
+
+	Fix 'make check' with --enable-warnings=fatal.
+
+	* examples/others/cellrenderercustom/popupentry.[h|cc]: Replace the deprecated
+	Gtk::Entry::signal_activate() by signal_key_press_event(). Bug #655489.
+
 2012-03-22  Murray Cumming  <murrayc murrayc com>
 
 	Application examples: Add an AppMenu example.
diff --git a/examples/others/cellrenderercustom/popupentry.cc b/examples/others/cellrenderercustom/popupentry.cc
index 9a12cca..537820b 100644
--- a/examples/others/cellrenderercustom/popupentry.cc
+++ b/examples/others/cellrenderercustom/popupentry.cc
@@ -134,10 +134,7 @@ void PopupEntry::start_editing_vfunc(GdkEvent*)
 {
   entry_->select_region(0, -1);
 
-  // TODO: This is a key-binding signal. Investigate whether we really need to use a keybinding signal
-  // when creating a derived CellRenderer.
-  entry_->signal_activate().connect(sigc::mem_fun(*this, &Self::on_entry_activate));
-  entry_->signal_key_press_event().connect(sigc::mem_fun(*this, &Self::on_entry_key_press_event));
+  entry_->signal_key_press_event().connect(sigc::mem_fun(*this, &Self::on_entry_key_press_event), false);
 
   //TODO: Doesn't this mean that we have multiple connection, because this is never disconnected?
   button_->signal_clicked().connect(sigc::mem_fun(*this, &Self::on_button_clicked));
@@ -148,14 +145,18 @@ void PopupEntry::on_button_clicked()
   signal_arrow_clicked_.emit();
 }
 
-void PopupEntry::on_entry_activate()
-{
-  editing_done();
-  //remove_widget(); // TODO: this line causes the widget to be removed twice -- dunno why
-}
-
 bool PopupEntry::on_entry_key_press_event(GdkEventKey* event)
 {
+  if(event->keyval == GDK_KEY_Return ||
+     event->keyval == GDK_KEY_ISO_Enter ||
+     event->keyval == GDK_KEY_KP_Enter)
+  {
+    editing_done();
+    //remove_widget(); // TODO: this line causes the widget to be removed twice -- dunno why
+
+    return true;
+  }
+
   if(event->keyval == GDK_KEY_Escape)
   {
     editing_canceled_ = true;
diff --git a/examples/others/cellrenderercustom/popupentry.h b/examples/others/cellrenderercustom/popupentry.h
index 8dbdcf8..4118b94 100644
--- a/examples/others/cellrenderercustom/popupentry.h
+++ b/examples/others/cellrenderercustom/popupentry.h
@@ -50,7 +50,6 @@ protected:
 private:
   typedef PopupEntry Self;
 
-  void on_entry_activate();
   bool on_entry_key_press_event(GdkEventKey* event);
   void on_button_clicked();
 



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