Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw
 
PerlMonks  

Re^4: Perl/Tk code structure

by elef (Friar)
on Jan 11, 2012 at 09:24 UTC ( #947315=note: print w/ replies, xml ) Need Help??


in reply to Re^3: Perl/Tk code structure
in thread Perl/Tk code structure

Thanks.
However, I'm afraid that your definition of "complex" differs quite a bit from mine. Most of the code of the module went right over my head. Even if I ignore everything outside of sub gui {...} on the assumption that I don't need to know anything about how the STDIN/STDOUT redirection chicanery works, most of the code inside the sub is also Greek to me. I get the three Tk widgets and have a vague idea about what the rest does, but no clue how.
I'm afraid that the recipe for setting up a radiobutton widget based on what the original script prints to STDOUT and passing the selection to its STDIN would begin with "spend a week reading a couple of hundred pages of impossible to find, indecipherable documentation and writing/debugging test scripts" and may end with "give up".


Comment on Re^4: Perl/Tk code structure
Download Code
Re^5: Perl/Tk code structure
by BrowserUk (Pope) on Jan 11, 2012 at 09:36 UTC

    Hm. Is that a request for further explanation or a dismissal of the idea as too much complex "chicanary"?


    With the rise and rise of 'Social' network sites: 'Computers are making people easier to use everyday'
    Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
    "Science is about questioning the status quo. Questioning authority".
    In the absence of evidence, opinion is indistinguishable from prejudice.

    The start of some sanity?

      That's a good question, I'm not sure. It'd be nice if I could implement this idea as it seems to be the best solution to the problem. But from your sample it seems that I would need you to hold my hand most of the way through it - or I'd need to read and absorb most of "Advanced Perl Programming", which I find an even less enticing option than contorting my original script around Tk's logic. I assume you probably don't want to do it, and anyway, I don't like to ask people to do my projects for me and/or write detailed 10-page howtos for solving my specific problem...
      If you think you can enlighten my about how to do this in a couple of comments added to the above code and add the code for generating a widget based on specific strings printed to the original script's STDOUT, that'd be great. I was just reluctant to ask you to do it because it's too much like spoonfeeding.
      The danger is that if something breaks or needs changing in the interface between the original script and the GUI module, I won't be able to fix it, but I guess that's not very likely.
        I was just reluctant to ask you to do it because it's too much like spoonfeeding.

        The whole point of this place is to help people learn, so never be reluctant to ask questions. You'll occasionally garner a few downvotes from those who've forgotten that they also 'didn't know' at some point in the past. But as XP is worth less than the energy it takes to click a vote button, don't sweat it.

        And most of us here are happy to answer questions.

        If you think you can enlighten my about how to do this in a couple of comments added to the above code and add the code for generating a widget based on specific strings printed to the original script's STDOUT, that'd be great.

        I don't add comments up front because: a) it is a lot of extra effort to do well, which all too often is wasted when the OP chooses someone else's solution; b) I don't know what level the questioner is at -- what bits they might need explaining and what not -- and trying to explain everything is impossible. I'd need to replicate the 100,000+ lines of the Perl documentation, and risk patronising you along the way with detailed explanations of stuff you already understand.

        So, enough meta discussion. Which bits of the code I posted need further explanation? You said you had some experience of TK, so I don't want to waste time explaining stuff you understand.

        How about we abandon this subthread, and you post a few questions as a direct reply to the code I posted and we go from there.

        (ps. Have you actually tried just adding the 3 lines to your existing script and putting the module in the local directory, just to see how that works?)


        With the rise and rise of 'Social' network sites: 'Computers are making people easier to use everyday'
        Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
        "Science is about questioning the status quo. Questioning authority".
        In the absence of evidence, opinion is indistinguishable from prejudice.

        The start of some sanity?

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others chilling in the Monastery: (7)
As of 2014-09-16 01:11 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My favorite cookbook is:










    Results (155 votes), past polls