
Tk::Schedule - Perl extension for a graphical user interface to carrying out tasks up to schedule

my $schedule = $parent->Schedule(options);

use Tk;
use Tk::Schedule;
my $mw = MainWindow->new();
my $s = $mw->Schedule(
-interval => 30,
-repeat => "once",
-command => sub { print("Hello World\n") for(1..10); },
-comment => "check Mail-Box"
)->pack();
MainLoop();

Schedule is derived from the Frame class. This megawidget is comprised of an ChooseDate TimePick Entry Listbox Button Radiobutton allowing to create a schedule.

With this Widget function at a certain time can be called. A schedule can be made for longer periods. The call of functions can be repeated in certain course of time. Possible repetition times are: hourly daily weekly monthly yearly For seconds or minutes the functions $widget->after(time, call) or $widget->repeat(time, call) can be better used.

my $s = $mw->Schedule(
-interval => 30, # default 10
-repeat => "daily", # default once
-comment => "send E-Mail to mail@addresse.com",
-command => sub { print("Hello World\n") for(1..10); },
# -command => [\&DownloadWebsite, $server, $agrs],
# -command => \&ShowPicture,
-scheduletime => time()
)->pack();

All options not specified below are delegated to the Listbox widget.
After how much seconds the program checks the schedule. default = 10
A reference to a function or array. The first element of the array must be a reference to a function.
In which periods the call of the function is repeated. Possible repetition times are: "hourly", "daily", "weekly", "monthly", "yearly" default "once" that does mean NO repetition
This comment is indicated in the list box.
Time in seconds to indicate. default return value of time();

Popup Calendar with support for dates prior to 1970. Author Jack Dunnigan
A graphical user interface to pick timestrings syntax mistake-secure. Author Torsten Knorr

The following widgets are advertised:

The following functions should be used like private functions.
The following functions should be used like public functions.
With this method you can add a task from the program. As parameter you can use the options -repeat, -command, -comment or -scheduletime in every combination. $widget->insert(); $widget->insert(-repeat => "once"); $widget->insert(-command => sub { }); $widget->insert(-comment => "new task"); $widget->insert(-scheduletime => time()); $widget->insert( -repeat => "hourly", -command => sub { print("every hour\n"); }, -comment => "every hour", -scheduletime => time() );
Set the time to indicate. $widget->scheduletime(time_in_seconds); or $widget->configure( -scheduletime => time() );

Call configure to use the following functions. $schedule->configure( -interval => 20, -command => \&DailyDuty, -repeat => "daily", -comment => "every day the same task", -scheduletime => time(), );

None by default.


Maybe you'll find some. Please let me know.

Torsten Knorr, <torsten@mshome.net>

Copyright (C) 2006 by Torsten Knorr torstenknorr@tiscali.de http://www.planet-interkom.de/t.knorr
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself, either Perl version 5.9.2 or, at your option, any later version of Perl 5 you may have available.