eTcl bugs and comments

Support page for eTcl distribution


2009-07-08 HE etcl 1.0.1 (win32) on a xp sp2 machine returns wrong file size: With etcl:

1% file size C:/HE/openstreetmap/germany_20090606.osm
1064258571
2% file stat C:/HE/openstreetmap/germany_20090606.osm a
3% parray a
a(atime) = 1244474612
a(ctime) = 1244336685
a(dev)   = 2
a(gid)   = 0
a(ino)   = -25787
a(mode)  = 33188
a(mtime) = 1244335450
a(nlink) = 1
a(size)  = 1064258571
a(type)  = file
a(uid)   = 0
4% file lstat C:/HE/openstreetmap/germany_20090606.osm a
5% parray a
a(atime) = 1244474612
a(ctime) = 1244336685
a(dev)   = 2
a(gid)   = 0
a(ino)   = -25787
a(mode)  = 33188
a(mtime) = 1244335450
a(nlink) = 1
a(size)  = 1064258571
a(type)  = file
a(uid)   = 0

With tclkit 8.5.6:

1% file size C:/HE/openstreetmap/germany_20090606.osm
5359225867
2% file stat C:/HE/openstreetmap/germany_20090606.osm a
3% parray a
a(atime) = 1244474612
a(ctime) = 1244336685
a(dev)   = 2
a(gid)   = 0
a(ino)   = 39749
a(mode)  = 33188
a(mtime) = 1244335450
a(nlink) = 1
a(size)  = 5359225867
a(type)  = file
a(uid)   = 0
4% file lstat C:/HE/openstreetmap/germany_20090606.osm a
5% parray a
a(atime) = 1244474612
a(ctime) = 1244336685
a(dev)   = 2
a(gid)   = 0
a(ino)   = 39749
a(mode)  = 33188
a(mtime) = 1244335450
a(nlink) = 1
a(size)  = 5359225867
a(type)  = file
a(uid)   = 0

the file size tclkit returns is the correct size (the same the browser returns). ino is also different but I don't know how to check ino.


This looks like a signed/unsigned issue with the display of the value, perhaps tickled (no pun intended) by the large value.

2^32 is 4294967296

Tcl 8.5.6 reports 5359225867

eTcl is reporting 1064258571, or "5359225867 - 4294967296". b. c. harder

2009-06-15 EH Fixed for coming 1.0.2, thanks a lot for reporting. For little story, tcl.h declares Tcl_StatBuf as struct stat, instead of struct stat64, whenever __GNUC__ is defined. Since public version of eTcl for Win32 is cross-compiled using MingW toolchain, it was getting affected by this (wrong) test.


2009-02-20 HaO On a windows mobile 6 professional device, I try to get the menu configuration typical for this device:

  1. Left soft key: command
  2. Right soft key: menu

I managed to get point 2 by using a menu with only one item. I did not succeed for point 1. In [L1 ], they state, a menu with two top items should be used:

menu .m ; menu .m.m
#.m add command -label exit1 -command exit
.m add cascade -label menu -menu .m.m ; .m.m add command -label exit2.1 -command exit
. config -menu .m

Unfortunately, if the comment line is uncommented, the classical menu is shown instead of two softkey items. Any ideas, how to achieve the soft key design ?

2009-01-24 AMucha small bug in etcl/demos/colliding.tcl inside of etcl-1.0.1-linux-x86.tar.gz Change the very first txt to msg so the line reads:

  tk_messageBox -message $msg -icon warning -title "$::S(title) Score"

2008-12-30 humberto marvelous, and i would love to use this as my development platform on windows mobile 6.1 on my htc tilt. but how can i access the .net device apis? for example, i would really like to read mail from my xpressmail or outlook folder, and send outgoing mail from the same accounts. perhaps a sample project showing how to link and use a c# extension would help???

2008-12-18 koon on redhat linux fedora v7 chinese encoding: cannot input chinese except by copy and paste but in interactive etcl console mode,chinese can be input. on window mobile 2003 v4.21 & pocket pc 4.20: the font size of listbox of combobox cannot be changed, point 8 of chinese is not readable. any remedy can be done? please advice.Thanks

2008-12-17 Skoro Need some advice about handle events from VolumeUp and VolumeDown keys. I have following code snippet:

  wce keyon volumeup
  wce keyon volumedown
  bind all <KeyPress> { some commands }

pressing volume keys does not emit event. I run eTcl on smartphone without stylus and I need as many keys as possible. Thanks.

2008-12-18 EH does your application has a menubar attached to your toplevel window ? If not, you need so. Windows Mobile enforces softkeys event to be sent to menubar, then eTcl forwards those events as standard key events to Tk window having focus.

2009-01-11 Skoro ok, suppose I have following code example:

  package require Tk
  catch {package require wce}

  array set g { win     ".__ed" }

  set keysym "press"
  toplevel $g(win)
  label $g(win).e -textvariable keysym  
  pack $g(win).e -side top -anchor w
  text $g(win).t -wrap word -yscr [list $g(win).y set] -undo 1
  scrollbar $g(win).y -com [list $g(win).t yview]
  pack $g(win).t $g(win).y -side left -fill y
  wce inputmode $g(win).t spell

  set m [menu $g(win).m]
  $g(win) config -menu $m
  $m add command -label quit -command [list destroy .]

  raise $g(win)
  focus -force $g(win).t

  $g(win).t insert end $tcl_platform(platform)

  wce keyon back $g(win)
  wce keyon volumeup $g(win)
  wce keyon volumedown $g(win)

Pressing BackSpace work as need (delete character) and emit BackSpace keycode, but VolumeUp and VolumeDown does not nothing, no emit events. Please light me, what wrong?

2008-12-10 MSA FS U9200 Vista Home Basic. etcl(28,29,31) hangs after

  evodio play -file C:/Windows/Media/chord.wav

Vista sucks? :) 2008-12-18 EH It seems there is some subtile differences between Windows version in the way waveOutWrite() & al. works. Anyway, this appear to be due to bad race condition in evodio's Win32/WinCE backend, which should now be fixed in release 1.0.0. Please confirm, if you still have problem with it.

2008-12-02 JanH I just installed 'etcl-1.0-rc30-win32-setup.exe', and the directory 'lib' is MISSING. The libraries bwidget,tcllib and tklib are NOT present. However, these libraries are included in all other .zip and .tar.gz distributions, and also in the previous 'etcl-1.0-rc29-win32-setup.exe'. Were these removed for a purpose, or it is a mistake? My applications need those "included batteries", and for many users it is not an intuitive process to add them or install eTcl manually. Thanks. 2008-12-03 EH Definitely not 'on purpose'. A typo was introduced in Win32 installer configuration, causing 'Extensions' component to be empty (see null size beside Extensions checkbox during installation). Fixed in 1.0-rc31 Win32 installer, already available for download.


2008-11-27 Erwan I have seen the announce of the new release, in particular the management of the WM6 "GPS intermediate driver" and power manager. I'm very excited to use them but it seems that the documentation on http://www.evolane.com/software/etcl/wce.html is not up to date. Could you point me to the right documentation ? Thanks ! 2008-12-03 EH Up to date wce reference documentation has been synced on our web site, at URL given above. Accessing GPSID data is pretty straightforward, a simple wce gps command returns all GPS information as a associative list. 2008-12-12 HE Is there a way to start and stop gps? I had the hope 'wce gps off' works. What can I do with ?status? ?


2008-11-27 Erwan Do you have any plan around supporting iPhone or Blackberry ? Thanks ! 2008-12-03 EH Apple policy doesn't allow redistribution of runtime for dynamic languages, so this is more a legal tie-up than a technical one.


2008-08-29 Jack.R Bug report on Winblows XP SP2, etcl rc28 when passing -h or -v command line parameter to a script

Sample code:

  #!/usr/bin/env tclsh
  console show

  if {$argc == 0} {
          puts "Missing parameter"
  } else {
          set arg [ lindex $argv 0 ]
          switch -exact -- $arg \
                  {
                          "-h"        -
                          "--help"    -
                          "/?"        {
                                  puts "Usage"
                          }
                          "-v"        -
                          "--version" {
                                  puts "Version"
                          }
                          default     {
                                  puts "arguments: $argv"
                          }
                  }
  }

With long parameter --help or --version, everything is fine but short parameter gives trouble:

  • -v gives: Invalid command name "console" while executing "console show"
  • -h gives: Unable to realloc 671092863 bytes

RS 2008-09-01: I think this is just inherited behavior of wish which analyzes argv first and tries to handle -h and -v, and others. You can hide flags from wish by putting them after the -- boundary.

Jack.R 2008-09-01: I did not think about that and did not realize that eTcl was automatically using wish (opposed to tclsh). However, I did not get mentioned issue when running eTcl under Linux (console show is removed).


2008-07-03 HE Found the following behavior on a XP SP2. Given a file with the following code:

 console show;update

etcl-1.0-rc29 is bind to .tcl und .etk starting the script with doubleklick gives the following error:

 invalid command name "console" while executing "console show"

With etcl-1.0-rc28 this works as expected. 2008-07-03 EH Thanks. While cleaning up init code, Tk_CreateConsoleWindow() was by error moved to be called only in interactive mode. This lead to faster startup time (time for console creation is significant on WinCE), but breaks normal behavior. Fixed in repository, and 1.0 final will be coming very soon.


2008-07-02 Michael Bug report: Pressing the TAB key in a text widget in the OSX version crashes eTcl. Looks like a NULL dereference.

Update 2008-07-07: My first report was related to etcl-1.0-rc28-macosx. In the meantime I tried it with rc29, and the behaviour is the same. To reproduce:

    package require Tk
    pack [text .t] -fill both

and try to enter a TAB in the text widget. In both cases, I was trying that on OSX 10.4.11. 2008-07-21 EH This appears to be a bug in GCC 4.0.1 (Xcode 2.5) when compiling tkTextDisp.c with -Os optimization. Switching to -O2 (or -O1) seems to work around it. Thanks for reporting, this should be fixed in next (soon to be released) version.


2008-06-09 Martyn Smith Is it possible in wce to change the orientation of the screen to use landscape mode, if not is this one of the features to add. Another idea to add is some more of the phone info (operator, call counters, signal strength ...). 2008-06-20 EH A new wce orientation ?angle? has been added to wce command in 1.0-rc29, to query or set display orientation. Indeed, mapping more functions from Winblows Mobile API, just like twapi does for Win32, could be nice, but this is not yet done. Contributions are welcome :) Note also that accessing native API is most of the time possible with the help of Odyce, without needing any external compiler or tool.


2008-04-17 - MSA eTcl is very good job. I use it greater then 1 year on my PDA. Sometimes I use win32 version. I wrote small script to count and check files CRC and got strange result in speed.

            first run (sec)      second run (sec)
 ActiveTcl  40                   4
 FreeWrap   140                  140
 eTcl(rc28) 190                  190

 Why so slowly? Why windows file cache does not help?

2008-04-18 EH Can you provide sample code to reproduce those benchmarks. From 4 to 140 or 190, I guess it may comes from ActiveTcl is using some native extension while eTcl and freewrap is falling back to pure Tcl one. Note that for fast CRC, eTcl embeds a etcl::digest extension on all architecture, able to compute CRC, MD5, SHA1, etc.... with native performance.

  package require etcl::digest
  set d [::etcl::digest create crc32]
  ::etcl::digest append $d "hello"
  ::etcl::digest append $d "world"
  set crc [::etcl::digest close $d -format hexa]

For delta between freewrap and eTcl, need to see which code you use. Also, check all runtime engines have same Tcl version in. Some tcllib extensions (e.g. md5, sha1, some CRC) have dramatic lost of performance when switching from 8.4 to 8.5, due to bignums introduction. On some code, threaded vs. non-threaded, or Tcl alloc vs. standard alloc, may also induce significant differences. Actually, when comparing benchmarks (e.g. from tclbench), one may notice a build is faster for some tests but slower on others, so milage may vary according to application. Last, eTcl is (crossed) compiled with a Mingw (vs. MSVC), so this may explain some differences. Anyway, those differences are really important, so please consider posting (or sending Eric Hassold by mail) sample code for more accurate investigation.


2008-04-04 - Erwan Hi, is there a way to get the battery status ? A percentage between 0 and 100 would be nice... Thanks ! 2008-04-14 EH This feature is not there in 1.0-rc28. However, since this is just another nice candidate for wce package, I added a "wce battery" subcommand, which will be available with next eTcl release. Also, extending eTcl to handle this additional features from Winblows Mobile API can be achieved with odyce. I will try to find some time to add such an example, to inquire battery status, in wiki. 2008-04-14 - Erwan Thanks!


2008-04-09 - MSA I write small IDE for PDA. Context menu is very handy but I have some problem with 'wce tapandhold'.

 package req Tk 
 package req wce
 button .b -text TapAndHold
 wce tapandhold .b on
 pack .b
 #tapandhold - OK
 set scr {package req Tk}
 interp create i1
 i1 eval $scr
 #tapandhold does not work. 

2008-04-14 EH I can't reproduce problem. Is wce package loaded correctly in child interpreter, and *after* Tk is loaded? This works for me:

  set scr {
    package require Tk
    package require wce
    update
    label .l -text Test
    pack .l
    wce tapandhold .l on
  }
  interp create i1
  i1 eval $scr

update should be optional, since wce extension calls Tk_MakeWindowExist(), but you may check if it helps in fixing symptom you observe. If problem persists, let us know.

2008-04-16 - MSA I mean that 'TapAndHold' does not work in parent (root) interpreter if (after) in child interpreter there is command 'package require Tk'. Example: I have IDE with context menu, I write some Tk script in IDE and run script in child interpreter. After that context menu does not work (blue circles do not fly).


2008-04-04 - Erwan Thanks for the new release, keep up the good work ! I was reading the readme of version rc28 and I've seen the following comment:

Included Pure Tcl extensions:

I've tried to use it (i.e. package require ::evolane::object) without success. What is the release status of EvoTcl modules, are they :

   -    private to evolane (I would perfectly understand)
   -    public but not open source
   -    public and open source

Thanks to clarify. Right now, I am mostly interested in the OOP side, (I guess evolane::object) All other OOP tcl extensions (Itcl...) requires some dll, hence I cannot use it :-(. 2008-04-04 EH Thanks for showing readme.html in distrib isn't up to date (as shows note about version 8.4.15, instead of 8.5.2 today). Very early eTcl distribution used to include the EvoTcl library, a collection of pure Tcl packages, similar in philosophy to tcllib, but developped during years by Evolane mainly for its own usage. Currently, we are missing time and resources to provide good enough support and documention for it as a whole, so public CVS hasn't been kept in sync with our developments. Releasing sources and supporting portions of the library according to users' requests would be easier. First portion in the pipe for public release is http client and server modules. To answer the OOP specific issue : evolane::object would anyway be more simple than what you probably expect. For larger pure Tcl OOP package, you will probably find Snit, stooop from tcllib more powerful and better documented. Note that full version of eTcl now installs kit for tcllib, so all those packages are ready to be used in eTcl.


2008-04-02 HE Just tried etcl-1.0-rc27-win32 on XP SP2. Got the following error if I close etcl:

 alloc: invalid block: 01CA1338: 48 1

2008-04-02 EH An old bug in bad exit handler, which leaked in back again. Note that exiting with "exit" command doesn't raise error, so it wasn't detected by regression testing. Fixed another bug related to color alias parsing in pixane and scene, so building, testing and pushing online 1.0-rc28 as I'm typing this message.


2008-03-24 - Erwan Hi everyone, I'm developing a GPS application using eTcl, the distrib is great, very portable between windows and Winblows Mobile. Thanks a lot for the nice work.

I have two questions regarding Winblows Mobile eTcl (compact version):

1. I need to keep my Palm alive at all time to process GPS event (using filevent). I tried to use "wce power 1" at regular interval, but the Palm insists in going to sleep after a while... Any suggestion ? What I really would like is a way to keep the program running, but to switch off the screen. wce power 0 doesn't do the job, I'm afraid. PWE wce power 0 should power off the screen, but not the 'sleeping' of the PDA. You could use mortscript [L2 ] to make a batch file to switch your PDA to 'always on', launch etcl with your program, and after your program exits switch back to 'sleeping mode'. 2008-03-28 EH I added a "wce alive" subcommand in eTcl 1.0-rc27 (should be out in next couple of days), which reset the idle timer (i.e. calls SystemIdleTimerReset()). To prevent PDA from entering into suspend mode, all you need is calling it at regular interval (since minimal suspend timer is 1mn, calling it say every 30s should be enough). One could imagine to enforce permanent 'always on' state using Power Management API, but I prefer to let application control it, and leave system parameters unmodified, so system integrity is preserved on program exit. Note that you may call "wce power 0" to switch LCD and backlight off, and use "wce alive" at the same time to keep PDA and GPS connection alive. Also, starting with 1.0-rc27, "wce bluetooth <on|off|discoverable>" subcommand is more robust and compatible with more devices, so you may find some interest in it.

2. I have a menu for my app with more than 2 entries and it hides the lower part of my ttk widgets. How can I tell the widgets to use use only the space *above* the menu ? (On windows, it works just fine...) 2008-03-28 EH Do you know about the

  ::etcl::automanage .

helper, and did you use it? You can call it very early in your code (as long as Tk is loaded), and this will take care of managing toplevel window geometry according to menu position, SIP status, screen orientation updates, etc... Have often considered calling this automatically at startup, at least for . toplevel, since this is probably a the default behavior expected for main window for most Winblows Mobile application. However, need to get sure this would not introduce some kind of incompatibility in existing codes.

Thanks !


2008-03-10 HE Today I found differences with the clock command between rc23 and rc26. On rc23 (This was what I'm expected):

 1%  clock format  [clock seconds]
 Mon Mar 10 08:57:13 WET 2008

On rc25 and rc26:

 1% clock format  [clock seconds]
 Mon Mar 10 09:55:53 WCT 2008

This happens on a german W2000 SP4 (my system at work; 1.). The problem is the hour difference. On Friday last week this doesn't happend. In my application I doesn't see WET or WCT. I'm only see date and time. Ok with timezone the reason is clear. What I'm not understanding? in the system preferences the timezone '(GMT+01:00) Amsterdam, Berlin, Bern, Rom, Stockholm, Wien' is selected. On my private w2000 notebook (2.) the same system timezone is selected but I got

 1%  clock format  [clock seconds]
 Mon Mar 10 08:57:17 CET 2008

The timezone is different by same system preference!? On the 1. system I found

 env(TZ) = WET-1WCT

On the 2. system env(TZ) doesn't exist

Ok I don't know why/where this variable is set. Perhaps this comes with our company configuration. As a solution I unset env(TZ) before any clock command is used.

RS: Looks like the daylight saving time was activated too early... Does your device show the same time as eTcl? Or, it's a bug in the timezone files that come with Tcl.

HE: The device shows the correct time. The problem is the environment variable TZ. It is set to WET-1WCT and overwrites the default systemsetting (as described in the documentation). Deleting env(TZ) is really the simplest way.


2008-01-02 LNA I experience an unexpected problem when executing a starkit under ETcl/Winblows. The command

 source [file join [file dirname [info script]] tile082.kit]

in my script rises error invalid command name "starkit::header". Under ActiveTcl it works without errors. What do I do wrong? EH eTcl doesn't natively supports starkits, but instead use its own kit implementation for packaging, which is nothing but ZIP archives with .etk extension. eTcl is however able to read starkits, and transform them automatically into eTcl kits, either using menu Tools->Kit manager in console, or from command line with etcl -applet kitconvert input.kit output.etk. Content of etk kit can be unwrapped using standard unzip command. AFAIK, ActiveTcl (at least at version 8.5) doesn't embeds starkit package in default setup. Related to your note about Tile "downgrade" to 0.8.0: you should not miss much commands in Tile 0.8.0, which is the transitional version included into Tk 8.5. For example, the "style" command you mention is there, available as "ttk::style" command. Tile 0.8.0 becoming de facto standard version in 8.5, are you really missing major 0.8.2 features? LNA Thank you so much for helping me.


2008-01-01 HE Thank you for the excellent distribution and the fast support in 2007.

 Today I found a difference between the appearance of checkbutton on the platform win32 and wince

 checkbutton .c1 -variable c1 -onvalue a -offvalue b -tristatevalue c
 pack .c1

 set c1 a ;# (on)  .c1 checked   with white background
 set c1 b ;# (off) .c1 unchecked with white background
 set c1 c ;# (tristate) 
        # .c1 checked with grey  background win32 (XP-Home)
        # .c1 checked with white background wince (WM 5.0)

Perhaps the grey value isn't dark enough to show on the display. 2008-01-01 EH Tk 8.5 uses System3dLight to fill background of checkbutton in tristate mode, which itself maps to COLOR_3DLIGHT as returned by O.S. using GetSysColor(). Using it to fill background is, IMHO, a wrong usage of it, since this color entry is defined as 'light color for three-dimensional display elements (for edges facing the light source)'. It happens to be light gray on default theme in XP/Vista, but WinCE defaults to white for it. Starting with rc26, eTcl will enforce light gray on WinCE to fill checkbutton in tristate mode.


2007-12-31 EH eTcl 1.0-rc25 has been released, to fix all bugs, regressions and incompatibilities reported so far in previous release, when switching from 8.4.x branch to 8.5.0. <dirofexe>/../lib has been restored in auto_path. An error causing system encoding initialisation to fail was fixed. And tcllib (version 1.10) has been packaged inside distribution, as an (optional) eTcl kit.


2007-12-26 LNA eTcl 1.0 rc24 contains Tile version 0.8.0. The previous release was built with 0.8.1. This downgrade might produce backward incompatibility (command "style" is not supported etc.). EH Since eTcl switched to 8.5.0, is embeds standard Tile/ttk version, now part of Tk. In RC23, Tile was an optional extension, and we could use HEAD version of CVS. For compatibility with others Tk distributions, I guess we will stick with Tile version part of Tk now. LNA Thanks a lot for the explanation. At least this sounds logical.


2007-12-26 HE What happened with the auto_path in eTcl 1.0 rc24? There are conditions it doesn't load packages that are loadable in rc23.

 I have the following installation:

 tcl/
 tcl/etcl-1.0-rc23/
 tcl/etcl-1.0-rc23/etcl-win32.exe
 tcl/etcl-1.0-rc24/
 tcl/etcl-1.0-rc24/etcl-win32.exe
 tcl/etcl-1.0-rc23.exe
 tcl/etcl-1.0-rc24.exe
 tcl/lib/
 tcl/lib/print_struct 
 ...

tcl/etcl-1.0-rc23.exe und tcl/etcl-1.0-rc24.exe are copies from the binaries for testing purpose.

Using etcl-1.0-rc23/etcl-win32.exe I can load the package print_struct with

 package require print_struct

This doesn't work with etcl-1.0-rc24/etcl-win32.exe. Looking at the auto_path variable shows the following:

 etcl-1.0-rc23/etcl-win32.exe:
 D:/tools/tcl/etcl-1.0-rc23/etcl-win32.exe/.etcl/vfs/core
 D:/tools/tcl/etcl-1.0-rc23/etcl-win32.exe/.etcl/vfs/core/etcl1.0
 D:/tools/tcl/etcl-1.0-rc23/etcl-win32.exe/.etcl/vfs/core/tcl8.4.16
 D:/tools/tcl/etcl-1.0-rc23/etcl-win32.exe/.etcl/vfs/core/tk8.4.16
 D:/tools/tcl/etcl-1.0-rc23/etcl-win32.exe/.etcl/vfs/extensions
 D:/tools/tcl/lib
 D:/tools/tcl/lib/HElib0.2
 D:/tools/tcl/lib/tcllib1.10

 etcl-1.0-rc24/etcl-win32.exe:
 D:/tools/tcl/etcl-1.0-rc24/etcl-win32.exe/.etcl/vfs/core/etcl1.0
 D:/tools/tcl/etcl-1.0-rc24/etcl-win32.exe/.etcl/vfs/core/tcl8.5.0
 D:/tools/tcl/etcl-1.0-rc24/etcl-win32.exe/.etcl/vfs/core/tk8.5.0
 D:/tools/tcl/etcl-1.0-rc24/etcl-win32.exe/.etcl/vfs/core/tk8.5.0/ttk
 D:/tools/tcl/etcl-1.0-rc24/etcl-win32.exe/.etcl/vfs/extensions

I'm missing at least D:/tools/tcl/lib in rc24. Or have I missed some new documentation?

With tcl/etcl-1.0-rc23.exe and tcl/etcl-1.0-rc24.exe I can load the package print_struct too.

2007-12-26 EH Directory <dir of exe>/lib is appended to auto_path on startup. So if you use a directory layout similar to:

 tcl/
 tcl/etcl-win32-1.0rc23.exe
 tcl/etcl-win32-1.0rc24.exe
 tcl/lib/
 tcl/lib/print_struct 

you should be able to load load print_struct from both rc23 and rc24 instances. I will check tomorrow SVN logs to see if this behavior was changed between rc23 and rc24 (i.e., if it used to be <dir of exe>/../lib). If it was, this modification wasn't on purpose. 2007-12-27 EH looking more in details in SVN's repository why <dir of exe>/../lib was no more there, found this was a consequence to a report for slow "package require" on some Linux systems, when eTcl executable was copied into /usr/bin. This was automatically appended /usr/lib and its sub-directories to search path for packages. This there are thousands of search directories on some Linux distributions, this had a bad impact of performance every time a "package require" was issued. Directory <dir of exe>/lib was preferred location for adding eTcl's specific libraries, and remains valid. Note however that is appears in auto_path list only if directory actually exists.

HE 2007-12-27 Thank you for the answer. I can understand the scanning issue. On the other side /usr/bin/lib isn't the place where I am usual looking for tcl packages. Ok. Can't change this. In my environments eTcl is located in my private directories like /home/holger or a sd-card. With <dir of exe>/../lib it's easy to hold all eTcl binaries of one version in one directory and couple of eTcl versions parallel in one structure. With <dir of exe>/lib all the eTcl binaries from all the versions are in the base directory. This conflicts a little bit with my sense of order. I will try to find an alternative way.

Some hourslater: Found the solution. I can use etcrc.tcl (and a copy with name .etclrc for linux) with

 lappend auto_path [info na]/../../lib

to reference the prefered lib directory.

HE 2007-12-28 This only works in interactive mode. etclrc.tcl is in the same directory as etcl-win32.exe. Starting a script foo.tcl with double klick doesn't load etclrc.tcl. The variable tcl_rcFileName shows the correct path. Some ideas what's going wrong? EH I believe this is normal Tcl behavior. With standard tclsh built from sources, ~/.tclshrc is also sourced only in interactive mode. HE You are right. ~/.tclshrc is sourced only in interactive mode. This is the crux. Sometimes I need a way to change the behavior of the tcl installation not only for interactive use. It would be nice, if tcl calls ~/.tclshrc in both modes. Better: Two different files. So it's possible to use different 'configuration' for the both modes. I think in multifile distributions like ActiveTcl I can manipulate lib/tk8.x/tk.tcl and lib/tcl8.x/init.tcl to change the startup behavior of the installation. eTcl is a singlefile distribution where this not work. tclkit is a singlefile distribution, too. But there is a way to manipulate the tclkit (Creating a small starkit with the wished changes and wrap it to a starpack. This starpack is the new tclkit). So what can I do to manipulate the startup behavior of eTcl (changing the auto_path, changing default dialogs with he-dialog, ...) without changing the scripts/applications? I ask myself if I was the only one who have this difficulties. EH Back to default auto_path value, since dropping <dir of exe>/../lib raises some issues, I will restore it in rc25 (minor release to fix few other minor issues), with eventually a specific exception for unix to not append /usr/lib and /usr/local/lib. Once correctly documented, does that seem to be an acceptable trade-off for everyone? HE For me: yes.


2007-11-19 SRIV Does eTcl for Pocket PC really have TclUDP in it? If so, how do you package require it? EH it was disabled for WinCE because we didn't finish patching it to resolve winsock2 symbols dynamically, and static linking was breaking compatibility of eTcl binary with older Winblows Mobile (2002/2003) systems. This is in the TODO list. On all others platforms, it is available using the usual 'package require udp'.


2007-11-19 HE Found 2 points etcl-1.0-rc23 w32 works different as expected. First I missed the package tcltest. I thought this is part of the tcl core. Second the menu Optionen->Registriere... (german locale) works strange. I have one copy from eTcl in one directory as working version. This is bind to eTcl script (.tcl). A second copy is in another directory for testing purpose. I want to bind this copy to .etk. Doing this with the menu destroys the registration for the working copy. Is there any possibility to save only the diffs? 2007-11-20 EH About tcltest, this is part of the core, but it's a native extension, which can be enabled or disabled at build time. I considered it as a validation tool, not much useful for final user on Winblows Mobile platforms, so didn't enable it to save some kB. But sounds like this was a wrong appreciation. I may reenable it, at least in normal and full versions. About file association, this is just a GUI missing feature. When you press "Ok" in file association dialog, an unchecked box is interpreted as 'delete this file association'. I will consider using tri-state checkboxes, so you will have the choice to delete file association, register it or, for last state, leave it unmodified. Meantime, you may of course use a registry editor (or a small Tcl script using registry package) to enforce specific file associations.


2007-10-18 Bug in etcl-1.0-rc23-wince-arm-full-setup.exe on HP iPAQ The msgcat package provided with the newclock package conflicts with the standard msgcat package.

 1% package require newclock
 Can't find a usable clock.tcl in the following directories: 
    {/Program Files/eTcl/etcl-full.exe/.etcl/vfs/core/tcl8.4.16/newclock1.0.1}
 {/Program      Files/eTcl/etcl-full.exe/.etcl/vfs/extensions/newclock1.0.1}
 {/Program Files/eTcl/etcl-full.exe/.etcl/vfs/core/etcl1.0/newclock1.0.1}
 {/Program  Files/eTcl/etcl-full.exe/.etcl/vfs/core/newclock1.0.1}
 {/Program Files/lib/newclock1.0.1}
 {/Program Files/eTcl/etcl-full.exe/.etcl/vfs/core/tk8.4.16/newclock1.0.1}
 /lib/newclock1.0.1
 {/Program Files/library}
 /library
 /newclock1.0.1/library

 /Program Files/eTcl/etcl-full.exe/.etcl/vfs/extensions/newclock1.0.1/clock.tcl: conflicting versions provided
 for package "msgcat": 1.3.4, then 1.4.1
 conflicting versions provided for package "msgcat": 1.3.4, then 1.4.1
    while executing
 "package provide msgcat 1.4.1"
    (file "/Program Files/eTcl/etcl-full.exe/.etcl/vfs/extensions/newclock1.0.1/msgcat.tcl" line 22)
    invoked from within
 "source [file join [file dirname [info script]] msgcat.tcl]"
    invoked from within
 "if { ![package vsatisfies [package provide Tcl] 8.5] } {
    package require dict 8.5.2
    source [file join [file dirname [info script]] msgcat.tcl]..."
    (file "/Program Files/eTcl/etcl-full.exe/.etcl/vfs/extensions/newclock1.0.1/clock.tcl" line 25)
    invoked from within
 "source {/Program Files/eTcl/etcl-full.exe/.etcl/vfs/extensions/newclock1.0.1/clock.tcl}"
    ("uplevel" body line 1)
    invoked from within
 "uplevel #0 [list source $file]"

 This probably means that newclock wasn't installed properly. 

2007-10-22 EH Error occurs only if default msgcat version (1.3.4 version provided by Tcl core) has been required explicitly before newclock package is required. Newclock requires a 1.4.x msgcat package. Starting from eTcl 1.0-rc24, path to this 1.4.x version of msgcat is automatically added to auto_path, so a [package require msgcat] will always provide 1.4.1, working around problem reported above. Note that requiring newclock package as early as possible in your script, and before msgcat, will work around this problem, including with versions older than 1.0-rc24


2007-09-22 PG I have 3 comments :

  1. - when creating a Thread on a Pocket PC it seems the stack has the same size as for the main Thread. So on a Pocket PC, if we want to use several treads to execute some tiny code, we quickly get out of memory. For example, the use of Threads to play async sound will crash the application after several repetitive calls to the "playsound" proc. This is just something to be aware of, because I don't see an easy workaround. EH Do you create a thread per sound to play, without releasing thread at any time? PG Thread is released when sound is terminated but if there is a burst of sound requests for playing a 3 seconds wav file, and if the burst consists of 10 requests to play sounds in just 2 seconds (because the user keeps pressing widgets), you will have 10 threads at once, hence consuming 10 x 768 kB of stack, which may lead to an out of memory error. As I said I see no easy work around (for my particular problem, the workaround is of course really easy), except that the coder should be aware that Thread are not always so "LWP" (LightWeight Processes).
  2. - I use Etcl for UI and an external native C program for CPU intensive stuff (let's call it "engine"). I noticed that the priority of the Etcl main thread is 251. If my engine is set to a priority of 252, everything is fine, except that my engine is less efficient than when I set its priority to 251. But in that case, Etcl simply gets frozen (unresponsive). So the round robin scheduler of winCE does not seem to work in that case. I noticed that I have 3 threads in Etcl process : would it possible that one of them has a priority greater than 251, in that case it is never scheduled, and the UI does not get CPU time ?
  3. - On winCE I use the title bar to display information. In that case, it seems that clicking on my prog icon again triggers the busy cursor for a few seconds but then nothing happens. To put my app to the foreground again, I have to use a task manager. So is there a way to make my app go back to the foreground when clicking on its icon ?

2007-09-12 LS Is there a way for me (without access to source) to correct keyboard mapping on a Samsung Blackjack? The E and R keys report 1, the T and Y keys report 2, etc... I see the problem in text and entry widgets and keypress events while the console seems to work correctly. EH I don't have BlackJack device for testing, but since you report console seems to work, I guess input mode default to digits, and you need to explicitly set input type for widgets expecting alphanumeric input. This is achieved thanks to 'wce inputmethod $widget spell' command (need to issue package require wce first). If you want to set this automatically for any text or entry widget, you may prefer to define a binding for those classes to set this automatically when widget is created.

Thanks for your help EH.

 To solve the key problem I used:
 bind Text <Map> {wce inputmode %W spell}
 bind Entry <Map> {wce inputmode %W spell}

 To traverse between input widgets:
 bind . <Shift-Down> {focus [tk_focusNext [focus]]}
 bind . <Shift-Up> {focus [tk_focusPrev [focus]]}

 And for button clicks:
 bind .b <Return> {script...}

 Also to gain initial window focus:
 raise .
 focus .an_input_widget

2007-08-12 XO While trying to run r22, the version for Linux - arm (uClibc) linux-arm Gzipped TAR archive, on another ARM9 module, SC3 2440 - 400MHz, 128MB SDRAM, 4MB NOR Flash, 64MB NAND Flash, with 1 or 2GB miniSD, The module is running Linux 2.6.18, however I got an error Illegal Instruction, is this having something to do with the uClibc support? I thought this is standalone self-contained executable.

2007-08-15 XO Suspect that the Linux Kernel on that ARM Target Module did not have the proper FPE (Floating Point Emulator) configured. Did some research in this regard, it seems that FPE has terrible performance, due to the fact that each Floating-point instruction gets a "Illegal Instruction Fault" & redirected the request to the Floating-point emulator. Wouldn't it be nice to build the code with soft floating point library enabled? (After all, not many ARM chip is implementing the floating point processor, or is it? correct me if I'm wrong. ^o^)

2007-08-15 EH But also nowadays, not many arm-linux systems are configured without any FPE support in kernel either. By providing a static executable built in hard-float mode, this allows final user to choose whatever kernel FPE he prefers (e.g. NetWinder or Fast FPE), while same static executable will take benefit of FPU if available. Performance isn't much important here actually, since Tcl/eTcl itself doesn't do much float operations anyway, and I guess nobody will rely on Tcl on arm-linux to do some math. That said, we already support arm-softfloat-linux for some of our customers, so if/since there is also a demand for it for our public release, we will consider adding it to list of supported architectures before next release. Then, I bet one will ask for a mipseb-linux version (since mipsel-linux is already there), and list will be more or less exhaustive ;-) If you are available to do some beta-testing for the arm-softfloat-linux version before it gets officially released, don't hesitate to let me know here or by email.


2007-08-11 XO rc22: I have recently bought a PocketPC Phone, with Winblows Mobile 6.0 Professional(Traditional Chinese Edition), however I couldn't get r22 to install on my PocketPC. From the homepage, it seems that the download is for Winblows Mobile (2003, 2003SE and 5.0) - ARM/XScale. I was wondering is there an eTcl for 6.0?

Note: http://objectmix.com/tcl/35398-announce-etcl-1-0-rc22.html says 6.0 is supported by rc22

2007-08-11 EH Announce is correct, and I updated eTcl page to reflect support for WM6.0. Due to a synchronization problem, some CAB files part of eTcl 1.0-rc22 early distribution (which were online during a couple of days) were generated with an invalid VersionMax value, and couldn't be installed on Winblows Mobile 6 devices, and some Winblows Mobile 5 smartphones. Those cabinets have been updated to fix this incompatibility. Please get CAB or installer again (eTcl version hasn't been incremented, so CAB has same name, but valid VersionMax=6 meta data). Sorry for annoyance.

