Windows/CE

Windows CE is a predecessor for various versions of Windows for mobile and embedded devices.

NOTE: WinCe is the abbreviation for Windows/CE, commonly found running on smaller machines also known as PDAs (personal digital assistants). A 1999 document on Microsoft's web site indicated that the suffix CE stood for "Consumer Electronics", but Microsoft later denied that it has any specific meaning. These days, it's widely considered to be an abbreviation for "Compact Edition".


Ways to run Tcl/Tk on Windows CE

Source and binaries for Pocket PC can be found at http://sourceforge.net/projects/tcltkce


In January 2006, eTcl has been released. It is another (binary) distribution of Tcl/Tk for Windows CE (supports both PocketPC and Smartphone), based on up-to-date (8.4.13) core, available as a single executable (no installation required), with fully functional sockets, fileevents, scrollbars, native menus, and many extensions...

Today (January 2008), eTcl may be considered the preferred package over the other offerings mentioned on this page. Note however that eTcl has limited functionality with pure CE machines. Following distributions apply (in order of complexity):

  • Windows CE (core license - found on many TFT kits for industrial usage)
  • Windows CE Pro
  • Windows Mobile

eTcl only supports the latter two variants of CE fully (however, I'm not sure whether CE Pro is fully supported - RJM). The main limitation with the CE core license: Windows are not drawn with title bar. Reason: The aygshell api set is not present here. Starting tcl yields a wish appearance which does not appear actually. Starting with a script as argument will work well - but: preferably to being used for full screen apps.

The actual installer distribution of eTcl (based on 8.5.0) does not install with CE machines. The installer refuses due to a complained compatibility issue. However, the elder CE3.0 distribution of eTcl do allow installation. The difference lies in the installation procedure, which is compatible with the standard CE cores as well as in the executables. Users with plain CE machines should use the ZIP distros, giving the opportunity to test both versions. Further, Evolane also offers a 8.4.12 distribution (all archives: [1 ]), which has the same limitations. The Hobbs version of 8.4.12 (alpha), see below, offers title bars and usual window management, but has other lacks, e.g. failing transparency with gif images and some fconfigure config options are stripped.

Common to all available distributions is problems with wish due to lacking stdio with standard CE. See the celib notes below.


Rainer Keuchel has completed a port of Tcl/Tk 8.4a2 for WinCE on PDAs using his celib.dll [2 ] porting library. Please check out his page out for the latest and greatest information at http://www.rainer-keuchel.de/wince/tcltk-ce.html .

 Current Build date is March 19, 2002, with celib v3.12

Per the release notes, "Tcl/Tk is still a bit buggy on WINCE211. It works better on WINCE300."


Wiki pages with CE-specific code or ports are listed at PocketPC


In July, 2003, Jeffrey Hobbs uploaded Tcl/Tk 8.4.4 final binaries for WinCE 3.0 ARM devices to, which were updated to Tcl/Tk 8.4.12 (prerelease) binaries for WinCE 4.2 in Nov 2005, available at:

  ftp://ftp.tcl.tk/pub/incoming/tcltk8_4_12_ce-arm.zip

It includes the full Tcl/Tk + celib binaries needed for operation. There is a README on how to install it (you will need to set a few registry settings on your PocketPC device). In addition to Tcl/Tk, you will find tcllib1.8 and bwidget1.7, which both work out of the box (pure Tcl), and itcl/itk 3.3 as a proof-positive TEA ported library (works like a charm).


28sep03 jcw - There is a WinCE build of Metakit, so the first hurdle to running Starkits on PocketPC is gone. I've also created a starkit package which can be used with tclsh. There are a few pieces still missing to run on PocketPC, see [3 ] for details. If you want this to happen, please get in touch.

30sep03 MPJ - It looks like the pieces are starting to come together for running Starkits on the PocketPC. jcw has compilied zlib, vfs, mk4tcl and rechan. It does not run a Starkit yet but it is getting close. I have been testing the zlib and mk4tcl and they seem to work very well.


JM-The following screenshot belongs to an excellent application called iFile 1.1, developed by Richard Suchenwirth: I am using it on a iPAQ h1930. works great!

http://mywebpages.comcast.net/jakeforce/TclTk_PocketPC.png


What was involved in compiling/porting the above extension (tktable)? I'm really interested in porting an application (Scid - http://scid.sourceforge.net ) to run on the PocketPC. This app is based around a Tcl/Tk extension (Don't know whether it is TEA compliant or not - I'm not sure how to tell either but will look into it at the weekend).

(That said, there would be quite some work already re-working the large search screens to work well in 240x320. I don't imagine this will be a quick project.)

10oct03 - See How to build for WinCE


Is anyone working on doing a build for the Intel PXA250/255 processor, such as is found in the NEC Mobilepro 900?

MNO -- In general, I believe that the ARM binaries work on the XScale processors under PocketPC 2002 (I am using the above Tcl 8.4.3 binary on my Fujitsu-Siemens Pocket Loox 600 which uses the PXA250 processor).

FW: Note, however, that XScale provides an extended instruction that can be specially compiled for. XScale 400MHz processors are actually about the same on Pocket PC 2002 (some say slower) than 206MHz counterparts from other ARM processors, but PPC2003 changes that.

But I'm rambling. ;)


Screenshots:

 Example of a simple Editor 

http://www.rainer-keuchel.de/wince/tcltk1.jpg

 Tkcon on a pocketpc 

http://www.eteamz.com/cmym/images/Tkcon1.jpg http://www.eteamz.com/cmym/images/Tkcon2.jpg [4 ]

 TkNotePad (with or without a menu bar)

http://www.eteamz.com/cmym/images/tknotepadb.jpg http://www.eteamz.com/cmym/images/tknotpadm.jpg [5 ]

 Tabbed Notebook and Tree Widget from D. Richard Hipp

http://www.eteamz.com/cmym/images/notebook.jpg [7 ] http://www.eteamz.com/cmym/images/tree.jpg [6 ]

http://www.eteamz.com/cmym/images/calculator.jpg [8 ]

"Tcl lets you put the world in your pocket..." http://www.eteamz.com/cmym/images/tclworld.jpg [9 ] http://www.eteamz.com/cmym/images/tclworld2.jpg

Download

http://www.rainer-keuchel.de/wince/dirlist.html

  1. Get the tcl generic tcltk package [10 ].
  2. Then get your specific processor's binary package: SH3 [14 ], ARM [13 ], MIPS-palm [12 ], MIPS-hpc [11 ]
  3. Next get the celib package [15 ] currently version 3.13.
  4. Finally get the WinCE desktop tools [16 ]. This will allow you to update the registry from your desktop.

Installation

  1. Install the celib.dll for your processor specific platform in the '\Windows' directory on your WinCE device.
  2. Unpack and install tcltk. See directions on Yakumo Alpha page.
  3. Unpack the cereg.exe file from the WinCE desktop tools and place it in a directory with the batch file at the end of this note (on your desktop PC). Configure the batch file per your installation and then run it from the command line to update your WinCE device's registry.

RUNNING

  1. Wish84d and Tclsh84d can be run by chooing them in the Explorer Window.
  2. A Tcl or Tk file extension can be associated with Wish84d in the Windows Registry (see file wince_tcktk.bat).

[Add notes on how to run a file here] MPJ

NOTES

Currently contains the registry binary package (1.0). I have also checked this out with the tcltk only packages: Bwidget (1.3.0) and tcllib (1.1). I have also tested this out with tkcon.

Also to talk to the serial ports the valid names are "com1:", "com2:" and "com4:". Note when experimenting with serial ports in CE's command line shell, using the copy command: When the current directory is not equalling the root, this is automatically prefixed to "com1:" etc., producing an error. Correct syntax: copy text.txt \com1:

Please report bugs you find to Rainer Keuchel [18 ] or to wince-devel [17 ]


FILE: wince_tcktk.bat

   ::- Basic System Configuration
   REM Make changes here for your system
   set basepath=\Program Files
   set wish=%basepath%\Tcl\bin\wish84d.exe
   set tclsh=%basepath%\Tcl\bin\tclsh84d.exe
   set libdir=%basepath%\Tcl\lib
   set bindir=%basepath%\Tcl\bin
   set tcllibdir=%libdir%\tcl8.4
   set tklibdir=%libdir%\tk8.4

   ::- TclTk file associations
   cereg -k "HKCR\.tk" -n "" -v "tclfile"
   cereg -k "HKCR\.tcl" -n "" -v "tclfile"
   cereg -k "HKCR\tclfile" -n "" -v "TclTk Script"
   cereg -k "HKCR\tclfile\DefaultIcon" -n "" -v "%wish%,0"
   cereg -k "HKCR\tclfile\Shell\Open\Command" -n "" -v """"%wish%""" ""%%1"""

   ::- Tcl file associations
   cereg -k "HKCR\.tsh" -n "" -v "tshfile"
   cereg -k "HKCR\tshfile" -n "" -v "Tcl Script"
   cereg -k "HKCR\tshfile\DefaultIcon" -n "" -v "%tclsh%,0"
   cereg -k "HKCR\tshfile\Shell\Open\Command" -n "" -v """"%   tclsh%""" ""%%1"""

   ::- Environment Info
   cereg -k "HKLM\Environment" -n "TCL_LIBRARY" -v "%tcllibdir%"
   cereg -k "HKLM\Environment" -n "TK_LIBRARY" -v "%tklibdir%"
    REM Height of 10 is ok, 14 does almost full screen
   cereg -k "HKLM\Environment" -n "ROWS" -v "14"
    REM MAX Width for PPC is 29 Chars
   cereg -k "HKLM\Environment" -n "COLS" -v "29"
    REM Home
   cereg -k "HKLM\Environment" -n "HOME" -v "\\"
    REM Temp
   cereg -k "HKLM\Environment" -n "TEMP" -v "\Temp"
   cereg -k "HKLM\Environment" -n "TMP" -v "\Temp"
   cereg -k "HKLM\Environment" -n "TMPDIR" -v "\Temp"
   cereg -k "HKLM\Environment" -n "TEMPDIR" -v "\Temp"
    REM Path
   cereg -k "HKLM\Environment" -n "PATH" -v "%bindir%;"
    REM Username
   cereg -k "HKLM\Environment" -n "USER" -v "nobody"
    REM Debugging trace level (0 to 255)
   cereg -k "HKLM\Environment" -n "XCE_TRACE" -v "0"
    REM Debugging trace file output
   cereg -k "HKLM\Environment" -n "XCE_TRACE_FILE" -v "\xce_trace.txt"

WISHLIST/QUESTIONS

It would be really neat if there was a way to detect the keyboard input panel popping up so that apps could take appropriate action - e.g. resize/scroll/move to ensure input point is visible above the keyboard.

I've noticed other native PocketPC applications do this, and a quick bit of googling reveals that there are a set of calls relating to SIP position, I don't know e.g. if this manifests as an event that tcl can see, or if the visibility mechanism could be used???


MNO The PocketPC socket/fileevent strangeness and also the infamous "tcl: select: 10022" error dialog I previously saw here in code using sockets does not occur when using the eTcl distribution.


tcltkce project on SourceForge site http://sourceforge.net/projects/tcltkce could be used to share compiled binaries and source code.

Mailing list [email protected] could be used to discuss related problems. Please use this list to share your binaries.


See also Yakumo Alpha for detailed installation instructions on that PocketPC 2002 system, and iPAQ - iPAQ goes Japanese - HTC Magician for RS's experiences. Symbolic links in Windows/CE


Windows Mobile 2003 Smartphone is yet another derivation of Windows/CE, officially known as Microsoft Windows Mobile 2003 Second Edition software for Smartphone. TP


TclXML/TclDOM Does this version support TclXML and TclDOM? RS eTcl "full version is the battery-included version, with all encodings embedded into virtual filesystem, and support for many popular Tcl (Tls, TclXML) and Tk (Tile, TkTable, TreeCtrl) extensions." No TclDOM though, as far as I can see in 1.0-rc7.


Wish84 crash The version is from ftp://ftp.tcl.tk/pub/incoming/tcltk8_4_12_ce-arm.zip When I run a TK script, the winsh84.exe crash. Could anybody help me? Below is the message: Exeception 0xC00000FD Address:01B60FD0

Is there any sourcecode of the ce porting? I want to do some debug on it by myself.