[4173] in comp.os.os2.announce archive

home help back first fref pref prev next nref lref last post

SOFTWARE: Tcl 7.6/Tk 4.2 for OS/2 on Hobbes and Neosoft

daemon@ATHENA.MIT.EDU (Illya Vaes)
Wed Jul 1 02:38:19 1998

To: os2ann.DISCUSS@bloom-picayune.mit.edu
Date: 23 Jun 1998 12:09:00 -0400
From: ivaes@hr.nl (Illya Vaes)
Reply-To: ivaes@hr.nl (Illya Vaes)

Reply-to:     ivaes@hr.nl (Illya Vaes)
[Followups directed to comp.os.os2.programmer.tools]
---------------------------------------------------------------------
I have uploaded my OS/2-port of Tcl 7.6/Tk 4.2 to both the Hobbes OS/2
archive and the Neosoft Tcl archive.

At Hobbes, it's in two zip-files (source and executables) in incoming:
   ftp://hobbes.nmsu.edu/pub/incoming/tk42os2s.zip    and
   ftp://hobbes.nmsu.edu/pub/incoming/tk42os2x.zip ,
expected to be moved to
   ftp://hobbes.nmsu.edu/pub/os2/dev/tcl/tk42os2s.zip   and
   ftp://hobbes.nmsu.edu/pub/os2/dev/tcl/tk42os2x.zip .

At Neosoft, it's in two gnu-zipped tar-files (source and executables) in
   ftp://ftp.neosoft.com/pub/tcl/sorted/distrib/tkos2-4.2s.tar.gz   and
   ftp://ftp.neosoft.com/pub/tcl/sorted/distrib/tkos2-4.2x.tar.gz .

For us Europeans and the relatively large OS/2 market in Germany, the
zips will also be uploaded to LEO (Link Everything Online) in
   ftp://ftp.leo.org/incoming/os2/tk42os2s.zip   and
   ftp://ftp.leo.org/incoming/os2/tk42os2x.zip .
where they are expected to be moved to

ftp://ftp.leo.org/pub/comp/os/os2/leo/devtools/languages/tk42os2s.zip  
and
   ftp://ftp.leo.org/pub/comp/os/os2/leo/devtools/languages/tk42os2x.zip

The executables require the runtime DLL's from EMX v0.9c.

---

Relevant portions of the accompanying README file (Release Notes):

Last update: 21 June 1998
Illya Vaes
Martin Luther Kingstate 23
6716 NA Ede
The Netherlands
ivaes@hr.nl (work; this was/is a free time project)

Welcome to Tcl 7.6p2/Tk 4.2p2 for OS/2 PM.

Installation:
Unzip the archive, making sure directories are preserved (PKzip needs -d).
As long as the binaries (tclsh76.exe, tclshpm76.exe and wish42.exe) are
started in the same directory as their DLLs (tcl76.dll and tk42.dll), you
don't need to do anything else. If you want to be able to start them from
anywhere, you have to put the directory in your path or put the executables
in a directory that already is in your PATH (and the DLLs in your LIBPATH).
In such a case, it becomes quite likely that Tcl will not be able to find
out the location of its library by itself, so you're recommended to add
environment variables for those to your CONFIG.SYS (if you want them to
persist, that is), e.g. SET TCL_LIBRARY=E:/TclTk/lib/tcl and
TK_LIBRARY=E:/TclTk/lib/tk. Paths in Tcl/Tk use _forward_ slashes, in this
port too! You can change to a different drive (and, if you like to a
different directory there at the same time) by saying e.g. "cd
e:/tk4.2/os2". Tcl uses the environment variable TEMP (native OS/2 format,
backslashes) to determine the directory in which to make temporary files
(eg. for use with pipelines).

This port has been compiled with EMX 0.9c, and requires its EMXLIBCM.DLL and
EMX.DLL (or those of a higher version). Kudos to Eberhard Mattes for EMX.

Compiling:
To compile the source yourself, you need the Tcl and Tk source from Sun.
After extracting it (gzip -c -d tcl7.6p2.tar.gz | tar xvf -) on your drive,
unzip the source-zip of Tcl/Tk for OS/2 on the same drive, go to tcl7.6\os2
and execute 'gmake'.

Obviously, you need gzip, tar, unzip and gmake for this, as well as EMX.
Also, \OS2\RC.EXE was used.

