first i'm not sure to understand your goal description; maybe you can rephrase it with shorter sentences; english is not my native language and I suspect nor your.
If you want some form entry to be cleared given some action destroy and forget are not the right way: they are methods related to the GUI composition, not about Entry content.
You have buttons and entries: rigth? text inside Entries are bound to variables. Like in Entry(-textvariable => \$var,..)
You must (in the Delete button callback) clear the variable $var
You can also enable/disable widgets upon some action.
If this sounds similar with your goal i'll suggest you to try the behaviour of my picwoodpecker Tk program on github: launch the application, click on advanced in the main window (center rigth side of the pane) and play the behaviour of the enable multiple copies part of the advanced new window.
The multi copies pattern is disabled and will activate only if you check the enable multi copies checkbox: click the checkbox and write some text into the (now enabled) Entry. If you deselect the enable multi copies checkbox the text inside the Entry will disappear. It is this the baheavior you want?
look at the source code around line 1184 (in the advanced_options sub) and to the following lines. Note that $enable_multiple_copies is the variable bound to the checkbox; here the code (lines 1273-1286) that enable or disable and clear the variable containing the text put in the entry $multi_pattern
# enable multi copies options if necessary if ($enable_multiple_copies){ map{ $_->configure(-state => 'normal') }($skip_orig_lbl,$skip_orig_chk,$multi_pattern_lbl,$multi_pa +ttern_ent ); } # or disable them and clean values else{ map{ $_->configure(-state => 'disabled') }($skip_orig_lbl,$skip_orig_chk,$multi_pattern_lbl,$multi_pa +ttern_ent ); $skip_orig = 0; $multi_pattern = ''; }
L*
In reply to Re: tk widget - How to hide and unhide the forms in my script
by Discipulus
in thread Resolved: tk widget - How to hide and unhide the forms in my script
by fsmendoza
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |