Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked
 
PerlMonks  

comment on

( [id://3333]=superdoc: print w/replies, xml ) Need Help??
First of all, don't use multiple MainWindows. It's certainly possible, but parts of Tk aren't reliable when used with multiple MainWindows. Your best bet is to use Toplevels. You create one MainWindow and then create the other windows by making Toplevels from the MainWindow
my $win = $mw->Toplevel(-title => 'ererree');
If you don't want to have one and only one MainWindow (remember that closing a MainWindow exits your program), you can use only Toplevels and call $mw->withdraw immediately after creating the MainWindow. Your MainWindow will then be invisible and you'll only have Toplevels, which can be closed without requring the program to end.

As far as your actual question, try $win->focus, where $win is the name of the window you want to bring to the front.


The computer can't tell you the emotional story. It can give you the exact mathematical design, but what's missing is the eyebrows. - Frank Zappa

In reply to Re: Tk MainWindow from module Foo on to appear on top by batkins
in thread Tk MainWindow from module Foo on to appear on top by aplonis

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



  • Are you posting in the right place? Check out Where do I post X? to know for sure.
  • Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
    <code> <a> <b> <big> <blockquote> <br /> <dd> <dl> <dt> <em> <font> <h1> <h2> <h3> <h4> <h5> <h6> <hr /> <i> <li> <nbsp> <ol> <p> <small> <strike> <strong> <sub> <sup> <table> <td> <th> <tr> <tt> <u> <ul>
  • Snippets of code should be wrapped in <code> tags not <pre> tags. In fact, <pre> tags should generally be avoided. If they must be used, extreme care should be taken to ensure that their contents do not have long lines (<70 chars), in order to prevent horizontal scrolling (and possible janitor intervention).
  • Want more info? How to link or How to display code and escape characters are good places to start.
Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others sharing their wisdom with the Monastery: (3)
As of 2024-04-25 09:27 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found