[gtkmm-documentation] Replace Menu::popup() by Menu::popup_at_pointer()
- From: Kjell Ahlstedt <kjellahl src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtkmm-documentation] Replace Menu::popup() by Menu::popup_at_pointer()
- Date: Tue, 8 Nov 2016 18:20:23 +0000 (UTC)
commit 9843f9d23da6681fdee396bb0f6cafd8decb6157
Author: Kjell Ahlstedt <kjell ahlstedt bredband net>
Date: Tue Nov 8 19:17:37 2016 +0100
Replace Menu::popup() by Menu::popup_at_pointer()
* examples/book/menus/popup/examplewindow.cc:
* examples/book/treeview/popup/treeview_withpopup.cc: Replace the deprecated
Menu::popup() by the new Menu::popup_at_pointer().
* examples/others/cellrenderercustom/cellrenderertoggle.cc: Don't use an
anonymous namespace. gcc 6.2.0 reports errors because there are unused
functions. (I don't want to remove them. I suppose someone has planned to
use them some time.)
examples/book/menus/popup/examplewindow.cc | 5 ++++-
examples/book/treeview/popup/treeview_withpopup.cc | 8 +++++---
.../cellrenderercustom/cellrenderertoggle.cc | 12 ++++++------
3 files changed, 15 insertions(+), 10 deletions(-)
---
diff --git a/examples/book/menus/popup/examplewindow.cc b/examples/book/menus/popup/examplewindow.cc
index d19900f..6c9e052 100644
--- a/examples/book/menus/popup/examplewindow.cc
+++ b/examples/book/menus/popup/examplewindow.cc
@@ -122,8 +122,11 @@ bool ExampleWindow::on_button_press_event(GdkEventButton* button_event)
}
if(m_pMenuPopup)
- m_pMenuPopup->popup(button_event->button, button_event->time);
+ m_pMenuPopup->popup_at_pointer((GdkEvent*)button_event);
+ // Menu::popup_at_pointer() is new in gtkmm 3.22.
+ // If you have an older revision, try this:
+ //m_pMenuPopup->popup(button_event->button, button_event->time);
return true; //It has been handled.
}
diff --git a/examples/book/treeview/popup/treeview_withpopup.cc
b/examples/book/treeview/popup/treeview_withpopup.cc
index fc74249..ddcac5b 100644
--- a/examples/book/treeview/popup/treeview_withpopup.cc
+++ b/examples/book/treeview/popup/treeview_withpopup.cc
@@ -1,5 +1,3 @@
-//$Id: treeview_withpopup.cc 836 2007-05-09 03:02:38Z jjongsma $ -*- c++ -*-
-
/* gtkmm example Copyright (C) 2002 gtkmm development team
*
* This program is free software; you can redistribute it and/or modify
@@ -77,7 +75,11 @@ bool TreeView_WithPopup::on_button_press_event(GdkEventButton* button_event)
//Then do our custom stuff:
if( (button_event->type == GDK_BUTTON_PRESS) && (button_event->button == 3) )
{
- m_Menu_Popup.popup(button_event->button, button_event->time);
+ m_Menu_Popup.popup_at_pointer((GdkEvent*)button_event);
+
+ // Menu::popup_at_pointer() is new in gtkmm 3.22.
+ // If you have an older revision, try this:
+ //m_Menu_Popup.popup(button_event->button, button_event->time);
}
return return_value;
diff --git a/examples/others/cellrenderercustom/cellrenderertoggle.cc
b/examples/others/cellrenderercustom/cellrenderertoggle.cc
index c86193b..d2e7235 100644
--- a/examples/others/cellrenderercustom/cellrenderertoggle.cc
+++ b/examples/others/cellrenderercustom/cellrenderertoggle.cc
@@ -1,5 +1,3 @@
-//$Id: cellrenderertoggle.cc 613 2006-05-10 20:59:28Z murrayc $ -*- c++ -*-
-
/* gtkmm example Copyright (C) 2002 gtkmm development team
*
* This program is free software; you can redistribute it and/or modify
@@ -24,9 +22,11 @@
#include <gtkmm.h>
#include <sstream>
-
-namespace
-{
+// Can't have MyCellRendererToggle in an anonymous namespace, because then
+// gcc 6.2.0 reports unused functions as errors when compiling with
+// --enable-warnings=fatal.
+//namespace
+//{
class MyCellRendererToggle : public Gtk::CellRenderer
{
@@ -283,7 +283,7 @@ void AppWindow::on_cell_toggled(const Glib::ustring& path_string)
row[list_columns_.active] = !row[list_columns_.active];
}
-} // anonymous namespace
+//} // anonymous namespace
int main(int argc, char** argv)
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]