Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer

Re: perl Tk focus question

by dree (Monsignor)
on Aug 22, 2002 at 22:20 UTC ( #192193=note: print w/ replies, xml ) Need Help??

in reply to perl Tk focus question

You can use the grab() function for the second window.
See the example below:

use strict; use Tk; my $mw = MainWindow->new( -height => 385, -width => 575); $mw->title ("Example"); #---------- Adding Button my $button = $mw->Button( -text => "Click me!", -relief => "raised", "-command"=>\&Click_me, ); $button->place( -x => 215, -y => 295, -height => 22, -width => 90); MainLoop; sub Click_me { my $mw2 = $mw->Toplevel( -height => 123, -width => 245); $mw2->title (""); $mw2->grab(); }

Comment on Re: perl Tk focus question
Download Code

Log In?

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

How do I use this? | Other CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (4)
As of 2015-11-28 01:21 GMT
Find Nodes?
    Voting Booth?

    What would be the most significant thing to happen if a rope (or wire) tied the Earth and the Moon together?

    Results (737 votes), past polls