XP is just a number | |
PerlMonks |
Can't Erase Previous Menu Buttonby socrtwo (Sexton) |
on Nov 13, 2010 at 23:12 UTC ( [id://871261]=perlquestion: print w/replies, xml ) | Need Help?? |
socrtwo has asked for the wisdom of the Perl Monks concerning the following question: I'm writing a simple GUI Perl Tk converter of corrupt Open Office files into salvaged text and an attempt at a recovered version of the files. I have a Tk text area which displays the text and a menu bar that shows a button which when pushed launches the attempts at a recovered version of the file using whatever program is set to open the Open Office file format in question. These all work fine. The problem is, after the first file recovery, with all subsequent files opened, the menubuttons keep piling up, and I can't erase the old ones. The menu buttons all try to launch the newest recovered file when pushed, not even pointing to the previous files recovered. I have tried to use "unpost", "destroy" and "forget" combined with "pack" with all sorts of arrows and double arrow with no luck. Of course I have no idea what I'm doing but the fun part is over now and frustration is seeping in. I'm just a hacker newbie, and I'm not even sure if the button is a Tk::Menubutton or a Tk::Menu::Button as I have both modules referenced in the beginning, from borrowing from other scripts I hacked out before. Anyway here is my button code which is part of the "Main Loop"/"sub menuopenClicked" section of my script which is launched when a user chooses a file from the Open choice on the simple File menu: $but = $mbar -> Button(-label=>"Launch $ruslcbasename", -command =>\&recovered);
Back to
Seekers of Perl Wisdom
|
|