in reply to Disappearing Tk buttons

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