in reply to Perl/Tk question

Hi Joel, Welcome to the Monastery. Hope you stick around for a while. A few comments.
1) add use strict and use warnings. It is just good practice to help keep your errors to a minimum (especially in Tk.
2) You can post even large bits of code, read the FAQ on posting and use the READMORE and CODE tags.
3) I would make the sub "scientific" create a new FRAME:
$scientific_frame =$main->Frame(-background=>'tan', -foreground=>'black', -relief=>'groove', -borderwidth=>3 )->pack(-side=>'bottom',-fill=>'both');

Then, modify (using "configure") The original menu option to call a different sub which does $scientific_frame->destroy(); then reconfigure the menu to call the original subroutine again if they want to turn scientific back on.
Have fun in the monastery!

Replies are listed 'Best First'.
Re^2: Perl/Tk question
by jdporter (Paladin) on Feb 09, 2005 at 06:31 UTC
    Even better is to toggle the "visibility" of the frame using pack (to make visible) and packForget (to make invisible).
      Hi!

      You can also do this with grid, gridForget (I'm just mentioning it because joelnackman uses grid).

      Regards, mawe

Re^2: Perl/Tk question
by gri6507 (Deacon) on Feb 09, 2005 at 12:51 UTC
    In my experience, I have found that Tk's destroy() method chews up (or leaks) memory. My general practice is never to use destroy() and implement "appearing" and "disappearing" of anything using one of the other methods posted below, especially if this is an app that is going to be changing its state many times in a single execution.

    Note: About the grid manager, as seen on node Tk::grid and gridRemove(), gridRemove() and gridForget() are NOT identical :-).