Author image Anthony Fletcher
and 1 contributors


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


  use Tk;
  use Tk::Year;

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

                -year           => '1997',
                -first          => [0|1|2|3|4|5|6],


                -label          => 'Label',
                -command        => \&callback,


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



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.


-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.








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


See Tk for Perl/Tk documentation.


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


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.