#!/usr/bin/perl -w use strict; use warnings; use diagnostics; use Tk; use Tk::Balloon; use Tk::Dialog; use Tk::DialogBox; use Tk::FileSelect; use Tk::Pane; use Tk::BrowseEntry; use Tk::ProgressBar; use Tk::NoteBook; #---------------------- my $version = "1.1.0"; sub init { $initdone = 0; $mw->Walk( sub { $_[0]->destroy } ) if ( Exists( $mw ) ); $mw = MainWindow->new( -background => "#e6e6e6", -title => "ParaWell v$version", ) if ( not Exists( $mw ) ); #----------------------------------------- sub progress { $frameprogress->MapWindow if ( $_[0] < 1 ); $percents = sprintf( "%d%%", $_[0] * 100 ); $percent = $_[0] * 100; $progressbar->idletasks; $frameprogress->UnmapWindow if ( $_[0] == 1 ); return if ( $_[1] eq $progwhat ); $progwhat = " "; $progwhatlab->idletasks; $progwhat = ( $frameprogress->ismapped ) ? $_[1] : ""; } #---------------------------------- sub addball { return if ( not Exists( $_[0] ) ); my $ball = $_[0]->Balloon( -state => "balloon", -foreground => "#000000", -background => "#ffffaa", -cancelcommand => sub { return 1 }, ); $ball->attach( $_[0], -balloonposition => 'mouse', -msg => ( join "\n", $_[1] ), -cancelcommand => sub { return 1 }, -initwait => 200, ); }