summaryrefslogtreecommitdiffstats
path: root/perl-install/interactive/gtk.pm
diff options
context:
space:
mode:
authorPascal Rigaux <pixel@mandriva.com>2005-09-19 11:11:35 +0000
committerPascal Rigaux <pixel@mandriva.com>2005-09-19 11:11:35 +0000
commitac3a9376ff3f253e55795fa833383eb72553a925 (patch)
tree16ef85aa7ee1f7dbbccde3d2f055c0f5746efe23 /perl-install/interactive/gtk.pm
parent0557d832a7dd38db0ef9d3588df0097f7b495dac (diff)
downloaddrakx-backup-do-not-use-ac3a9376ff3f253e55795fa833383eb72553a925.tar
drakx-backup-do-not-use-ac3a9376ff3f253e55795fa833383eb72553a925.tar.gz
drakx-backup-do-not-use-ac3a9376ff3f253e55795fa833383eb72553a925.tar.bz2
drakx-backup-do-not-use-ac3a9376ff3f253e55795fa833383eb72553a925.tar.xz
drakx-backup-do-not-use-ac3a9376ff3f253e55795fa833383eb72553a925.zip
titi's patch is wrong, the ->set_cursor being not done when selecting and exiting window on the event (ie double clicking on the entry)
we really would need to do things more cleanly (i know on TextView ->scroll_to_mark works better than ->scroll_to_cell)
Diffstat (limited to 'perl-install/interactive/gtk.pm')
-rw-r--r--perl-install/interactive/gtk.pm7
1 files changed, 4 insertions, 3 deletions
diff --git a/perl-install/interactive/gtk.pm b/perl-install/interactive/gtk.pm
index 32dc2e87a..e024fc54f 100644
--- a/perl-install/interactive/gtk.pm
+++ b/perl-install/interactive/gtk.pm
@@ -82,8 +82,9 @@ sub create_treeview_list {
$list_tv->append_column($textcolumn);
my $select = sub {
- $list_tv->set_cursor($_[0], undef, 0);
- $list_tv->scroll_to_cell($_[0], undef, 1, 0.5, 0);
+ my ($path) = @_;
+ $list_tv->set_cursor($path, undef, 0);
+ Glib::Timeout->add(100, sub { $list_tv->scroll_to_cell($path, undef, 1, 0.5, 0); 0 });
};
my ($starting_word, $start_reg) = ('', '^');
@@ -143,7 +144,7 @@ sub create_treeview_list {
my $nb = find_index { $_ eq $v } @{$e->{list}};
my ($old_path) = $list_tv->get_cursor;
if (!$old_path || $nb != $old_path->to_string) {
- Glib::Timeout->add(100, sub { $select->(Gtk2::TreePath->new_from_string($nb)); 0 });
+ $select->(Gtk2::TreePath->new_from_string($nb));
}
undef $old_path if $old_path;
};