From e2430fc76d127a52606487536f2e829581b609b0 Mon Sep 17 00:00:00 2001 From: Shawn Laffan Date: Sun, 1 Nov 2020 10:38:26 +1100 Subject: [PATCH] change Gtk3::ComboBox->new_text to Gtk3::ComboBoxText->new Updates #770 --- lib/Biodiverse/GUI/BasedataImport.pm | 6 +++--- lib/Biodiverse/GUI/MatrixImport.pm | 2 +- lib/Biodiverse/GUI/ParametersTable.pm | 8 +++++--- lib/Biodiverse/GUI/RemapGUI.pm | 4 ++-- lib/Biodiverse/GUI/Tabs/Clustering.pm | 4 ++-- lib/Biodiverse/GUI/Tabs/RegionGrower.pm | 2 +- lib/Biodiverse/GUI/Tabs/Spatial.pm | 2 +- 7 files changed, 15 insertions(+), 13 deletions(-) diff --git a/lib/Biodiverse/GUI/BasedataImport.pm b/lib/Biodiverse/GUI/BasedataImport.pm index 9ecba0b43..8feeddd46 100644 --- a/lib/Biodiverse/GUI/BasedataImport.pm +++ b/lib/Biodiverse/GUI/BasedataImport.pm @@ -1704,7 +1704,7 @@ sub add_row { $label->set_use_markup(1); # Type combo box - my $combo = Gtk3::ComboBox->new_text; + my $combo = Gtk3::ComboBoxText->new; foreach (@$row_options) { $combo->append_text($_); } @@ -1729,7 +1729,7 @@ sub add_row { } # degrees minutes seconds - my $combo_dms = Gtk3::ComboBox->new_text; + my $combo_dms = Gtk3::ComboBoxText->new; $combo_dms->set_has_tooltip(1); $combo_dms->set_tooltip_text($lat_lon_widget_tooltip_text); foreach my $choice ( '', 'is_lat', 'is_lon' ) { @@ -2070,7 +2070,7 @@ sub add_remap_row { $label->set_use_markup(1); # Type combo box - my $combo = Gtk3::ComboBox->new_text; + my $combo = Gtk3::ComboBoxText->new; my @options = $column_overrides ? @$column_overrides diff --git a/lib/Biodiverse/GUI/MatrixImport.pm b/lib/Biodiverse/GUI/MatrixImport.pm index 864f3f7dd..daf35b015 100644 --- a/lib/Biodiverse/GUI/MatrixImport.pm +++ b/lib/Biodiverse/GUI/MatrixImport.pm @@ -428,7 +428,7 @@ sub import_sparse_format { sub run_combo_sparse_normal { - my $combo = Gtk3::ComboBox->new_text; + my $combo = Gtk3::ComboBoxText->new; $combo->append_text('normal'); $combo->append_text('sparse'); $combo->set_active(0); diff --git a/lib/Biodiverse/GUI/ParametersTable.pm b/lib/Biodiverse/GUI/ParametersTable.pm index c45ea9c62..8159b4c5e 100644 --- a/lib/Biodiverse/GUI/ParametersTable.pm +++ b/lib/Biodiverse/GUI/ParametersTable.pm @@ -163,7 +163,9 @@ sub fill { # Add a tooltip my $tip_text = $param->get_tooltip; if ($tip_text) { - $tooltip_group->set_text($widget, $tip_text, undef); + #$tooltip_group->set_text($widget, $tip_text, undef); + # Gtk3 shift: this is probably broken? + $tooltip_group->set_text($tip_text); } # widgets are sensitive unless explicitly told otherwise @@ -272,7 +274,7 @@ sub generate_widget { sub generate_choice { my ($self, $param) = @_; - my $combo = Gtk3::ComboBox->new_text; + my $combo = Gtk3::ComboBoxText->new; # Fill the combo foreach my $choice (@{$param->{choices}}) { @@ -300,7 +302,7 @@ sub generate_choice { sub generate_choice_index { my ($self, $param) = @_; - my $combo = Gtk3::ComboBox->new_text; + my $combo = Gtk3::ComboBoxText->new; # Fill the combo foreach my $choice (@{$param->{choices}}) { diff --git a/lib/Biodiverse/GUI/RemapGUI.pm b/lib/Biodiverse/GUI/RemapGUI.pm index 3846cbe72..dcab37937 100644 --- a/lib/Biodiverse/GUI/RemapGUI.pm +++ b/lib/Biodiverse/GUI/RemapGUI.pm @@ -102,8 +102,8 @@ sub pre_remap_dlg { #### # The remapee data source selection combo box and its label, as # well as the controller combo box and its label. - my $remapee_combo = Gtk3::ComboBox->new_text; - my $controller_combo = Gtk3::ComboBox->new_text; + my $remapee_combo = Gtk3::ComboBoxText->new; + my $controller_combo = Gtk3::ComboBoxText->new; foreach my $option (@remapee_sources) { $remapee_combo->append_text( diff --git a/lib/Biodiverse/GUI/Tabs/Clustering.pm b/lib/Biodiverse/GUI/Tabs/Clustering.pm index f00ac785c..dfd7c9847 100644 --- a/lib/Biodiverse/GUI/Tabs/Clustering.pm +++ b/lib/Biodiverse/GUI/Tabs/Clustering.pm @@ -399,7 +399,7 @@ sub setup_tie_breaker_widgets { my $j = 2 * $i; my $k = $j + 1; my $label = Gtk3::Label->new(" $id: "); - my $index_combo = Gtk3::ComboBox->new_text; + my $index_combo = Gtk3::ComboBoxText->new; my $l = 0; my $use_iter; foreach my $index (qw /none random/, natsort keys %valid_indices) { @@ -412,7 +412,7 @@ sub setup_tie_breaker_widgets { $index_combo->set_active($use_iter // 1); # random by default - my $combo_minmax = Gtk3::ComboBox->new_text; + my $combo_minmax = Gtk3::ComboBoxText->new; $combo_minmax->append_text ('maximise'); $combo_minmax->append_text ('minimise'); $combo_minmax->set_active (0); diff --git a/lib/Biodiverse/GUI/Tabs/RegionGrower.pm b/lib/Biodiverse/GUI/Tabs/RegionGrower.pm index abdfd1f88..24ccfb70f 100644 --- a/lib/Biodiverse/GUI/Tabs/RegionGrower.pm +++ b/lib/Biodiverse/GUI/Tabs/RegionGrower.pm @@ -24,7 +24,7 @@ sub new { my $hbox = $xml_page->get_object('hbox_cluster_metric'); my $label_widget = Gtk3::Label->new('Objective function: '); - my $combo_minmax = Gtk3::ComboBox->new_text(); + my $combo_minmax = Gtk3::ComboBoxText->new(); $combo_minmax->append_text('maximise'); $combo_minmax->append_text('minimise'); $combo_minmax->set_active(0); diff --git a/lib/Biodiverse/GUI/Tabs/Spatial.pm b/lib/Biodiverse/GUI/Tabs/Spatial.pm index f95687f28..9248a3259 100644 --- a/lib/Biodiverse/GUI/Tabs/Spatial.pm +++ b/lib/Biodiverse/GUI/Tabs/Spatial.pm @@ -2104,7 +2104,7 @@ sub on_add_param { $table->attach($button, 0, 1, $rows, $rows + 1, [], [], 0, 0); # Make a combobox and a label to set the parameter - my $combo = Gtk3::ComboBox->new_text; + my $combo = Gtk3::ComboBoxText->new; my $entry = Gtk3::Entry->new; $table->attach($combo, 0, 1, $rows - 1, $rows, 'fill', [], 0, 0);