"Fossies" - the Fresh Open Source Software Archive

Member "SAOImageDS9/tkcon/docs/tkcon.1.man" (13 Nov 2019, 12524 Bytes) of package /linux/misc/ds9.8.1.tar.gz:


As a special service "Fossies" has tried to format the requested text file into HTML format (style: standard) with prefixed line numbers. Alternatively you can here view or download the uninterpreted source code file.

    1 [comment {-*- tcl -*- tkcon manpage}]
    2 [manpage_begin tkcon 1 2.5]
    3 [copyright {Jeffrey Hobbs (jeff at hobbs.org)}]
    4 [moddesc   {TkCon}]
    5 [titledesc {Tk console replacement}]
    6 
    7 [description]
    8 [para]
    9 TkCon is a replacement for the standard console that comes with Tk
   10 (on Windows/Mac, but also works on Unix).
   11 The console itself provides many more features than the standard
   12 console.
   13 TkCon works on all platforms where Tcl/Tk is available.
   14 It is meant primarily to aid one when working with the little
   15 details inside Tcl and Tk, giving Unix users the GUI console
   16 provided by default in the Mac and Windows Tk.
   17 
   18 [list_begin definitions]
   19 [call [cmd tkcon] [lb]\{[arg option] [arg value] | [arg tcl_script]\} ...[rb]]
   20 [list_end]
   21 
   22 [section OPTIONS]
   23 [para]
   24 Except for [cmd -rcfile], command line arguments are handled after
   25 the TkCon resource file is sourced, but before the slave
   26 interpreter or the TkCon user interface is initialized.
   27 
   28 [para]
   29 [cmd -rcfile] is handled right before it would be sourced,
   30 allowing you to specify any alternate file.
   31 Command line arguments are passed to each new console and
   32 will be evaluated by each.
   33 To prevent this from happening, you have to say
   34 
   35 [example_begin]
   36 tkcon main set argv {}; tkcon main set argc 0
   37 [example_end]
   38 
   39 [para]
   40 For these options, any unique substring is allowed.
   41 
   42 [list_begin definitions]
   43 [def "[cmd -argv] (also [cmd --])"]
   44 Causes TkCon to stop evaluating arguments and set the remaining
   45 args to be argv/argc (with [cmd --] prepended).
   46 This carries over for any further consoles.
   47 This is meant only for wrapping TkCon
   48 around programs that require their own arguments.
   49 
   50 [def "[cmd -color-<color>] [arg color]"]
   51 Sets the requested color type to the specified color for tkcon.
   52 See [cmd tkconrc](5) for the recognized [cmd <color>] names.
   53 
   54 [def "[cmd -eval] [arg tcl_script] (also [cmd -main] or [cmd -e])"]
   55 A Tcl script to eval in each main interpreter.
   56 This is evaluated after the resource file is loaded and the
   57 slave interpreter is created.
   58 Multiple [cmd -eval] switches will be recognized (in order).
   59 
   60 [def "[cmd -exec] [arg slavename]"]
   61 Sets the named slave that tkcon operates in.
   62 In general, this is only useful to set to [arg {""}] (empty),
   63 indicating to tkcon to avoid the multi-interpreter model and
   64 operate in the main environment.
   65 When this is empty, any further arguments will be only used
   66 in the first tkcon console and not passed onto further new consoles.
   67 This is useful when using tkcon as a console for extended wish
   68 executables that don't load there commands into slave interpreters.
   69 
   70 [def "[cmd -font] [arg font]"]
   71 Sets the font that tkcon uses for its text windows.
   72 If this isn't a fixed width font, tkcon will override it.
   73 
   74 [def "[cmd -nontcl] [arg TCL_BOOLEAN]"]
   75 Sets [cmd ::tkcon::OPT(nontcl)] to [arg TCL_BOOLEAN] (see
   76 [cmd tkconrc](5)).
   77 Needed when attaching to non-Tcl interpreters.
   78 
   79 [def "[cmd -package] [arg package_name] (also [cmd -load])"]
   80 Packages to automatically load into the slave interpreters (i.e. "Tk").
   81 
   82 [def "[cmd -rcfile] [arg filename]"]
   83 Specify an alternate tkcon resource file name.
   84 
   85 [def "[cmd -root] [arg widgetname]"]
   86 Makes the named widget the root name of all consoles (i.e. .tkcon).
   87 
   88 [def "[cmd -slave] [arg tcl_script]"]
   89 A Tcl script to eval in each slave interpreter.
   90 This will append the one specified in the tkcon resource file, if any.
   91 
   92 [list_end]
   93 
   94 [section {KEY BINDINGS}]
   95 [para]
   96 Most of the bindings are the same as for the [cmd text] widget.
   97 Some have been modified to make sure that the integrity of the
   98 console is maintained.
   99 Others have been added to enhance the usefulness of the console.
  100 Only the modified or new bindings are listed here.
  101 
  102 [list_begin definitions]
  103 
  104 [def "[cmd Control-x] or [cmd Cut] (on Sparc5 keyboards)"]
  105 Cut.
  106 
  107 [def "[cmd Control-c] or [cmd Copy] (on Sparc5 keyboards)"]
  108 Copy.
  109 
  110 [def "[cmd Control-v] or [cmd Paste] (on Sparc5 keyboards)"]
  111 Paste.
  112 
  113 [def [cmd Insert]]
  114 Insert (duh).
  115 
  116 [def [cmd Up]]
  117 Goes up one level in the commands line history when cursor is on
  118 the prompt line, otherwise it moves through the buffer.
  119 
  120 [def [cmd Down]]
  121 Goes down one level in the commands line history when cursor
  122 is on the last line of the buffer, otherwise it moves through the buffer.
  123 
  124 [def [cmd Control-p]]
  125 Goes up one level in the commands line history.
  126 
  127 [def [cmd Control-n]]
  128 Goes down one level in the commands line history.
  129 
  130 [def [cmd Tab]]
  131 Tries to expand file path names, then variable names, then proc names.
  132 
  133 [def [cmd Escape]]
  134 Tries to expand file path names.
  135 
  136 [def [cmd Control-P]]
  137 Tries to expand procedure names.
  138 The procedure names will be those that are actually in the attached
  139 interpreter (unless nontcl is specified, in which case it always
  140 does the lookup in the default slave interpreter).
  141 
  142 [def [cmd Control-V]]
  143 Tries to expand variable names (those returned by [lb]info vars[rb]).
  144 It's search behavior is like that for procedure names.
  145 
  146 [def "[cmd Return] or [cmd Enter]"]
  147 Evaluates the current command line if it is a complete command,
  148 otherwise it just goes to a new line.
  149 
  150 [def [cmd Control-a]]
  151 Go to the beginning of the current command line.
  152 
  153 [def [cmd Control-l]]
  154 Clear the entire console buffer.
  155 
  156 [def [cmd Control-r]]
  157 Searches backwards in the history for any command that contains
  158 the string in the current command line.
  159 Repeatable to search farther back.
  160 The matching substring off the found command will blink.
  161 
  162 [def [cmd Control-s]]
  163 As above, but searches forward (only useful if you searched too far back).
  164 
  165 [def [cmd Control-t]]
  166 Transposes characters.
  167 
  168 [def [cmd Control-u]]
  169 Clears the current command line.
  170 
  171 [def [cmd Control-z]]
  172 Saves current command line in a buffer that can be retrieved
  173 with another [cmd Control-z].
  174 If the current command line is empty, then any saved command
  175 is retrieved without being overwritten, otherwise the current
  176 contents get swapped with what's in the saved command buffer.
  177 
  178 [def [cmd Control-Key-1]]
  179 Attaches console to the console's slave interpreter.
  180 
  181 [def [cmd Control-Key-2]]
  182 Attaches console to the console's master interpreter.
  183 
  184 [def [cmd Control-Key-3]]
  185 Attaches console to main TkCon interpreter.
  186 
  187 [def [cmd Control-A]]
  188 Pops up the "About" dialog.
  189 
  190 [def [cmd Control-N]]
  191 Creates a new console. Each console has separate state, including
  192 it's own widget hierarchy (it's a slave interpreter).
  193 
  194 [def [cmd Control-q]]
  195 Close the current console OR Quit the program (depends on the
  196 value of [cmd ::tkcon::TKCON(slaveexit)]).
  197 
  198 [def [cmd Control-w]]
  199 Closes the current console.
  200 Closing the main console will exit the program (something has
  201 to control all the slaves...).
  202 
  203 [list_end]
  204 
  205 [para]
  206 TkCon also has electric bracing (similar to that in emacs).
  207 It will highlight matching pairs of {}'s, [lb][rb]'s, ()'s and ""'s.
  208 For the first three, if there is no matching left element for the right,
  209 then it blinks the entire current command line.
  210 For the double quote, if there is no proper match then it just blinks
  211 the current double quote character.
  212 It does properly recognize most escaping (except escaped escapes),
  213 but does not look for commenting (why would you interactively
  214 put comments in?).
  215 
  216 [section COMMANDS]
  217 [para]
  218 There are several new procedures introduced in TkCon to improve
  219 productivity and/or account for lost functionality in the Tcl
  220 environment that users are used to in native environments.
  221 There are also some redefined procedures.
  222 Here is a non-comprehensive list:
  223 
  224 [list_begin definitions]
  225 
  226 [def "[cmd alias] ?[arg sourceCmd] [arg targetCmd] ?[arg arg] [arg arg] ...??"]
  227 Simple alias mechanism.
  228 It will overwrite existing commands.
  229 When called without args, it returns current aliases.
  230 Note that TkCon makes some aliases for you (in slaves).
  231 Don't delete those.
  232 
  233 [def "[cmd clear] ?[arg percentage]?"]
  234 Clears the text widget.
  235 Same as the <[cmd Control-l]> binding, except this will accept a
  236 percentage of the buffer to clear (1-100, 100 default).
  237 
  238 [def "[cmd dir] ?[arg -all]? ?[arg -full]? ?[arg -long]?\
  239 	  ?[arg pattern] [arg pattern] ...?"]
  240 Cheap way to get directory listings.
  241 Uses glob style pattern matching.
  242 
  243 [def "[cmd dump] [arg type] ?[arg -nocomplain]? ?[arg {-filter pattern}]?\
  244 	  ?[cmd --]? [arg pattern] ?[arg pattern] ...?"]
  245 The dump command provides a way for the user to spit out state
  246 information about the interpreter in a Tcl readable (and
  247 human readable) form.
  248 See [cmd dump](n) for details.
  249 
  250 [def "[cmd echo] ?[arg arg] [arg arg] ...?"]
  251 Concatenates the args and spits the result to the console (stdout).
  252 
  253 [def "[cmd edit] ?[arg {-type type}]? ?[arg {-find str}]?\
  254 	  ?[arg {-attach interp}]? [arg arg]"]
  255 Opens an editor with the data from arg.
  256 The optional type argument can be one of: [arg proc], [arg var] or [arg file].
  257 For proc or var, the arg may be a pattern.
  258 
  259 [def "[cmd idebug] [arg command] ?[arg args]?"]
  260 Interactive debugging command.
  261 See [cmd idebug](n) for details.
  262 
  263 [def "[cmd lremove] ?[arg -all]? ?[arg -regexp] [arg -glob]?\
  264 	  [arg list] [arg items]"]
  265 Removes one or more items from a list and returns the new list.
  266 If [arg -all] is specified, it removes all instances of each item
  267 in the list.
  268 If [arg -regexp] or [arg -glob] is specified, it interprets each item in
  269 the items list as a regexp or glob pattern to match against.
  270 
  271 [def [cmd less]]
  272 Aliased to [cmd edit].
  273 
  274 [def [cmd ls]]
  275 Aliased to [cmd dir] [arg -full].
  276 
  277 [def [cmd more]]
  278 Aliased to [cmd edit].
  279 
  280 [def "[cmd observe] [arg type] ?[arg args]?"]
  281 This command provides passive runtime debugging output for
  282 variables and commands.
  283 See [cmd observe](n) for details.
  284 
  285 [def "[cmd puts] (same options as always)"]
  286 Redefined to put the output into TkCon.
  287 
  288 [def "[cmd tkcon] [arg method] ?[arg args]?"]
  289 Multi-purpose command.
  290 See [cmd tkcon](n) for details.
  291 
  292 [def "[cmd tclindex] [arg {?-extensions patternlist? ?-index TCL_BOOLEAN?\
  293 	  ?-package TCL_BOOLEAN? ?dir1 dir2 ...?}]"]
  294 Convenience proc to update the [file tclIndex] (controlled by [arg -index] switch)
  295 and/or [file pkgIndex.tcl] (controlled by [arg -package] switch) file in the named
  296 directories based on the given pattern for files.
  297 It defaults to creating the [file tclIndex] but not the [file pkgIndex.tcl] file,
  298 with the directory defaulting to [lb]pwd[rb].
  299 The extension defaults to *.tcl, with *.[lb]info sharelibextension[rb]
  300 added when [arg -package] is true.
  301 
  302 [def "[cmd unalias] [arg cmd]"]
  303 unaliases command.
  304 
  305 [def "[cmd what] [arg string]"]
  306 The what command will identify the word given in string in
  307 the Tcl environment and return a list of types that it was recognized as.
  308 Possible types are: alias, procedure, command, array variable,
  309 scalar variable, directory, file, widget, and executable.
  310 Used by procedures dump and which.
  311 
  312 [def "[cmd which] [arg command]"]
  313 Like the [syscmd which] command of Unix shells, this will tell you if a
  314 particular command is known, and if so, whether it is internal or
  315 external to the interpreter.
  316 If it is an internal command and there is a slot in [cmd auto_index] for it,
  317 it tells you the file that [cmd auto_index] would load.
  318 This does not necessarily mean that that is where the file came from,
  319 but if it were not in the interpreter previously, then that
  320 is where the command was found.
  321 
  322 [list_end]
  323 
  324 [para]
  325 There are several procedures that I use as helpers that some may find
  326 helpful in there coding (i.e. expanding pathnames). Feel free to lift
  327 them from the code (but do assign proper attribution).
  328 
  329 [section EXAMLPES]
  330 [para]
  331 Some examples of tkcon command line startup situations:
  332 
  333 [example_begin]
  334 [cmd megawish] /usr/bin/tkcon [cmd -exec] "" [cmd -root] .tkcon [arg mainfile.tcl]
  335 [example_end]
  336 
  337 Use tkcon as a console for your [cmd megawish] application.
  338 You can avoid starting the line with megawish if that is the
  339 default [cmd wish] that TkCon would use.
  340 The [cmd -root] ensures that tkcon will not conflict with the
  341 application root window.
  342 
  343 [example_begin]
  344 [cmd tkcon] [cmd -font] "Courier 12" [cmd -load] Tk
  345 [example_end]
  346 
  347 Use the courier font for TkCon and always load Tk in slave
  348 interpreters at startup.
  349 
  350 [example_begin]
  351 [cmd tkcon] [cmd -rcfile] ~/.wishrc [cmd -color-bg] white
  352 [example_end]
  353 
  354 Use the ~/.wishrc file as the resource file, and a white
  355 background for TkCon's text widgets.
  356 
  357 [section FILES]
  358 TkCon will search for a resource file in [file ~/.tkconrc].
  359 TkCon never sources the [file ~/.wishrc] file.
  360 The resource file is sourced by each new instance of the console.
  361 An example resource file is provided in [cmd tkconrc](5).
  362 
  363 [see_also [cmd tkconrc](5)]
  364 [see_also [cmd dump](n) [cmd tkcon](n) [cmd idebug](n)]
  365 [see_also [cmd observe](n) [cmd text](n)]
  366 [keywords Tk console]
  367 
  368 [manpage_end]
  369