Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic
 
PerlMonks  

perl interactive shell, and GUI

by Zejian (Initiate)
on Oct 24, 2012 at 01:13 UTC ( [id://1000535]=perlquestion: print w/replies, xml ) Need Help??

Zejian has asked for the wisdom of the Perl Monks concerning the following question:

Hi, Monks,

My question is about perl interactive shell and GUI. 
I wrote a perl script with TK. Once Gui up, I can do many things through click the buttons, or menus.

But now, the buttons and menus become more and more. So I want to create a shell for the script. I can type the cmd in the shell, and then do the same thing as click in GUI.

I can use this to create a shell simply:
while (defined ($_= $psh_term->readline($psh_cmd ? "pa_shell >> " : "pa_shell $num_cmd> "))) {

But, how can I create a shell like that with a MainWindow opened by:
my $mw = MainWindow->new;

So, once I type cmd in the shell, something can happen in the $mw as I click the button in it.

Thanks,

Replies are listed 'Best First'.
Re: perl interactive shell, and GUI
by kcott (Archbishop) on Oct 24, 2012 at 09:11 UTC

    G'day Zejian,

    Welcome to the monastery.

    I'm not entirely certain what you're asking for. Here's some possible solutions:

    • ptksh - "... a perl/Tk shell to enter perl commands interactively. When one starts ptksh a MainWindow is automaticly created, along with a ptksh command window.".
    • The widget demo provides a frontend with links to a variety of demonstration scripts. You could perhaps write something based on this using your scripts instead of the demo scripts.
    • Tk::NoteBook would allow you to have a single MainWindow with separate and independent functionality assigned to each tab.

    Please modify your post so that code appears in code tags (<code>...</code>) and normal text is in paragraph tags (<p>...</p>). This is explained in more detail in: How do I post a question effectively?

    -- Ken

Re: perl interactive shell, and GUI
by zentara (Archbishop) on Oct 24, 2012 at 11:31 UTC

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others admiring the Monastery: (7)
As of 2024-03-19 01:59 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found