Using the DLLs in other applications:
To make use of tcl76.dll and/or tk42.dll in other applications, you have to
link the executables of those with tcl76.lib and/or tk42.lib (the import
libraries corresponding to the DLLs), and include code in your EXE to
initialize and use Tcl/Tk (or initializing your own package, depending on
how you look at it), as is shown in the file tclAppInit.c and tkAppInit.c.
See the Makefile for files to link with your executable, taking note of the
way a command-line Tcl-application is built (eg. always with tclOS2Main.c
with or without defining CLI_VERSION, tclOS2Console.c only when building a
PM-based Tcl application). If, for some reason, you only have tcl76.dll
and/or tk42.dll and not the .lib files, then you can generate the latter by
using emxexp and emximp (2x). See the Makefile (targets $(TKBASE).def,
$(TKBASE).imp and $(TKLIB)) for how to.

NOTES
=====
- When you are in TclshPM, you can say "load <full-path-to-tk42.dll>" and
  you have gotten all of Tk at your disposal (without wish's console). Eg.
  "load E:/TclTk/bin/tk42.dll".
- The native File Dialogs don't really support a "default extension" (like
  in Windows), probably because OS/2 has *real* file types not related to
  the filename. The code around the File dialogs will however add any given
  default extension to any given initial file if that has no extension yet.
  If the user then types in a file without an extension or choose one, then
  _no_ extension is added (since the file dialog gives no such control).
  This could probably be added after the dialog (adding the extension then),
  but who am I to second-guess the user... Anyway, the Mac ignores
  extensions.
- Because of difference in fonts and such, layout of scripts may turn out
  wrong. This includes the test script hscale.tcl for instance, where the
  arrow that follows the scale starts further to the left than the scale.
  Changing the "-wraplength" option to the label $w.msg from 3.5i to 300
  makes it (approx.) correct.
- Fonts need to be specified in the same case as Presentation Manager knows,
  eg. Helvetica (not helvetica), Times New Roman (not times), ...
- Mouse buttons are those known to OS/2, i.e.,. Button 2 is the *right* button,
  not the middle one as in X. Of course, for consistent lefties (I only
  write left-handed) Button 2 is the left button ;-)

Programs that are known to run (with or without minor modification)
-------------------------------------------------------------------
Some apps seem to get into an infinite loop upon closing the main window
with
double clicking the window menu button (the icon topleft). At least
Paradigm
Visual Make does this. Visual Tcl and XF correctly intercept the
WM_DELETE_WINDOW and/or other WM_PROTOCOLS.

- TkCon 1.03
  The switch statement setting the envHome variable ("Determine what
  directory the resource file should be in") must be augmented with an "os2"
  pattern:
    "windows - os2 - unix    { set envHome HOME }"   instead of
    "windows - unix    { set envHome HOME }"
  And set the HOME environment variable in CONFIG.SYS of course...
- SpecTcl 1.1
  Several tcl_platform checks need to have OS/2 added, which is easiest in
  case statements by adding a line with "os2 -" before the "windows" case,
  thereby making the Windows code pertinent to OS/2 too.
- Visual Tcl 1.08
  A smaller font must be specified to get the texts to show in their
  entirety in the "Geometry Information" dialog, eg {8.Helv}.
- Paradigm Visual Make (pvm_12).
  Needs to have the testing for the platform to be augmented with OS/2, with
  the same actions as for Windows.
- XF 4.0pl1.
  Needs to have "exec command.com..." changed to "exec cmd.exe" in
  src/xfglobals.tcl and src/xfmisc.tcl (failure to do this will crash the
  program), and the scripts xfhardcopy/xfhardcopy.tcl and
  xfappdef/xfappdef.tcl need to have their wish modified to wish42.exe.

TESTS THAT FAIL
===============
Tk:
- Some tests fail because a default font is chosen instead of returning
  an error.
- Some tests fail because the fontname isn't capitalized (eg. helvetica
  instead of Helvetica) and so a default font is chosen.
- Tests in winfo.test with winfo interps fail since X Properties are not
  supported (future implementation via Prf... ?).
- Some tests fail because font sizes / rounding may vary between X and
  PM (eg. entry xview or entry index @nr with a proportional font).
- imgPPM.test fails because the file isn't written in a cross-platform
  manner.  Supposedly fixed in 8.0.
- canvPsText.tcl: fails to select the correct fonts because they are
  specified in lower case, while OS/2 font names start with a capital (eg.
  Helvetica), while 'times' should be 'Times New Roman'.

Tcl:
- The Tcl env.test fails (after hacking it to use printenv.exe and a path
  separator of ';' instead of ':') because EMX insert a variable _emx_sig,
  after the the contents of the environment that Tcl gets have been
  determined, so all results are "off" by that variable.
