aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDaouda Lo <daouda@mandriva.com>2003-07-04 11:17:01 +0000
committerDaouda Lo <daouda@mandriva.com>2003-07-04 11:17:01 +0000
commit3ceeaf1a6db7c288117f3d6d4262a3f052c6dd78 (patch)
tree0bb610bb3e3b8f43a3dfaa2362c58362634840a0
parentf8d2cd64bb18042dccee1561ea3106cb956b0549 (diff)
downloaduserdrake-3ceeaf1a6db7c288117f3d6d4262a3f052c6dd78.tar
userdrake-3ceeaf1a6db7c288117f3d6d4262a3f052c6dd78.tar.gz
userdrake-3ceeaf1a6db7c288117f3d6d4262a3f052c6dd78.tar.bz2
userdrake-3ceeaf1a6db7c288117f3d6d4262a3f052c6dd78.tar.xz
userdrake-3ceeaf1a6db7c288117f3d6d4262a3f052c6dd78.zip
- better solution to search with enter key
-rwxr-xr-xuserdrake7
1 files changed, 3 insertions, 4 deletions
diff --git a/userdrake b/userdrake
index a65b224..935ebe2 100755
--- a/userdrake
+++ b/userdrake
@@ -110,9 +110,10 @@ if (defined $buttorcheck{filter}) {
}
my $toolb = Gtk2::Toolbar->new;
-my $searchBox = Gtk2::HBox->new(0,5);
+my $searchBox = Gtk2::HBox->new(0,5); my $filter;
$searchBox->pack_end(my $fbut = Gtk2::Button->new(N("Apply filter")), 0, 0, 4);
-$searchBox->pack_end(my $filter = Gtk2::Entry->new, 0, 0, 4);
+$searchBox->pack_end(gtksignal_connect($filter = Gtk2::Entry->new,
+ key_press_event => sub { $_[1]->keyval == Gtk2::Gdk::Event::Key->Sym_Return and Refresh($sysfilter, $filter->get_text()) } ), 0, 0, 4);
gtkappend_page(my $nb = Gtk2::Notebook->new, gtkpack(create_scrolled_window($usertree)), gtkshow(Gtk2::Label->new(N("Users"))));
gtkappend_page($nb, gtkpack(create_scrolled_window($grouptree)), gtkshow(Gtk2::Label->new(N("Group Users"))));
$nb->set_show_border(0);
@@ -150,8 +151,6 @@ my ($tbuser, $tbgroup, $tbedit, $tbdel, $tbref, $tbhelp) = @toolbwg;
foreach (($tbedit, $tbdel, $buttorcheck{edit}, $buttorcheck{delete})) { $_->set_sensitive(0) };
my $ctx = USER::ADMIN->new;
$fbut->signal_connect('clicked', sub { $stringsearch = $filter->get_text() ; Refresh($sysfilter, $stringsearch) });
-$filter->signal_connect('key_press_event' => sub { $_[1]->keyval == Gtk2::Gdk::Event::Key->Sym_Return
- and Refresh($sysfilter, $filter->get_text()) });
Refresh($sysfilter, $stringsearch);
my $tmm = ConvTime(19, 06, 2003);
$nb->signal_connect('switch-page' => sub { NotebookSwitch() });