1PTKSH(1) perl/Tk Documentation PTKSH(1)
2
3
4
6 ptksh - Perl/Tk script to provide a graphical user interface for
7 testing Perl/Tk commands and scripts.
8
10 % ptksh ?scriptfile?
11 ... version information ...
12 ptksh> $b=$mw->Button(-text=>'Hi',-command=>sub{print 'Hi'})
13 ptksh> $b->pack
14 ptksh> o $b
15 ... list of options ...
16 ptksh> help
17 ... help information ...
18 ptksh> exit
19 %
20
22 ptksh is a perl/Tk shell to enter perl commands interactively. When
23 one starts ptksh a MainWindow is automaticly created, along with a
24 ptksh command window. One can access the main window by typing
25 commands using the variable $mw at the 'ptksh> ' prompt of the command
26 window.
27
28 ptksh supports command line editing and history. Just type "<Up>" at
29 the command prompt to see a history list. The last 50 commands entered
30 are saved, then reloaded into history list the next time you start
31 ptksh.
32
33 ptksh supports some convenient commands for inspecting Tk widgets. See
34 below.
35
36 To exit ptksh use: "exit".
37
38 ptksh is *not* a full symbolic debugger. To debug perl/Tk programs at
39 a low level use the more powerful perl debugger. (Just enter ``O tk''
40 on debuggers command line to start the Tk eventloop.)
41
43 History
44 Press <Up> (the Up Arrow) in the perlwish window to obtain a gui-based
45 history list. Press <Enter> on any history line to enter it into the
46 perlwish window. Then hit return. So, for example, repeat last
47 command is <Up><Enter><Enter>. You can quit the history window with
48 <Escape>. NOTE: history is only saved if exit is "graceful" (i.e. by
49 the "exit" command from the console or by quitting all main
50 windows--NOT by interrupt).
51
52 Debugging Support
53 ptksh provides some convenience function to make browsing in perl/Tk
54 widget easier:
55
56 ?, or h
57 displays a short help summary.
58
59 d, or x ?args, ...?
60 Dumps recursively arguments to stdout. (see Data::Dumper). You
61 must have <Data::Dumper> installed to support this feature.
62
63 x was introduced for perl debugger compatibility.
64
65 p ?arg, ...?
66 appends "|\n" to each of it's arguments and prints it. If value is
67 undef, '(undef)' is printed to stdout.
68
69 o $widget ?-option ...?
70 prints the option(s) of $widget one on each line. If no options
71 are given all options of the widget are listed. See Tk::options
72 for more details on the format and contents of the returned list.
73
74 o $widget /regexp/
75 Lists options of $widget matching the regular expression regexp.
76
77 u ?class?
78 If no argument is given it lists the modules loaded by the commands
79 you executed or since the last time you called "u".
80
81 If argument is the empty string lists all modules that are loaded
82 by ptksh.
83
84 If argument is a string, ``text'' it tries to do a ``use
85 Tk::Text;''.
86
87 Packages
88 Ptksh compiles into package Tk::ptksh. Your code is eval'ed into
89 package main. The coolness of this is that your eval code should not
90 interfere with ptksh itself.
91
92 Multiline Commands
93 ptksh will accept multiline commands. Simply put a "\" character
94 immediately before the newline, and ptksh will continue your command
95 onto the next line.
96
97 Source File Support
98 If you have a perl/Tk script that you want to do debugging on, try
99 running the command
100
101 ptksh> do 'myscript';
102
103 -- or (at shell command prompt) --
104
105 % ptksh myscript
106
107 Then use the perl/Tk commands to try out different operations on your
108 script.
109
111 Looks for your .ptksh_history in the directory specified by the $HOME
112 environment variable ($HOMEPATH on Win32 systems).
113
115 .ptksh_init
116 If found in current directory it is read in an evaluated after the
117 mainwindow $mw is created. .ptksh_init can contain any valid perl
118 code.
119
120 ~/.ptksh_history
121 Contains the last 50 lines entered in ptksh session(s).
122
124 It is best not to use "my" in the commands you type into ptksh. For
125 example "my $v" will make $v local just to the command or commands
126 entered until <Return> is pressed. For a related reason, there are no
127 file-scopy "my" variables in the ptksh code itself (else the user might
128 trounce on them by accident).
129
131 Tk::MainLoop function interactively entered or sourced in a init or
132 script file will block ptksh.
133
135 Tk perldebug
136
138 VERSION 2.03
139
141 Mike Beller <beller@penvision.com>, Achim Bohnet <ach@mpe.mpg.de>
142
143 Copyright (c) 1996 - 1998 Achim Bohnet and Mike Beller. All rights
144 reserved. This program is free software; you can redistribute it
145 and/or modify it under the same terms as Perl itself.
146
147
148
149Tk804.036 2023-07-21 PTKSH(1)