The name and idea for this functionality comes from the Notebook application written by William Duquette at http://wjduquette.com/notebook. This functionality allows a node in an outline to be made into a "button" that when clicked will execute all its descendents' text as a Tcl script. The script is executed in the context of the current outline just as if it were typed into the console (see Scripting tkoutline).
I have used this magic button functionality in the following ways:
- Button for creating releasable tkoutline files (starkit, exe, tar.gz)
- Buttons for loading the tclx extension 1 and enabling/disabling performance profiling information. The tclx profiling information is displayed in a outline in a format that is vastly more readable than the default output.
- Button that prompts for a password and uses ccrypt 2 to load an encrypted outline. It also overrides the save command for the loaded outline so it gets encrypted upon saving.
- Button to convert the output from a diff command into an outline. The resulting outline has a button that will turn word wrapping off, change the font to fixed width, add some syntax-hightlighting to make the diffs more readable, and make the diff chunks clickable so tkdiff 3 is launched. I've found this very useful for reviewing code changes. Whenever I want to see the context of a given diff chunk, I just click on it and up pops tkdiff.
SEH 12Aug05: There doesn't seem to be any description anywhere of how to turn a link into a magic button. By looking at the saved text file of the "Magic button functionality" page, I surmise that you enclose the link text in a square-bracket/percent-sign combination; i.e., typing %console show% in a node will turn the enclosed text into a magic button (displayed in lavender).
Brian Theado: Thanks for pointing that out. The "Magic button functionality" page should describe how to do it and it doesn't. In addition to explicitly typing those characters, you can also hit Ctrl-m to automatically insert those characters (for the entire node or for the selected text). The current released version (0.93) operates slightly different than the current development version. Version 0.93 only executes code in the descendents. The development version will execute the actual text of the magic button if there are no descendents. For example:
- %Click here to show the console%
- console show
will behave the same as