From 6fd7051f446c2ccfc8462417b577453ccbbbc727 Mon Sep 17 00:00:00 2001 From: Antoine Ginies Date: Thu, 7 Jul 2005 00:46:37 +0000 Subject: add double clic event --- perl-install/standalone/drakhosts | 21 ++++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) (limited to 'perl-install/standalone') diff --git a/perl-install/standalone/drakhosts b/perl-install/standalone/drakhosts index f10c79043..23441d1e5 100644 --- a/perl-install/standalone/drakhosts +++ b/perl-install/standalone/drakhosts @@ -209,11 +209,18 @@ $treeview->set_rules_hint(TRUE); $treeview->get_selection->set_mode('single'); add_columns($treeview); -my $okcancel = create_okcancel({ - cancel_clicked => sub { ugtk2->exit }, - ok_clicked => \&write_conf_hosts, - }, - ); +$treeview->signal_connect(button_press_event => sub { + my (undef, $event) = @_; + my $model = $treeview->get_model; + my $selection = $treeview->get_selection; + my $iter = $selection->get_selected; + if ($iter) { + my $path = $model->get_path($iter); + my $i = ($path->get_indices)[0]; + add_modify_entry($model, $treeview, "modify") if $event->type eq '2button-press'; + } + }); + # main interface $W->add(gtkpack_(Gtk2::VBox->new(0,0), @@ -242,9 +249,9 @@ $W->add(gtkpack_(Gtk2::VBox->new(0,0), err_dialog(N("Error"), N("Failed to remove host.") . "\n\n" . $err); } }), + if_($::isEmbedded, 0, gtksignal_connect(Gtk2::Button->new(N("Quit")), clicked => sub { ugtk2->exit })), ), - if_($::isEmbedded, 0, $okcancel), - ), + ), ); $W->show_all; -- cgit v1.2.1