[33008] in Perl-Users-Digest

home help back first fref pref prev next nref lref last post

Perl-Users Digest, Issue: 4284 Volume: 11

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Mon Sep 15 05:17:17 2014

Date: Mon, 15 Sep 2014 02:17:04 -0700 (PDT)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)

Perl-Users Digest           Mon, 15 Sep 2014     Volume: 11 Number: 4284

Today's topics:
        Something's wrong here with zenity progress <gamo@telecable.es>
        Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)

----------------------------------------------------------------------

Date: Mon, 15 Sep 2014 10:03:15 +0200
From: gamo <gamo@telecable.es>
Subject: Something's wrong here with zenity progress
Message-Id: <lv66gj$nnq$1@speranza.aioe.org>

Hi group

'zenity' is a piece of comand line utility to provide GUI (Gtk)
for the basic input or static output operations on a script.
Like dialog, but in gtk.

I have found strange unexpected behavior in the progress option.

The page documenting its use is here:
https://help.gnome.org/users/zenity/3.8/progress.html.es

Here's a piece that don't works well, as if $|=1 does not
have effect. Another bug it's related with the use of $?

$|=1;
my @list = 0..10; # warning, do not increase!
progress ( "Se ha completado el 100 %", "# Progreso:" , \@list );


sub progress {
     my ($title, $text, $percentage) = @_;
     open ZEN, "|-", "zenity --progress title=\"$title\" text=\"$text\" 
percentage=0" or
       die "Cannot open zen";
     for my $i (@$percentage) {
         print ZEN "$i\n";
         if ( $? == -1 ) {
             error( "¡Cancelado!" );
             exit -1;
         }
         sleep 1;
     }
     close ZEN;
}

sub error {
     my ($text) = @_;
     `zenity --error text="$text"`;
}

Note that in the help page there is a working bash example, which works
well.

Thanks in advance


-- 
http://www.telecable.es/personales/gamo/


------------------------------

Date: 6 Apr 2001 21:33:47 GMT (Last modified)
From: Perl-Users-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin) 
Subject: Digest Administrivia (Last modified: 6 Apr 01)
Message-Id: <null>


Administrivia:

To submit articles to comp.lang.perl.announce, send your article to
clpa@perl.com.

Back issues are available via anonymous ftp from
ftp://cil-www.oce.orst.edu/pub/perl/old-digests. 

#For other requests pertaining to the digest, send mail to
#perl-users-request@ruby.oce.orst.edu. Do not waste your time or mine
#sending perl questions to the -request address, I don't have time to
#answer them even if I did know the answer.


------------------------------
End of Perl-Users Digest V11 Issue 4284
***************************************


home help back first fref pref prev next nref lref last post