Hello fsmendoza

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*

There are no rules, there are no thumbs..
Reinvent the wheel, then learn The Wheel; may be one day you reinvent one of THE WHEELS.

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

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.