ABU 8-oct-2006 - Penpad Widget 1.0

ABU 11-oct-2006 - Just some small corrections (sample code).

ABU 2-nov-2006 - Penpad Widget 1.1 (see below for details).

ABU 8-aug-2007 - Penpad Widget 1.2 (see below for details).

Penpad is a small widget for free-hand drawing.

Penpad provides an interactive control (widget) for simple drawing tasks.

With this control, users can draw their scribble, as well as make a signature (autograph) for document exchange.

Penpad is just a simple widget that needs to be integrated with a toolbar or other interactive controls in a complete application.

  • Start page: [L1 ]
  • Download [L2 ]


Included demos will show you how to add a penpad to your applications.

Basically, in order to activate a penpad you only need to add 3 lines:

  package require Penpad
  penpad .penbox
  pack .penbox

There are few other (optional) commands you can use for customizing the penpad (read below).

   # change the look
  .penbox configure -pencolor white -bg black
   # save your drawings on a file (a .gif)
  .penbox export mywork.gif
   # clean your penpad
  .penbox clean

For full details, read the "Penpad Reference" [L3 ] within the doc directory.

Wish list (need help)

  • provide a floating menu/toolbar for common/useful (?) operations.
  • add cut&paste integrated with clipboard (Desktop-clipboard, not TK-clipboard) (available in 1.1 - Windows only)
  • add more custom good-looking cursors.
  • "Easy way" for adding a background image. (available in 1.1)
  • Calligraphy !!!

Please add your comments below.

WJP If you are REALLY ambitious you could add to the wish list:

  • command to recognize characters and export as string.

GS The work is almost done. See Handwriting Word Recognizer

ABU I'd like to extend Penpad with such capabilities but, as far as I know ( and I experimented ), applications such as Handwriting Word Recognizer require too much time to be 'trained', and often have some unacceptable limitations ( just for example, the above app states that Must use continuous stroke. You can't lift the pen to cross a t or dot an i).

In few words, these apps are too hard to be effectively working. ( Of course, I'll be happy if someone could oppose with an enlightening proof )

Just for the sake of research, I've found some interesting open-source projects:

I'd like to see if it is possible to 'isolate' the complex recognition engine from these apps, and wrap it up with really-simple Tcl API. Any volunteer ?

Alex Caldwell Nice widget! Could be very useful. I modified Handwriting Word Recognizer after reading your comment above. Now you can have a discontinuous pen stroke, which allows dotting an "i" or crossing a "t". I had to change the bindings to detect when the pen is lifted off vs. pressed on the canvas. So it's not quite as fast, since you now have to click the "Recog" button to trigger recognition when you are done with your stroke. In the original version, the recognition would be triggered automatically when you lifted the pen off the canvas.

I tried the STIHRS application above. I actually think Handwriting Word Recognizer is just about as good and doesn't look like the training takes any more time. Maybe it's recognition algorithms might be applicable to your project. It's all pure Tcl code, so should be easy to integrate and platform neutral. I didn't download the source for STIHRS - I'm not sure what language is used in the programming, but looks like it might be Windows specific.

Fabricio Rocha - 17 Mar 2010 - You Tclers are DA MASTERS! I never knew about this package until seeing it in the Recent Changes page. Last weekend I saw in a computer store a rebranded version of the LaPazz D-Note DLA401 digital notepad. Really amazing thingie, I was tempted in buying one, but kinda deceived because it's software is Windows-only and its OCR is a shareware. "Once again. Bloody hell. What if they could do software for this in Tcl?", I thought, still considering that it would be hard or impossible to have OCR in Tcl/Tk...

ABU 2-nov-2006

Penpad 1.1 is available

  • Start page: [L6 ]
  • Download [L7 ]

New features:

  • snapshot to file (export) now discards any widget border.
  • copy to clipboard (only on Windows; on other platforms this feature is ignored).
  • import a "penpad" background from a graphic file or from the clipboard (import for clipboard works only on Windows)
  • full support for scrollregion.
  • ability to disable/enable the pen-tracing.

I'd like to add clipboard support for Unix/Mac platform, too. Please add your suggestions if you know how to do it.

ABU 8-aug-2007

Penpad 1.2 is available

  • Start page: [L8 ]
  • Download [L9 ]


  • filenames with spaces are now correctly handled.

New features:

  • added -transparency option to export method
  • changed license (less restrictive)