Dear fsmendoza,

Glad to hear that you are making progress! You didn't post your code, but I have a good guess as to what is happening...

My code was a demo, the main purpose of which, was to show you how to "packForget()" and demo what that does. Hide and unhide are for whole windows; pack and packForget are more appropriate for modifying a window that remains on the screen. I put the packForget() code into the subroutine password_reset(). You shouldn't put it there. I did it that way as just a quick demo "hack".

Normally you want the selected option, like password_reset to remain visible to user until he selects another option. Not have it "go away" at the confirmation window and force the user to re-select that option again from the File menu. Maybe the user wants to reset the passwords on multiple accounts? Or perhaps the user wants to work with a window to create multiple accounts?

Re-iterating a few points: You should group the objects for each option into a frame. You will wind up with 3 frames, add, delete, reset. pack and unpack those frames as per the user selection. You can have some variable like "$currently_displayed_option" which has either "nothing" (undef) or a reference to the currently_displayed frame.

When the user selects an option, you want to packForget the currently displayed option (if any). Then display the "new option" that the user selected (of course updating the "$currently_displayed_option").

You are getting "option widget on top of option widget" because the rule that only one or zero options should be displayed at a time is being violated.

Hope this helps.


In reply to Re^5: tk widget - How to hide and unhide the forms in my script by Marshall
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.