Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight
 
PerlMonks  

comment on

( [id://3333]=superdoc: print w/replies, xml ) Need Help??
I may be missing something hugely obvious here, but in the following simple test case:

use strict; use warnings; use Tk; my $mw = MainWindow->new(); my $frame = $mw->Frame->pack(); populate(); $frame->Button(-command=>\&recompose)->pack(); MainLoop; sub recompose { $frame->destroy(); $frame = $mw->Frame->pack; populate() } sub populate { for (1..10) { $frame->Label(-text=>$_)->pack(); } }

clicking the button makes the main window resize itself to absolute minimal size (so the numbers can't be seen). To see the numbers the window has to be manually resized. Is this supposed to happen? Is there a call I can make to get the MainWindow to programmatically resize based on its new contents?

TIA

Update: liverpole has pointed out by /msg that he isn't having this problem, and at that point I suddenly remember I'm running cvs Tk on Perl 5.9.5, which might explain the odd behaviour (OS is Debian Etch). Does anyone else not see the numbers 1..10 after clicking on the button? I've reworded the question a bit to try and make the problem clearer.

Update: zentara has rightly pointed out that I probably shouldn't be doing this anyway.

--------------------------------------------------------------

"If there is such a phenomenon as absolute evil, it consists in treating another human being as a thing."
John Brunner, "The Shockwave Rider".


In reply to Tk Mainwindow resizing after child destroyed by g0n

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 examining the Monastery: (7)
As of 2024-04-19 07:54 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found