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!
| [reply] [d/l] [select] |
Even better is to toggle the "visibility" of the frame using pack (to make visible) and packForget (to make invisible).
| [reply] [d/l] [select] |
| [reply] |
| [reply] |
To grey out the "cos" button, use
$cos->configure(-state => 'disabled');
with $cos being the Tk::Button object.
To be able to enable it again when cos is valid input again, you need to maintain the state of the math input in a variable. | [reply] [d/l] [select] |
| [reply] [d/l] |
Just use pack and packForget methods. This will hide, because the pack geometry manager no longer considers the widget. | [reply] |
| [reply] |