The London Perl and Raku Workshop takes place on 26th Oct 2024. If your company depends on Perl, please consider sponsoring and/or attending.

NAME

Tk::Year - Calendar widget which shows one year at a time.

SYNOPSIS

  use Tk;
  use Tk::Year;

  $m = $parent->Year(
                -year           => '1997',
                -cols           => 3,
                -sep            => 5,
                -first          => [0|1|2|3|4|5|6],
                -command        => \&press,
        )->pack();

  $m->configure(
                -year           => '1997',
                -first          => [0|1|2|3|4|5|6],
  );

  $m->advance(<number-of-years>);

  $m->separator();
  $m->command(
                -label          => 'Label',
                -command        => \&callback,
  );

DESCRIPTION

Tk::Year is a general purpose calendar widget which shows one year at a time and allowes user defined button actions.

METHODS

$m->advance(<number-of-years>);

This advances the year shown by the specified number of years; negative numbers go backwards.

    The title (shouwing the current year) is a Tk::Menubutton and all the Tk::Menubutton actions can be applied to Tk::Year.

OPTIONS

-year => 'year'

Sets the required year. The default is the current year.

-cols => 'columns'

Sets the number of columns used to display the year. The default is 3.

-sep => 'sep'

Sets the separation between the columns of months. The default is 5 pixels.

-command => \&press

Set the command to execute when a button is pressed. This function must accept a string (the title of the Month widget) and an array of arrays of dates. Each date is of the format specified by the -printformat option. The default is to print out the list on standard output.

-first

-buttonhighlightcolor

-buttonhighlightbackground

-buttonfg

-buttonbg

-buttonbd

-buttonrelief

These options apply to each of the Tk::Month widgets. See Tk::Month for details.

SEE ALSO

See Tk for Perl/Tk documentation.

AUTHOR

Anthony R Fletcher, <a r i f 'a-t' c p a n . o r g>

COPYRIGHT AND LICENSE

Copyright (C) 1998-2014 by Anthony R Fletcher. All rights reserved. Please retain my name on any bits taken from this code. This code is supplied as-is - use at your own risk.

This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself, either Perl version 5.16.3 or, at your option, any later version of Perl 5 you may have available.