Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses
 
PerlMonks  

Re^2: Perl / Tk Calendar - advice please.

by Anonymous Monk
on Apr 01, 2012 at 04:44 UTC ( #962832=note: print w/replies, xml ) Need Help??


in reply to Re: Perl / Tk Calendar - advice please.
in thread Perl / Tk Calendar - advice please.

Hi, How we get subroutine working, e.g. accept values for %a and %e when we press calendar button Insted anonymous subroutine I was using named subrutine, but not working Could someone help?
  • Comment on Re^2: Perl / Tk Calendar - advice please.

Replies are listed 'Best First'.
Re^3: Perl / Tk Calendar - advice please.
by zentara (Archbishop) on Apr 01, 2012 at 14:25 UTC
    The %e and %a are just formatting strings. Read perldoc Tk::Month to see how to change it. To get rid of the anonymous sub, it's simple, try this. I showed how to see what is passed to the sub. If this dosn't answer your question, be more specific in what you need to do.
    #!/usr/bin/perl use warnings; use strict; use Tk; use Tk::Month; my $mw = MainWindow->new(); my $month = "November"; my $year = "2006"; my $m = $mw->Month( -printformat => '%a %e', -includeall => 0, -month => $month, -year => $year, -command => \&mysub ); $m->pack; MainLoop; sub mysub { print scalar @_,"\n"; print $_[0],"\n"; print $_[1],"\n"; print @{$_[1]},"\n"; my ($ym, $wd) = @_; my ($month, $year) = split( /\s+/ , $ym ); my ($wday, $date) = split( /\s+/ , $wd->[0] ); print "$wday, $month $date $year\n"; }

    I'm not really a human, but I play one on earth.
    Old Perl Programmer Haiku ................... flash japh

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://962832]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others examining the Monastery: (8)
As of 2020-11-30 20:50 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?