Beefy Boxes and Bandwidth Generously Provided by pair Networks
P is for Practical

Comment on

( #3333=superdoc: print w/replies, xml ) Need Help??
There are a couple of obvious ways. First the date is stored in a textvariable, so all you have to do is read $date. Second, if you read "perldoc Tk::ChooseDate", there is the get method. Example->

#!/usr/bin/perl use warnings; use strict; use Tk; use Tk::ChooseDate; #sets date thru the textvariable my $date = '2006/6/6'; my $mw = new MainWindow; $mw->geometry('200x50'); $mw->fontCreate('big', -family=>'courier', -weight=>'bold', -size=>int(-18*18/14)); my $cd = $mw->ChooseDate( -language =>'Italian', -font =>'big', # the label font -bg=>'lightsteelblue', #the label bg -textvariable=>\$date, -arrowcolor => 'black', -arrowactivecolor=>'yellow', -datecolor=> 'blue', -dateformat => 1, -orthodox => 0, -daysofweekcolor=>'lightgreen', -highlightcolor=> 'pink', -linecolor=> 'green', -yearcolor=> 'black', -command=>sub{print "$date\n"}, )->pack(-fill=>'x', -expand=>1); my $get_button = $mw->Button(-text=>'Get', -command=>\&get)->pack(); my $cdcan = $cd->Subwidget('canvas'); $cdcan->configure(-bg=>'black'); # bg of weekdays bar my $cdtop = $cd->Subwidget('toplevel'); $cdtop->configure(-bg=>'black'); # outline of popup # sets the date thru set $cd->set( y=>2005, m=>5, d=>5 ); MainLoop; sub get{ print "getting....\n"; print "$date\n\n"; print "getting1....\n"; print $cd->get,"\n\n"; }

I'm not really a human, but I play one on earth. Cogito ergo sum a bum

In reply to Re^3: Perl / Tk Calendar - advice please. by zentara
in thread Perl / Tk Calendar - advice please. by jdtoronto

Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":

  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.
  • Log In?

    What's my password?
    Create A New User
    and the web crawler heard nothing...

    How do I use this? | Other CB clients
    Other Users?
    Others musing on the Monastery: (8)
    As of 2018-10-19 18:37 GMT
    Find Nodes?
      Voting Booth?
      When I need money for a bigger acquisition, I usually ...

      Results (110 votes). Check out past polls.