Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change
 
PerlMonks  

Re: Follow the window?

by serf (Chaplain)
on Jan 18, 2006 at 05:19 UTC ( #523898=note: print w/ replies, xml ) Need Help??


in reply to Follow the window?

Yes you certainly can:

#!/usr/bin/perl use strict; use warnings; use Tk; my $mw = MainWindow->new; my $button = $mw->Button( -text => "Hello World!", -command => sub{exit} ); $button->configure(-width =>30); $button->pack; $mw->geometry("+100+50"); # +X co-ord +Y co-ord MainLoop;
Note: you can also put WIDTHxHEIGHT before the +x+y if you need to.

Google:perl tk window position would have helped you here...

And you will find more (perhaps prettier) examples. e.g. adapted from here:

use strict; use warnings; use Tk; my $main = MainWindow->new; $main->Label(-text => 'Hello, world!')->pack; $main->Button( -text => 'Quit', -command => [$main => 'destroy'] )->pack; $main->geometry("+100+50"); # +X co-ord +Y co-ord MainLoop;


Comment on Re: Follow the window?
Select or Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others romping around the Monastery: (10)
As of 2015-07-06 23:43 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (85 votes), past polls