2007-08-11 XO Thanks! Now eTcl is running on my PocketPC Phone dopod CHT9110, OEM ID TRIN100, Probably a successor Model to HTC P3600, with 3.5G support,... ARM9(SC3 2442 B) 500MHz, 64MB RAM, 256MB Flash, with a 2GB MiniSD. Did run various distros of Tcl, including eTcl on Linux and Winblows box before, this is the first time ever run it on hand held devices, kind of cool!

TP I was able to install eTcl r22 on a WM6 PocketPC Phone (T-Mobile Wing, aka HTC 4350 Herald, english), I installed from the the .cab file, if that makes a difference.


2007-07-17 HE rc20: The following code draws a dashed line instead of a drawn through line:

 canvas .c
 pack .c
 .c create line 0 0 20 20

2007-07-19 EH Oops, this one is quite annoying! Inverted test when deciding to render line dashed or solid, since we introduced support for extended dashed patterns and offsets for Win32/WinCE platforms in rc20. We fix this and release a patched version for WinCE/Win32 ASAP. Thanks for reporting.

2007-06-25 HE What is the reason for the growing file size of rc21 (win32):

 rc19:  6241KB
 rc20:  6259KB
 rc21: 22940KB

EH looks like a packaging error, which silently failed to strip executable for Win32 platform. I strip them and put in online. Thanks for reporting! (don't hesitate to report bugs by email, I check them more often than wiki).


2008-11-29 HaO rc29 -> rc30: (etcl-1.0-rc30-wce3-arm-compact-setup.exe) console show now works.

If I start an application by a double click on a.etk, there is first the Console menu shown. To show the application menu (set by BWidget MainFrame) the application window must be minimized and back maximized by the taskbar.

PWE If memory serves me correctly, this is not a new issue. Try giving your application the focus explicitly (with the focus command), and make sure your app is on top with a "raise .".

HaO Both is the case but I may still try changing the invocation order...


2008-12-05 HaO p.etk is sourced by etcl.exe. Is it possible to find the path of p.etk in a script in p.etk?

In a starkit, the kit is mounted under its name and thus the path may be found by file dirname $starkit::topdir. In etcl, the kit is mounted under the etcl binary (which is IMHO conceptionally a good thing) so $starkit::topdir contains for example c:/Program Files/Evolane/eTcl/bin/etcl.exe/.etcl/vfs/main. 2008-12-08 EH As of 1.0-rc31, there is no trivial way to retrieve this information. To answer your request, we added introspection functions into ZIP virtual filesystem, and a simple '::etcl::startkit ?script?' procedure to retrieve absolute path to kit containing startup script (or any file given as argument). Will be part of eTcl 1.0 final, scheduled for end of december 2008.


2008-12-09 HaO I have tested the unsupported etcl-1.0-rc31-wce3-arm-compact-setup.exe:

  • scrollbars are now much wider which does not look very good 2008-12-10 EH How much wider? What does
  set sb [scrollbar .sb] ; .sb cget -width

reports on your device ? On WM6 QVGA device, this is typically 12. Scrollbar width used to be hardcoded to 11 in eTcl, but now relies on native properties reported by OS (namely, GetSystemMetrics(SM_CYHSCROLL)), and may vary from one terminal to another. This aims to provide more consistent native look&feel, for any of the numerous display geometries available on WM devices nowadays. If value returned by OS is broken on some older (WM2000/2002) devices, we may add some heuristic to fallback to hardcoded (say 12 pixels) value there. Note that you may still enforce your own settings, or revert to previous behaviour, by inserting a Tk option somewhere early in your code:

  option add *Scrollbar*width 12

HaO Yes, so its a feature. They have the system size now which is around twice as wide.


2009-02-13 NL

Am I right that Tclib is not included in full version of eTcl for Pocket PC? At least packages like math::constants and so on? Or do I do something wrong?

2009-05-15 hae

From version eTcl 1.0 on setting the font of the text widget is achieved with

console eval {.frames.app1.content.text configure -font {{Consolas} 8}}

For some introspection this is useful.

console eval {foreach c [lsort [info commands]] {
puts $c 
}}

2011-09-05 RichZ

I have downloaded and installed etcl-1.0.1-wince-arm-all.zip on WinCE 6.0 PNA and trying to make http://home.versatel.nl/pwelten/mapweltmain.html work. Works quite fine - except for the GPS reception. Have tried simple reading from serial port, fileevents, some fconfigure variations but get asbolutely zero data. Now I have tried wce gps and am getting an error popup saying "failed to get GPS position", the internal GPS unit had already found its position at this moment. In other experiments I tried to read the serial port receiveing the TMC messages, also without any success.

However the GPS port works fine from all other programs. What could be wrong?

2011-09-06 RichZ

Found a way to read the GPS port. Fileevents and nothing else works though, neither wce gps.

set fout [open  "/SDMMC/GPS2b.log" w]
set serialport [open com7:]

after 200 { set a 1 }
vwait a

for  { set n 1 } { $n < 600 } { incr n } {
 after 10 { set a 1 }
 vwait a

 puts $fout "$n:"
 set data [read $serialport]
 puts $fout $data
}

exit 0

Hacked mapwelt to use this approach and it works very nicely except GPS port autodetection does not work with this approach. Here is the code I used:

## add at same level as collectGPSData
      proc my_collectGPSData { } {
        global lastline f
#Looks like the other thread does not process anymore, so stop and close the serial port
#(We might be choking the main thread) 162 is about 45 seconds worth of data
        #log entered my_collectGPSData
          
        if {[tsv::llength gpsthread gpslines] > 162 } {
          tsv::lappend gpsthread lasterror "gpsthread_buffer OverFlow"
          thread::send -async [tsv::get gpsthread parentid] { noConnection }
          close $f
          thread::release
          return
        }

        after 180 { set a 1 }
        vwait a

        set data [read $f]
        if { $data eq "" } {
          return
        }
        #log got gpsdata
        #log $data
        # data -> line..:
        # split data "\n"
        # set line ${lastline}${line}          
        set lastline ""
        foreach line [split $data "\n"] {
            set ind  [string first $ $line 2]
            if { $ind > -1 } {
                set lastline [string range $line $ind end]
                set line [string range $line 0 [expr {$ind -1}]]
            }
        
            set ret 0
            if {[catch { set ret [checkNMEAchecksum $line] } foutje ] } {
                tsv::lappend gpsthread lasterror checkNMEAchecksumerror $line
            }
            if { $ret } {
                if { $line ne "" } {
                    tsv::lappend gpsthread gpslines $line
                }
            } else {
                tsv::lappend gpsthread lasterror checksumerror $line
            }
        }
      }

## and further down in switchgps
      if { $settings(gpscommspeed) ne "FILE" } {
        thread::send $settings(gpsthread) [format {set f [open %s] } $settings(gpscommdevice) ]
#         if { $settings(gpscommspeed) ne "" } {
# #Non-blocking mode prevents half finished sentences (but creates empty ones)
#           thread::send $settings(gpsthread) [format {fconfigure $f -mode %s } $settings(gpscommspeed)]
# #          thread::send $settings(gpsthread) [format {fconfigure $f -mode %s -handshake rtscts  -blocking 0} $settings(gpscommspeed)]
#         }

#        thread::send -async $settings(gpsthread) {fileevent $f readable collectGPSData }
        tsv::set gpsthread stop 0
        thread::send -async $settings(gpsthread) {
             while { ([tsv::get gpsthread stop] == 0 )} {
                 my_collectGPSData                 
             }
        }
      } else {