Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change
 
PerlMonks  

Re^4: tk widget - How to hide and unhide the forms in my script

by fsmendoza (Novice)
on Mar 10, 2017 at 09:22 UTC ( [id://1184155]=note: print w/replies, xml ) Need Help??


in reply to Re^3: tk widget - How to hide and unhide the forms in my script
in thread Resolved: tk widget - How to hide and unhide the forms in my script

Dear Marshall,

Thank you so much for sharing your code and it was great. and its working now compare to my code So when I type something and hit enter or press reset it will clear the current form to blank window and I can select again new options without any issue

my new assignement now is I'm looking to enhance the TK gui form script that I created. Because if you run the script and I click the 'File->Add user' then suddenly for example I change my mind to click 'File-Reset user' instead. The label description will display on top of each other.

  • Comment on Re^4: tk widget - How to hide and unhide the forms in my script

Replies are listed 'Best First'.
Re^5: tk widget - How to hide and unhide the forms in my script
by Marshall (Canon) on Mar 10, 2017 at 21:19 UTC
    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.

      Dear Marshall,

      Thank you for the info and advice. once I have finish my script I will share it here so that other can reference to it.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1184155]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others perusing the Monastery: (6)
As of 2024-04-24 04:07 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found