13
0

gtkmm: use get_first_cell() instead of deprecated Gtk::TreeViewColumn::get_first_cell_renderer()

This commit is contained in:
Mads Kiilerich 2022-01-26 23:01:44 +01:00 committed by Robin Gareus
parent f9b3ed0523
commit 4c3c433700
Signed by: rgareus
GPG Key ID: A090BCE02CF57F04
3 changed files with 6 additions and 6 deletions

View File

@ -131,7 +131,7 @@ RegionListBase::setup_col (TreeViewColumn* col, int sort_idx, Gtk::AlignmentEnum
col->set_alignment (al);
/* ...and this sets the alignment for the data cells */
CellRendererText* renderer = dynamic_cast<CellRendererText*> (col->get_first_cell_renderer ());
CellRendererText* renderer = dynamic_cast<CellRendererText*> (col->get_first_cell ());
if (renderer) {
renderer->property_xalign () = (al == ALIGN_END ? 1.0 : (al == ALIGN_START ? 0.0 : 0.5));
}
@ -140,7 +140,7 @@ RegionListBase::setup_col (TreeViewColumn* col, int sort_idx, Gtk::AlignmentEnum
void
RegionListBase::setup_toggle (Gtk::TreeViewColumn* tvc, sigc::slot<void, std::string> cb)
{
CellRendererToggle* tc = dynamic_cast<CellRendererToggle*> (tvc->get_first_cell_renderer ());
CellRendererToggle* tc = dynamic_cast<CellRendererToggle*> (tvc->get_first_cell ());
tc->property_activatable () = true;
tc->signal_toggled ().connect (cb);
}
@ -152,7 +152,7 @@ RegionListBase::add_name_column ()
setup_col (tvc, 0, ALIGN_START, _("Name"), ("Region name"));
/* Region Name: make editable */
CellRendererText* region_name_cell = dynamic_cast<CellRendererText*> (tvc->get_first_cell_renderer ());
CellRendererText* region_name_cell = dynamic_cast<CellRendererText*> (tvc->get_first_cell ());
region_name_cell->property_editable () = true;
region_name_cell->signal_edited ().connect (sigc::mem_fun (*this, &RegionListBase::name_edit));
region_name_cell->signal_editing_started ().connect (sigc::mem_fun (*this, &RegionListBase::name_editing_started));
@ -169,7 +169,7 @@ RegionListBase::add_tag_column ()
setup_col (tvc, 2, ALIGN_START, _("Tags"), _("Tags"));
/* Tags cell: make editable */
CellRendererText* region_tags_cell = dynamic_cast<CellRendererText*> (tvc->get_first_cell_renderer ());
CellRendererText* region_tags_cell = dynamic_cast<CellRendererText*> (tvc->get_first_cell ());
region_tags_cell->property_editable () = true;
region_tags_cell->signal_edited ().connect (sigc::mem_fun (*this, &RegionListBase::tag_edit));
region_tags_cell->signal_editing_started ().connect (sigc::mem_fun (*this, &RegionListBase::tag_editing_started));

View File

@ -144,7 +144,7 @@ RouteListBase::add_name_column ()
setup_col (tvc, _("Name"), ("Track/Bus name"));
CellRendererText* cell = dynamic_cast<CellRendererText*> (tvc->get_first_cell_renderer ());
CellRendererText* cell = dynamic_cast<CellRendererText*> (tvc->get_first_cell ());
cell->signal_editing_started ().connect (sigc::mem_fun (*this, &RouteListBase::name_edit_started));
tvc->set_sizing (TREE_VIEW_COLUMN_FIXED);
tvc->set_expand (true);

View File

@ -75,7 +75,7 @@ protected:
tvc->set_expand (false);
tvc->set_alignment (Gtk::ALIGN_CENTER);
Gtk::CellRendererToggle* tc = dynamic_cast<Gtk::CellRendererToggle*> (tvc->get_first_cell_renderer ());
Gtk::CellRendererToggle* tc = dynamic_cast<Gtk::CellRendererToggle*> (tvc->get_first_cell ());
tc->property_activatable () = true;
tc->property_radio () = false;
tc->signal_toggled ().connect (cb);