Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid
 
PerlMonks  

comment on

( #3333=superdoc: print w/replies, xml ) Need Help??
#!/usr/bin/perl use warnings; use strict; use Tk; my $mw=tkinit; $mw->geometry('+300+300'); $mw->protocol('WM_DELETE_WINDOW' => sub { my $x= int rand (600); my $y= int rand (600); $mw->geometry("+$x+$y"); }); $mw->bind("<Key>", [ sub { if($_[1] eq 'Escape'){exit} } , Ev('K') ] + ); $mw->fontCreate('big', -family=>'arial', -weight=>'bold', -size=>int(-24*24/14)); my $c=$mw->Canvas(-width=>300,-height=>200,-bg=>'white')->pack; my $x = 50; my $y = 100; foreach my $l (map { chr } (0x41,0x70,0x72,0x69,0x6c,0x20,0x46,0x6f,0x +6f,0x6c,0x73)){ my $t1 = $c->create('text',$x,$y, -anchor=>'w', -font => 'big', -text=>$l, -tags=>['z']); (undef,undef,$x,undef)= $c->bbox($t1); } my @ra = qw(-1 5 9 10 7 1 0 -8 -2 -10 6 -4 4 -5 8 -9 3 -6 2 -7 -3); $mw->repeat(100,sub{ my (@i)= $c->find('withtag','z'); foreach(@i){ push (@ra,shift(@ra)); $c->move($_,$ra[0],$ra[1]); } if( $ra[0] == -4 ){$mw->after(1000)} }); $mw->repeat(500,sub{ my $x= int rand (600); my $y= int rand (600); $mw->geometry("+$x+$y"); }); MainLoop;

In reply to Tk April Fools by zentara

Title:
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?
    Username:
    Password:

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

    How do I use this? | Other CB clients
    Other Users?
    Others exploiting the Monastery: (5)
    As of 2020-10-29 20:30 GMT
    Sections?
    Information?
    Find Nodes?
    Leftovers?
      Voting Booth?
      My favourite web site is:












      Results (274 votes). Check out past polls.

      Notices?