NateTut-

When I run your script, I don't see the buttons disappear. Instead I see the mainwindow resizing to be very small. If I manually expand the window, the buttons are still there. This is probably due to the fact that you generate a random chapter number if one isn't given (as the first argument). In the example script we only have 3 chapters of data, and I was given the random number of 58 (you may want to put in error checking so that the random number generated falls within the number of chapters you have in your data, instead of a hardcoded number).

Ok, that was something unique to your example script. If I force the script to start at chapter 1 (by giving it the number one as an argument test.pl 1, it seems to work correctly for me on the first and second chapters. The third chapter is where things get goofed up.

The first thing I noticed was how you put the text into the text window (tie *STDOUT, ref $OutputText, $OutputText;). I thought maybe that had something to do with the problem, so I changed your script to simply use $OutputText->insert('end', "formatted text");. That didn't fix the problem, but I'd recommend doing it this way (unless there's a good reason not to) - It's just easier to understand.

Then, I commented out where you set the mainwindow geometry and ran it again. Now it works fine, except the mainwindow stays the same size all the time.

It seems that when you set the mainwindow geometry below a certain threshold, it won't reset to something bigger anymore. I would suggest a minimum width and height for your main window.

Hope that helps.

-Craig


In reply to Re: Disappearing Tk buttons by cmv
in thread Disappearing Tk buttons by NateTut

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



  • 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:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.