The drawscreen.tcl allows to draw on the screen. It can be sourced or used stand-alone.
When sourced, drawscreen runs this way:
source drawscreen.tcl
::drawscreen::run wins ?events? ?-fill fill? ?-width width? ?-length length? ?-bell bell?
where:
- wins - list of toplevel windows the drawing events are bound to, e.g. ".w1 .w2"
- events - list of events to start the drawing, default "Control-x Control-X"
- fill - color of drawing brush
- width - width of drawing brush
- length - length of drawing line
- bell - if "false", disables bells
drawscreen provides "cget" and "configure" for options, e.g.:
::drawscreen::configure -fill red -width 20 -length 30
puts [::drawscreen::cget fill -width -length]
::drawscreen config fill blue width 30 length 40 -bell no
puts [::drawscreen cget -fill width length bell]
When stand-alone, drawscreen runs this way:
tclsh drawscreen.tcl ?events? ?-fill fill? ?-width width? ?-length length? ?-bell bell?
where:
- events, fill, width, length, bell mean the same as above
Control+X keys are used to start / end drawing. Then the left mouse button is used to drag-and-drop the mouse pointer.
To end with the drawing, the right / double click / Control+X is used.
In Windows, there is a short lag between Control+X and the bell signalizing drawscreen is ready to draw.
License: MIT.