diff options
author | Thierry Vignaud <tv@mandriva.org> | 2007-09-19 13:44:28 +0000 |
---|---|---|
committer | Thierry Vignaud <tv@mandriva.org> | 2007-09-19 13:44:28 +0000 |
commit | c84371973132b4609fead8a39849f9e5ba9ccabb (patch) | |
tree | 2a815ee672446d923884d8f33bd480efbb71ebe9 | |
parent | 70febc8c688a6c1ce1d20c63e4aac1beb3bdd998 (diff) | |
download | rpmdrake-c84371973132b4609fead8a39849f9e5ba9ccabb.tar rpmdrake-c84371973132b4609fead8a39849f9e5ba9ccabb.tar.gz rpmdrake-c84371973132b4609fead8a39849f9e5ba9ccabb.tar.bz2 rpmdrake-c84371973132b4609fead8a39849f9e5ba9ccabb.tar.xz rpmdrake-c84371973132b4609fead8a39849f9e5ba9ccabb.zip |
(statusbar_msg) enable to automatically remove the status message
after 5 seconds
-rw-r--r-- | rpmdrake.pm | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/rpmdrake.pm b/rpmdrake.pm index 77c79fa5..10d78d79 100644 --- a/rpmdrake.pm +++ b/rpmdrake.pm @@ -373,12 +373,14 @@ sub statusbar_msg { unless ($::statusbar) { #- fallback if no status bar if (defined &::wait_msg_) { goto &::wait_msg_ } else { goto &wait_msg } } - my ($msg) = @_; + my ($msg, $o_timeout) = @_; #- always use the same context description for now my $cx = $::statusbar->get_context_id("foo"); $::w and $::w->{rwindow} and gtkset_mousecursor_wait($::w->{rwindow}->window); #- returns a msg_id to be passed optionnally to statusbar_msg_remove - $::statusbar->push($cx, $msg); + my $id = $::statusbar->push($cx, $msg); + Glib::Timeout->add(5000, sub { statusbar_msg_remove($id); 0 }) if $o_timeout; + $id; } sub statusbar_msg_remove { |