[glom] ImageGlom: Make the context-menu work with the EvView.



commit fa52b8d0f3b9ddafc7a6d52bcdf6ef7f7d1684a9
Author: Murray Cumming <murrayc murrayc com>
Date:   Wed Jul 13 12:01:45 2011 +0200

    ImageGlom: Make the context-menu work with the EvView.
    
    * glom/utility_widgets/imageglom.cc: Connect to the widget's own signal.

 ChangeLog                         |    6 ++++++
 glom/utility_widgets/imageglom.cc |    8 ++++++++
 2 files changed, 14 insertions(+), 0 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index 8cabfcb..7373b3b 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,11 @@
 2011-07-13  Murray Cumming  <murrayc murrayc com>
 
+	ImageGlom: Make the context-menu work with the EvView.
+
+	* glom/utility_widgets/imageglom.cc: Connect to the widget's own signal.
+
+2011-07-13  Murray Cumming  <murrayc murrayc com>
+
 	ImageGlom: Loading/Saving: Add more FileChooser filters.
 
 	* glom/utility_widgets/imageglom.cc: set_file_filter_images():
diff --git a/glom/utility_widgets/imageglom.cc b/glom/utility_widgets/imageglom.cc
index 2399a2d..f77735e 100644
--- a/glom/utility_widgets/imageglom.cc
+++ b/glom/utility_widgets/imageglom.cc
@@ -54,6 +54,14 @@ ImageGlom::ImageGlom(BaseObjectType* cobject, const Glib::RefPtr<Gtk::Builder>&
 void ImageGlom::init()
 {
   m_ev_view = EV_VIEW(ev_view_new());
+  //gtk_widget_add_events(GTK_WIDGET(m_ev_view), GDK_BUTTON_PRESS_MASK);
+
+  //Connect the the EvView's button-press-event signal, 
+  //because we don't get it otherwise.
+  //For some reason this is not necessary with the GtkImage.
+  Gtk::Widget* cppEvView = Glib::wrap(GTK_WIDGET(m_ev_view));
+  cppEvView->signal_button_press_event().connect(
+    sigc::mem_fun(*this, &ImageGlom::on_button_press_event), false);
 
   m_read_only = false;
 



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