#!/usr/bin/perl -w
use Tk;
use strict;
my @Custom_Border = ();
my @frames = ();
my ($x, $y) = 0;
my $flag = 0;
my $mw = MainWindow->new(-background=>'#000000',
-title=>"You Should Never See This.");
$mw->overrideredirect(1);
$frames[0] = $mw->Frame()->pack(-fill=>'both');
$frames[1] = $mw->Frame()->pack(-fill=>'both');
$frames[2] = $mw->Frame()->pack(-fill=>'both');
$Custom_Border[0] = $frames[0]->Label(-background=>'#FFFFFF',
-borderwidth=>0,
-text=>"Top")->pack(-side=>'top',
-fill=>'both');
$Custom_Border[1] = $frames[1]->Label(-background=>'#FFFFFF',
-borderwidth=>0,
-text=>"Left")->pack(-side=>'left',
-anchor=>'w',
-fill=>'both');
$frames[3] = $frames[1]->Frame()->pack(-side=>'left',-fill=>'both');
$Custom_Border[2] = $frames[1]->Label(-background=>'#FFFFFF',
-borderwidth=>0,
-text=>"Right")->pack(-side=>'right',
-anchor=>'e',
-fill=>'both');
$Custom_Border[3] = $frames[2]->Label(-background=>'#FFFFFF',
-borderwidth=>0,
-text=>"Bottom")->pack(-side=>'bottom',
-fill=>'both');
my $Q_Button = $frames[3]->Button(-text=>"Quit",-command=>sub {$mw->de
+stroy();})->pack();
$Custom_Border[0]->bind('<Button-1>',sub {$flag = 1;});
$Custom_Border[0]->bind('<ButtonRelease-1>',sub {$flag = 0;});
$Custom_Border[0]->bind('<Motion>',sub {
if ($flag) {
($x,$y) = $Custom_Border[0]->pointerxy;
$mw->geometry("+".($x-5)."+".($y-5));
printf "Moving to %d,%d\n",$Custom_Border[0]->pointerxy;
$mw->update;
}
});
MainLoop();
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, details, 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, summary, 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: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.