From 202e6e90345d83d0f53455e5a1e41e03c94a8abd Mon Sep 17 00:00:00 2001 From: Luca Bacci Date: Fri, 3 Aug 2018 20:24:25 +0200 Subject: [PATCH] port-to-gtk3: Use Gtk::CellLayout::get_cells() (#7) GParted uses Gtk::TreeViewColumn::get_cell_renderers(). This is not present in Gtkmm3. Now Gtk::TreeViewColumn inherits from Gtk::CellLayout and we have to use Gtk::CellLayout::get_cells() instead. GtkCellLayout was introduced in Gtk2 version 2.18 as the common interface for containers of cell renderers. The C++ wrapper Gtk::CellLayout was introduced in Gtkmm2 version 2.18, but Gtk::TreeViewColumn was never made to inherit from Gtk::CellLayout to avoid breaking the API / ABI. That change was made for Gtkmm3. This is an excerpt from gtkmm/treeviewcolumn.h header in Gtkmm2: // TODO: Should be deprecated, but we cannot derive from CellLayout // without breaking API and ABI. /** Returns a list of all the cell renderers in the column, * in no particular order. * * @return A list of Gtk::CellRenderers. */ Glib::ListHandle get_cell_renderers(); Replace Gtk::TreeViewColumn::get_cell_renderers() with base class method Gtk::CellLayout::get_cells(). Reference: [1] Commit - "Deprecate get_cell_renderers implementations" https://gitlab.gnome.org/GNOME/gtk/commit/6abc52a29d2b15c255ada7d199b703a95f8c565b Closes #7 - Port to Gtk3 --- src/TreeView_Detail.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/TreeView_Detail.cc b/src/TreeView_Detail.cc index 03a8ec3b..2e105b03 100644 --- a/src/TreeView_Detail.cc +++ b/src/TreeView_Detail.cc @@ -60,7 +60,7 @@ TreeView_Detail::TreeView_Detail() // Color pixbuf cell is left aligned. get_column(2)->get_first_cell()->property_xalign() = Gtk::ALIGN_START; // File system text cell is left aligned. - std::vector renderers = get_column( 2 )->get_cell_renderers(); + std::vector renderers = get_column(2)->get_cells(); Gtk::CellRendererText *cell_renderer_text = dynamic_cast( renderers.back() ); cell_renderer_text->property_xalign() = Gtk::ALIGN_START;