mortbarsky has asked for the wisdom of the Perl Monks concerning the following question:
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Multiple TK::BrowseEntry
by zentara (Cardinal) on Apr 02, 2012 at 18:48 UTC | |
I'm not really a human, but I play one on earth. Old Perl Programmer Haiku ................... flash japh | [reply] [d/l] |
by mortbarsky (Initiate) on Apr 03, 2012 at 18:30 UTC | |
Sorry, here's a more detailed question.... I need to add multiple BrowseEntry to a table and get the selection, and the corresponding value of $layer. The table is built in a loop. I thought I could create a hash key to store when a selection is made in the drop down, but I don't know how to relate it to the $layer. (Why do I get the small window with the script name?) Here's an example
| [reply] [d/l] |
by zentara (Cardinal) on Apr 03, 2012 at 20:51 UTC | |
Yeah, you have a tough bug in there, probably due to you trying to stuff too much into a dialogbox. First, to remove the small window, you can withdraw the mainwindow, and not use MainLoop. Thats easy. The hard problem is that the Dialog dosn't seem to recognize global variables. I wonder if you really need to use a Dialog to put all that table data in there? Can't you just use the mainwindow or a toplevel? It may resolve the problem which I show in my modified version of your code. You can see, within the Dialog the values for my hash %be get printed, but it is not recognized elsewhere, like when you press the ShowValues button. That stumps me, and maybe a smarter monk may know the secret. :-) If it was me, I would rewrite it without the Dialog. Read more... (7 kB)
I'm not really a human, but I play one on earth. Old Perl Programmer Haiku ................... flash japh | [reply] [d/l] |
|
Re: Multiple TK::BrowseEntry
by zentara (Cardinal) on Apr 04, 2012 at 13:42 UTC | |
After a night's sleep, I found a way for you to get the values out of the BrowseEntrys. I still don't know why the global hash didn't work for storing the \$var, but you can resort to pulling the value directly from the BrowseEntry's entry subwidget. Below are 2 versions, the first using the DialogBox, and the second just using a mainwindow, in the readmore. Look at the sub for the $showbutton for the method.
Read more... (6 kB)
I'm not really a human, but I play one on earth. Old Perl Programmer Haiku ................... flash japh | [reply] [d/l] [select] |