blt::intro(3tcl)

πŸ’– BLT β€” intro to the whole BLT library, bestie πŸ’–

okay so this is blt::intro, from the BLT Built-In Commands manual section. it's the lil welcome mat for the entire BLT library. pull up a chair πŸͺ‘βœ¨


🌸 NAME 🌸

BLT β€” literally just the intro to the BLT library, that's it, that's the name πŸ’…


✨ DESCRIPTION ✨

so BLT is a whole library of extensions for the Tk library. the way it works is it just adds new commands and variables straight into your application's interpreter. no cap. 🫢


πŸŽ€ COMMANDS πŸŽ€

these are the commands that BLT slides into your interpreter, one by one, like a group chat invite chain:

  • table β€” a table geometry manager for Tk 🧚 you place windows by giving them table row,column positions, and windows can also span multiple rows or columns if they're feeling extra. it also has a ton of options for setting and/or bounding window sizes.
  • graph β€” a 2D plotting widget πŸ‘‘ it plots two-variable data in a window with an optional legend and annotations. it's made of several components: coordinate axes, crosshairs, a legend, and a collection of elements and tags.
  • barchart β€” a barchart widget πŸ“Š plots two-variable data as rectangular bars in a window. the x-coordinate values say where the bar sits along the x-axis, and the y-coordinate values say how big it is. the barchart widget has several components: coordinate axes, crosshairs, a legend, and a collection of elements and tags.
  • vector β€” makes a vector of floating point values πŸ”’ the vector's components can be manipulated three whole ways: through a Tcl array variable, a Tcl command, or the C API. three doors, pick your fave.
  • spline β€” computes a spline fitting a set of data points (x and y vectors) and produces a vector of the interpolated images (y-coordinates) at a given set of x-coordinates πŸŒ€ math but make it cute.
  • bgexec β€” like Tcl's exec command, but bgexec runs a pipeline of Unix commands in the background. unlike exec, the output of the last process gets collected and a global Tcl variable is set when it finishes. bgexec can be used with tkwait to wait for Unix commands to finish while still handling expose events. intermediate output is also available while the pipeline is active. multitasking queen πŸ’…
  • busy β€” creates a "busy window" that stops user-interaction while an application is busy πŸ™ˆ it also gives you an easy way to have temporary busy cursors (like a watch or an hourglass). it's giving "do not disturb" mode.
  • bitmap β€” reads and writes bitmaps from Tcl 🎨 brand-new X bitmaps can be defined on-the-fly straight from Tcl, so you don't have to copy bitmap files around anymore, thank god. other options query a loaded X bitmap's dimensions and data.
  • drag&drop β€” a drag-and-drop facility for Tk 🫳 info (represented by a token window) can be dragged to and from any Tk window, including windows of another Tk application. drag&drop acts as a coordinator, directing Tk send commands between (or within) TCL/Tk applications.
  • htext β€” a simple hypertext widget πŸ“– it combines text and Tk widgets into one single scroll-able window. Tcl commands can be embedded into the text, and they get invoked as the text is parsed. plus, Tk widgets can be appended to the window at the current point in the text. htext can also be used to create scrolled windows of Tk widgets.
  • winop β€” raise, lower, map, or unmap any window πŸͺŸ the raise and lower functions are useful for stacking windows above or below "busy windows".
  • watch β€” arranges for Tcl procedures to be called before and/or after the execution of every Tcl command πŸ‘€ this one's for logging, profiling, or tracing Tcl code.
  • bltdebug β€” a simple Tcl command tracing facility, super useful for debugging Tcl code πŸ› it displays each Tcl command before and after substitution along its level in the interpreter, on standard error.

πŸ’œ VARIABLES πŸ’œ

these Tcl variables get either set or used by BLT at various points while it's running:

  • blt_library β€” this variable holds the name of a directory containing a library of Tcl scripts and other files related to BLT πŸ“ right now, that directory contains the drag&drop protocol scripts and the PostScript prolog used by graph and barchart. the value comes from the BLT_LIBRARY environment variable if one exists, otherwise it comes from a default value compiled into the BLT library.
  • blt_versions β€” this variable is set in the interpreter for each application 🌈 it's an array of the current version numbers for each of the BLT commands, in the form major.minor. major and minor are integers. the major version number goes up in any command that includes changes that are not backward compatible (i.e. whenever existing applications and scripts may have to change to work with the new release). the minor version number goes up with each new release of a command, except it resets to zero whenever the major version number changes. the array is indexed by the individual command name.

πŸ¦‹ ADDING BLT TO YOUR APPLICATIONS πŸ¦‹

good news bestie: it's easy to add BLT to an existing Tk application. BLT requires no patches or edits to the Tcl or Tk libraries. to add BLT, you literally just drop this code snippet into your application's tkAppInit.c file:

if (Blt_Init(interp) != TCL_OK) {
    return TCL_ERROR;
}

then recompile and link with the BLT library (libBLT.a) and that's it. done. periodt. πŸ’…

alternately, you can dynamically load BLT, simply by invoking the command

package require BLT

from your Tcl script. iconic behavior honestly ✨


πŸ’€ BUGS πŸ’€

found a bug? got a request? a suggestion? a whole rant? send it all to gah@siliconmetrics.com or ghowlett@grandecom.net πŸ“§ they're listening, fr fr.


⭐ KEYWORDS ⭐

BLT


and that's the whole vibe check, bestie πŸ’– this page comes from BLT version 2.5, and it's blt::intro(3tcl) β€” go forth and plot, drag, drop, and slay πŸ‘‘πŸŒΈπŸ¦‹βœ¨πŸ’…

πŸ“¦ where this page comes from