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


Tk-Schedule documentation  | view source Contained in the Tk-Schedule distribution.

Index


NAME

Top

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

SYNOPSIS

Top

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

EXAMPLE

Top

 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();

SUPER-CLASS

Top

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

DESCRIPTION

Top

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.

CONSTRUCTOR AND INITIALIZATION

Top

 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();

WIDGET SPECIFIC OPTINOS

Top

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();

INSERTED WIDGETS

Top

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

ADVERTISED WIDGETS

Top

The following widgets are advertised:

METHODS

Top

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() );

WIDGET METHODS

Top

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

PREREQUISITES

Top

EXPORT

None by default.

SEE ALSO

Top

Tk::TimePick Tk::ChooseDate

BUGS

Top

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

AUTHOR

Top

Torsten Knorr, <torsten@mshome.net>

COPYRIGHT AND LICENSE

Top


Tk-Schedule documentation  | view source Contained in the Tk-Schedule distribution.