- Format: values that would get truncated to 0 seem to be rounded upwards by
  EMX to the nearest non-0 value. This makes two format tests fail (ie.
  %3.1f and 0.01 gives 0.1 instead of 0.0, but %3.1f and 0.001 gives 0.0).
  Two other formats that fail concern "%#.0g" and "%#.4g", where EMX seems
  to take the number of digits after the decimal point more literally than
  the tests expect, rendering 0.0000 and 0. respectively (0.000 and 0.0
  expected). Other than this, all Tcl tests work correctly.

HISTORICAL CHANGES
==================

7.6/4.2
=======
- Tclsh76.exe is now a command line interface (CLI) version of tclsh.exe. In
  this version you can*NOT* say "load tk42" and have Tk at your disposal,
  since this version has PM usage switched off (mutually exclusive). The
  previous PM implementation is now called tclshpm76.exe. Note: the CLI
  version has a nasty side effect of making the window in which it is run
  lose focus; under FeelX the window even has the active titlebar so FeelX
  must think the focus is there, but typing in the window has no effect. You
  must move your mouse out of the window and back in.
- Native File Open/Save Dialog. If you use object types names as known to
  the WPS, you can select files based purely on their type (not extension).
  Note: for compatibility with existing (non-WPS aware) scripts, the initial
  selection is with "type" <All Files>, so the name is significant.
- Sockets are now handled (in/by code) like in the Unix version, making the
  reliance on EMX more obvious (it was already present) because it makes the
  use of sockets transparent, like on Unix.
- NotifyVisibility events are now only generated for windows that are
  showing according to PM (WinIsWindowShowing) and Tk considers mapped
  (TK_MAPPED). Previously, the Windows port of generating it for every
  TK_MAPPED child (because Windows has no equivalent of WinIsWindowShowing,
  only of WinIsWindowVisible, which returns true for windows that are
  completely obscured too) was used unchanged. Any event still has a state
  of VisibilityUnobscured. More accurate transition info could be generated,
  but in my opinion would be too expensive (both in computation and memory)
  compared to its use. Some changes from the 8.0 Windows version have been
  incorporated to fix the double Map/Unmap binding triggering in two tests
  in textWind.test.
- The names for temporary files are now determined with tempnam(), which
  made eg. "exec cat << {Sample text}" work correctly. This, however, left
  the temporary behind since that is closed (and tried to be deleted) before
  the program that is reading from it (cat) exits, giving a sharing
  violation. Therefore, when a temp file cannot be deleted, it is added to a
  list of temp files as yet undeleted, to be deleted on exit. An exit
  procedure is registered for that, which tries to close and delete every
  file in the list, ignoring any errors. If that doesn't do it.... you're
  out of luck :-). Oh... and EMX 0.9c has TMP_MAX defined as 1000, so after
  so many temp files it starts over, so make sure you don't make that much
  at the same time... ;-)
- Winfo rooty and winfo containing gave incorrect results, fixed.
- Bug in XCopyPlane fixed.
- Moving rectangles left spurious lines to the right (eg. widget demo,
  arrowhead for canvas lines editor); fixed.
- Optional compiling of key-handling fixes suggested by Ilya Zakharevich
  (break e.g. Ctrl-X).
- Fixes suggested by Ilya Zakharevich (fonts):
  + Consider the "10" in e.g. "10.Courier" to be pixels, not points.
  + Use lMaxBaselineExt as height indicator for pixmap fonts instead of
    emHeight.
  + Compile option for "display resolution correction" (ignoring what PM
    tells us and using a given resolution, default 72 dpi.
  + Default text font "10.Courier" when that "correction" is used.
- The format of $tcl_platform(platform) has been changed to "os2" to make it
  more consistent with those of other platforms ("unix", "macintosh",
  "windows"). $tcl_platform(os) still returns "OS/2".
- The Tclsh console now shows output sent to "stdout" or "stderr" when
  running interactively. The tests make use of these explicit channel names.
- Transients now get a dialogborder.

-- 
Illya Vaes   (ivaes@hr.nl)    "Do...or do not, there is no 'try'" - Yoda
Holland Railconsult BV, Railtraffic Systems, Control Systems
Postbus 2855, 3500 GW Utrecht
Tel +31.30.2358586, Fax 2357202       Not speaking for anyone but myself
_____________________________________________________________________
| NOTE: Please EMAIL submissions to comp-os-os2-announce@moderators.isc.org
| Correspondence to the COOA Moderator: lfirrantello@bix.com .
| Please see: http://www.bix.com/pub/os2ann/pindex.htm for posting guidelines

home help back first fref pref prev next nref lref last post