home *** CD-ROM | disk | FTP | other *** search
/ ftp.pasteur.org/FAQ/ / ftp-pasteur-org-FAQ.zip / FAQ / tcl-faq / tk / windows < prev   
Encoding:
Internet Message Format  |  2001-07-18  |  49.3 KB

  1. Path: senator-bedfellow.mit.edu!dreaderd!not-for-mail
  2. Message-ID: <tcl-faq/tk/windows_995366276@rtfm.mit.edu>
  3. Supersedes: <tcl-faq/tk/windows_992768608@rtfm.mit.edu>
  4. Expires: 30 Aug 2001 10:37:56 GMT
  5. X-Last-Updated: 1999/07/13
  6. Organization: none
  7. From: erc@pconline.com
  8. Newsgroups: comp.lang.tcl,comp.answers,news.answers
  9. Followup-To: poster
  10. Subject: Tcl/Tk on Windows Frequently-Asked Questions
  11. Approved: news-answers-request@MIT.EDU
  12. Originator: faqserv@penguin-lust.MIT.EDU
  13. Date: 17 Jul 2001 10:39:39 GMT
  14. Lines: 1451
  15. NNTP-Posting-Host: penguin-lust.mit.edu
  16. X-Trace: 995366379 senator-bedfellow.mit.edu 1910 18.181.0.29
  17. Xref: senator-bedfellow.mit.edu comp.lang.tcl:171223 comp.answers:46267 news.answers:211529
  18.  
  19. Archive-name: tcl-faq/tk/windows
  20. Posting-Frequency: monthly
  21. Last-modified: 1999/07/13
  22.  
  23.     Newsgroups: comp.lang.tcl, comp.answers, news.answers
  24.     Followup-To: poster
  25.  
  26.     Archive-name: tcl-faq/tk/windows
  27.     Posting-Frequency: monthly
  28.     Last-modified: 1999/07/13
  29.  
  30.  
  31.     Tcl/Tk on Windows Frequently-Asked Questions
  32.     --------------------------------------------
  33.  
  34.     Tcl is a scripting language that runs on Windows, UNIX and
  35.     Macintosh platforms. Tk is a standard add-on to Tcl that provides
  36.     commands to quickly and easily create user interfaces. Even though
  37.     Tcl was originally created on UNIX, your Tcl scripts should run the
  38.     same on all supported platforms, except for a few differences. This
  39.     document describes those differences on Windows.
  40.  
  41.     This list of frequently-asked questions, also called a FAQ, covers
  42.     problems with the Tcl/Tk programming on the Windows platform.
  43.     Please send any additions or corrections to Eric Foster-Johnson
  44.     (the email address is at the bottom). This FAQ is located on the
  45.     Internet at the following URL:
  46.  
  47.     http://www.pconline.com/~erc/tclwin.htm
  48.  
  49.  
  50.     Getting Started
  51.     ---------------
  52.  
  53.     Tcl/Tk runs on the following versions of Windows.
  54.  
  55.       Windows 3.1
  56.             Requires Win32s 1.30; no support starting with version
  57.             8.0.3.
  58.  
  59.       Windows 95
  60.             Supported.
  61.  
  62.       Windows 98
  63.             Some problems reported in comp.lang.tcl Internet newsgroup.
  64.  
  65.       Windows NT
  66.             Supported.
  67.  
  68.       Windows CE
  69.             A port appears to be in progress; please keep me informed.
  70.             I will gladly beta-test a CE version on my SH3 (LG Phenom
  71.             Ultra) system.
  72.  
  73.     First, get the binary release of Tcl/Tk for Windows. The latest
  74.     release is Tcl/Tk 8.1.1, tcl811.exe. Each binary release comes as a
  75.     self-extracting archive. Run the program to install Tcl.
  76.  
  77.       Note: The default installation location is C:\Program Files\Tcl.
  78.       Directory names with spaces can cause some problems with Tcl,
  79.       so I recommend installing into the C:\Tcl directory.
  80.  
  81.     Once you have installed Tcl, you can double-click on any .tcl file
  82.     in the Windows Explorer to run the Tcl script.
  83.  
  84.  
  85.     Creating Scripts
  86.     ----------------
  87.  
  88.     Tcl script files are really plain text files and should end with a
  89.     .tcl extension. You can use any editor that can create text files
  90.     (including Microsoft Word) to edit your Tcl scripts. Two editors
  91.     recommended on the Internet include HomeSite (really intended for
  92.     editing Web HTML files) located at http://www.allaire.com/ and the
  93.     Programmer's File Editor, located at
  94.     http://www.lancs.ac.uk/people/cpaap/pfe/. The WordPad editor, which
  95.     comes with Windows, has lots of problems, especially since it likes
  96.     to append a .txt extension to all text files it creates (and you
  97.     want a .tcl extension for Windows Tcl scripts).
  98.  
  99.  
  100.     Learning Tcl
  101.     ------------
  102.  
  103.     The Tcl language is described in a number of books, including:
  104.  
  105.             Tcl and the Tk Toolkit by John Ousterhout, Addison-Wesley,
  106.             1994.
  107.  
  108.             Practical Programming with Tcl and Tk by Brent Welch,
  109.             Prentice Hall, 1997.
  110.  
  111.             Graphical Applications with Tcl and Tk Second Edition by
  112.             Eric Foster-Johnson, M&T Books, 1997, a book by yours truly
  113.             that covers cross-platform development with Tcl and Tk on
  114.             Windows and UNIX.
  115.  
  116.             Effective Tcl/Tk Programming by Mark Harrison and Michael
  117.             McLennan, Addison-Wesley, 1997.
  118.  
  119.     I maintain a number of Web pages on Tcl that can also help.
  120.  
  121.  
  122.     Questions
  123.     ---------
  124.  
  125.     Questions answered here include:
  126.  
  127.       How to get Tcl/Tk For Windows
  128.             A-1: Binary release of Tcl/Tk.
  129.             A-2: How to Run Scripts from Windows
  130.  
  131.       Installing/Can't Run At All
  132.             I-1: Don't upgrade over a previous version
  133.  
  134.       Differences From Unix
  135.             D-1: \ Won't Work!
  136.             D-2: How to create a valid font name on Windows
  137.             D-3: Cut, copy and paste in the Tcl Console window
  138.             D-4: Using the Windows Clipboard
  139.             D-5: send is not implemented on Windows
  140.             D-6: Start-up Files tclsh.rc and wishrc.tcl
  141.             D-7: Accessing PC serial ports from Tcl
  142.             D-8: Using UNC file names
  143.             D-9: Getting list of mounted drives
  144.             D-10: Accessing the Windows Registry
  145.             D-11: Using Dynamic data Exchange (DDE)
  146.             D-12: winfo interps and send fails on Windows
  147.             D-13: Installing Tcl/Tk Applications on Windows
  148.             D-14: Making executable scripts on NT
  149.  
  150.       Windows-Specific Bugs and Problems
  151.             B-1: Puts bugs.
  152.             B-2: fileevent only supports sockets under Windows until
  153.             8.1
  154.             B-3: You need at least 256 colors and may have problems
  155.             with more than 256
  156.             B-4: Problems with clock command on Windows
  157.             B-5: wm iconbitmap doesn't work on Windows
  158.             B-6: If you use a pipe (|) in open, until the child process
  159.             has terminated no events will be processed.
  160.             B-7: The rightmost mouse button is Button-3.
  161.             B-8: Tk on Windows supports cursors
  162.             B-9: Sockets are not available on the system error
  163.             B-10: toplevel -container does not work
  164.             B-11: exec: couldn't create error file for command: Error 0
  165.  
  166.       Old Bugs
  167.             O-1: Wish uses a lot of system resources and doesn't free
  168.             them.
  169.             O-2: Once exec fails, the next exec generates a fatal
  170.             error.
  171.  
  172.       Compiling and Writing C and C++ Extensions
  173.             C-1: Getting the source code
  174.             C-2: Tcl no longer compiled with Borland C++
  175.             C-3: Tcl uses long file names
  176.             C-4: Where are the .lib files?
  177.             C-5: Creating Dynamic Extensions on Windows
  178.             C-6: C++ and DLLs
  179.             C-7: Compiling with EGCS/Ming32
  180.             C-8: Allocate memory with Tcl_Alloc
  181.             C-9: Tcl and Microsoft Foundation Classes
  182.  
  183.       Extensions
  184.             E-1: Expect
  185.             E-2: Tix works on Windows.
  186.             E-3: ODBC
  187.             E-4: Network, Registry and ODBC Extensions
  188.             E-5: Itcl
  189.             E-6: BLT Win32 Patches
  190.             E-7: VerTcl/TkCon Provides a Useful Console On Windows
  191.             E-8: OCX Extensions for Tcl
  192.             E-9: TkTable
  193.             E-10: MDI (Muliple Document Interface)
  194.             E-11: Windows shortcuts extension
  195.             E-12: TclX
  196.             E-13: Togl (Tk OpenGL)
  197.             E-14: cc::Mail
  198.             E-15: Tabbed dialogs, Combobox, etc.
  199.             E-16: DLL-Caller Extension
  200.             E-17: WinExec, Print, and Other Extensions
  201.             E-18: Winico Extension
  202.             E-19: Img Extension
  203.             E-19: ActiveTcl Extension
  204.  
  205.       Windows 3.1 Issues
  206.             W3-1: Windows 3.1 Requires Win32s
  207.             W3-2: How to execute tclsh76.exe from Windows 3.1
  208.             W3-3: Strange behaviour of exec under Win 3.1
  209.             W3-4: Windows 3 doesn't support help contents file
  210.             W3-5: Wish generates a UAE error at startup
  211.             W3-6: Increasing environment space in DOS.
  212.  
  213.     ------------------------------------------------------------------
  214.  
  215.  
  216.     How to get Tcl/Tk For Windows
  217.  
  218.     A-1: Binary release of Tcl/Tk for Windows
  219.  
  220.     Tcl/Tk 8.1.1 is available at
  221.     ftp://ftp.scriptics.com/pub/tcl/tcl8_1/tcl811.exe.
  222.  
  223.     This is a self-extracting archive.
  224.  
  225.     A-2: How to Run Scripts from Windows
  226.  
  227.     How do I run a script?
  228.  
  229.     There are three approaches to starting scripts in Tcl: source,
  230.     shortcuts, and file associations.
  231.  
  232.     The most obvious way is to launch the Wish application and use
  233.     "source". This is the best way to debug scripts.
  234.  
  235.     The second alternative is to create a Program Manager icon (Windows
  236.     3.x or NT 3.x) or a shortcut (Windows 95). The binary release uses
  237.     this technique for the widget tour icon. The command line for the
  238.     icon should be something like:
  239.  
  240.           
  241.     c:\tcl\bin\wish81.exe c:\myscript.tcl      
  242.  
  243.     The third way to launch a Tcl script is to create a file type
  244.     association for the extension ".tcl" (or ".tk"). Using the File
  245.     Manager (or My Computer in Windows 95), create a new file type for
  246.     .tcl, and add an "open" action. The command for the action should
  247.     be something like:
  248.  
  249.           
  250.     "c:\Program Files\tcl\bin\wish81.exe" "%1"      
  251.  
  252.     Once you have set up the association, you will be able to double
  253.     click on script files in File Manager to launch the app.
  254.  
  255.     Note that if either the location of wish or the location of the
  256.     script contains spaces in any of the file names, you must enclose
  257.     the name in quotes. For example:
  258.  
  259.           
  260.     "c:\Program Files\tcl\bin\wish81.exe" "c:\Program
  261. Files\myscript.tcl"      
  262.  
  263.     -Scott Stanton
  264.  
  265.     You may also want to add an Edit action for Tcl files. For this,
  266.     you need to pick an editor that won't place extra carriage returns
  267.     on the end of lines. (Windows uses a carriage return/line feed
  268.     combination to end each line of text, while Unix only uses a line
  269.     feed.)
  270.  
  271.     In the Windows 95 Explorer, pick the Options choice from the View
  272.     menu. Under the File Types tab, find your Tcl file type and Edit
  273.     it. Under Actions, click New and name your new Action Edit. Choose
  274.     your editor and accept all your changes.
  275.  
  276.     You should now be able to easily bring up an editor with a
  277.     right-click on the file and the Edit popup option.
  278.  
  279.     -Hume Smith
  280.  
  281.  
  282.     ------------------------------------------------------------------
  283.  
  284.  
  285.     Installing/Can't Run At All
  286.  
  287.     I-1: Don't upgrade over a previous version
  288.  
  289.     It seems there is a bug in the Windows binary installer. If you are
  290.     installing over the top of a prior version of Tcl, it is not
  291.     correctly handling the versioning for the libraries. You will end
  292.     up with a mixture of old and new files. The symptoms vary, but if
  293.     you are seeing problems with the console or other stdio related
  294.     features, the installer could very well be the culprit.
  295.  
  296.     The solution is to completely remove the old/broken installation
  297.     and reinstall from the release file. This should give you a
  298.     consistent set of files.
  299.  
  300.     Thanks to Gerald Lester for helping to identify this problem.
  301.  
  302.     -Scott Stanton
  303.  
  304.     ------------------------------------------------------------------
  305.  
  306.  
  307.     Differences From Unix
  308.  
  309.     D-1: \ Won't Work!
  310.  
  311.     Remember that \ is a special character in Tcl.
  312.  
  313.     This is a problem because Windows uses a backslash for separating
  314.     directories, while Unix uses a forward slash.
  315.  
  316.     So, in Tcl and in the Tcl shell, wish, you need to enter
  317.     directories and paths with either two backslashes, e.g., \\, or
  318.     with the Unix-style forward slash, e.g., /.
  319.  
  320.     For example, don't use:
  321.  
  322.           
  323.     $dir\$filename      
  324.  
  325.     Use either:
  326.  
  327.           
  328.     $dir\\$filename      
  329.  
  330.     or:
  331.  
  332.           
  333.     $dir/$filename      
  334.  
  335.     You can use the file join command to put file and directory names
  336.     together using the native format.
  337.  
  338.     D-2: How to create a valid font name on Windows.
  339.  
  340.     You can either use X Window font names, in X Logical Font
  341.     Description (XLFD) format, or a special Windows-specific format.
  342.     With Tk 8.0 or higher, you should use the font command, which
  343.     allows you to create cross-platform font definitions. This is much
  344.     better than the older methods!
  345.  
  346.     If you are working with versions of Tk prior to 8.0, you need to
  347.     set up XLFD font names or Windows-specific names, discussed below.
  348.  
  349.     1. XLFD format font names
  350.  
  351.     Windows Tk will accept X font names, but you must supply all the
  352.     parts (you can use a * for a wild-card, though, see below). You can
  353.     also use a number of XLFD elements, such as "bold", etc. to control
  354.     the fonts.
  355.  
  356.     For example, the following all are valid font names on Tk in
  357.     Windows:
  358.  
  359.           
  360.     button .b1 -text "Arial" \      
  361.     -font "-*-arial-bold-r-normal--*-*-*-*-*-*"      
  362.     button .b2 -text "Courier" \      
  363.     -font "-*-courier-medium-r-normal--*-*-*-*-*-*"      
  364.     button .b3 -text "Symbol" \      
  365.     -font "-*-Symbol-medium-i-normal--*-240-*-*-*-*"      
  366.     pack .b1 .b2 .b3      
  367.  
  368.     To get the list of valid Windows font names, look in an application
  369.     like Microsoft Word (or WordPad, which comes with Windows 95) and
  370.     check the font list. Most True Type ("TT") fonts should be scalable
  371.     to a number of sizes.
  372.  
  373.     You can find out more in depth information about XLFD naming
  374.     formats at http://www.pconline.com/~erc/xfonts.htm.
  375.  
  376.     -Eric Foster-Johnson
  377.  
  378.     2. Windows-specific font names
  379.  
  380.     In addition to the X style font names, Tk starting with version 4.2
  381.     accepts a special tuple format consisting of a 3 element list of
  382.     the form:
  383.  
  384.           
  385.     {name size stylelist}      
  386.  
  387.     You can use any font name that Windows understands for the first
  388.     element. The size is in points, and the style is a list of zero or
  389.     more items from the set of supported styles: normal, bold, medium,
  390.     heavy, thin, extralight, light, semibold, extrabold, italic,
  391.     oblique, underline, strikeout. Many of these styles won't do
  392.     anything for a given font. For example, to get a 20 point TrueType
  393.     Times Roman font with bold and italic style, you would say "{Times
  394.     Roman New} 20 {bold italic}".
  395.  
  396.     Note that the 3 part font specifier is just a place holder for font
  397.     objects. Eventually we will support font objects that take various
  398.     configuration options and return a handle that can be used anywhere
  399.     a font string is used now.
  400.  
  401.     -Scott Stanton
  402.  
  403.     D-3: Cut, Copy and Paste in the Tcl Console Window
  404.  
  405.     The Tcl Console window sets up bindings that are supposed to follow
  406.     the Windows (and IBM Common User Access, or CUA) standard of
  407.  
  408.       * Ctrl-x: cut
  409.  
  410.       * Ctrl-c: copy
  411.  
  412.       * Ctrl-v: paste
  413.  
  414.     In Tcl 8.0, the Ctrl-V does not work for paste. (The Paste menu
  415.     choice does work, though.) In Tcl 8.1, Ctrl-V works fine.
  416.  
  417.     For older versions of Tcl/Tk, prior to 8.0, the Tcl Console window
  418.     (by default) provides the following bindings:
  419.  
  420.       * Ctrl-x: deletes selected text
  421.  
  422.       * Ctrl-w: cut
  423.  
  424.       * Alt-w: copy
  425.  
  426.       * Ctrl-y: paste
  427.  
  428.     -Eric Foster-Johnson
  429.  
  430.     D-4: Using the Windows Clipboard
  431.  
  432.     Associated with the Cut, Copy and Paste functions, the selection
  433.     functions do work between Windows apps and Tcl/Tk scripts.
  434.  
  435.     To see this, try the following: select some text in Microsoft Word,
  436.     Write or any other Windows app. Copy the data to the clipboard
  437.     (inside the app). Then, enter the following at your wish prompt:
  438.  
  439.           
  440.     set clip [selection get -selection CLIPBOARD ]      
  441.  
  442.     The variable clip should now hold the data from the clipboard.
  443.  
  444.     The parts that may be troublesome are that:
  445.  
  446.       * UNIX apps tend to use an active copy and paste with the PRIMARY
  447.         selection.
  448.  
  449.       * Windows apps tend to use a passive copy and paste, placing the
  450.         data in the clipboard as an intermediary stopping point between
  451.         the applications.
  452.  
  453.       * Motif applications on Unix do use the CLIPBOARD selection.
  454.         Decoding the Motif clipboard is a left as an exercise for the
  455.         reader.
  456.  
  457.       * The X selection mechanism handles a lot more than text, which
  458.         introduces some interesting complexity.
  459.  
  460.     All in all, Tk does pretty good with handling selections on
  461.     multiple operating systems.
  462.  
  463.     -Eric Foster-Johnson
  464.  
  465.     D-5: send is not implemented on Windows
  466.  
  467.     Furthermore, it is unlikely send will be ported soon, because send
  468.     uses the X server for communication. Use the dde command instead.
  469.  
  470.     D-6: Start-up Files tclsh.rc and wishrc.tcl
  471.  
  472.     Tcl looks for ~/tclsh.rc, and wish looks for ~/wishrc.tcl. The
  473.     tclsh.rc name is pretty inconsistent, and should probably be
  474.     tclshrc.tcl. We don't use the .tclshrc form because it doesn't work
  475.     on FAT filesystems. -Scott Stanton
  476.  
  477.     D-7: Accessing PC serial ports from Tcl
  478.  
  479.     Open the serial port using "set comdesc [open COM1: RDWR]", then
  480.     use "read|write|gets|puts $comdesc" to access it. Don't forget to
  481.     close it ("close $comdesc") when you're done.
  482.  
  483.     -Michael Schumacher
  484.  
  485.     D-8: Using UNC file names
  486.  
  487.     If you have machines networked, you can test for file existence
  488.     generally with:
  489.  
  490.           
  491.     file exists //NetworkName/c/      
  492.  
  493.     However, I'm do not believe there is any way in Tcl to tell what
  494.     mapped drives are mapped to.
  495.  
  496.     -Jeffrey Hobbs
  497.  
  498.     D-9: Getting List of Mounted Drives
  499.  
  500.     Starting with Tcl 8.0 you can use the file volume command to return
  501.     a list of mounted volumnes, for example:
  502.  
  503.     file volume
  504.     A:/ C:/ D:/ E:/ G:/ H:/ I:/ Q:/ T:/ V:/ X:/
  505.  
  506.     D-10: Accessing the Windows Registry
  507.  
  508.     Starting with Tcl 8.0 you can use the registry package on Windows
  509.     to access the registry.
  510.  
  511.     This package is only available on Windows.
  512.  
  513.     Note that the registry uses backslashes as separators and that Tcl
  514.     treats a backslash as a special character. For example:
  515.  
  516.     package require registry
  517.     registry keys "HKEY_CLASSES_ROOT\\TclScript\\shell"
  518.     edit open
  519.  
  520.     D-11: Using Dynamic data Exchange (DDE)
  521.  
  522.     See http://www.scriptics.com/man/tcl8.1/TclCmd/dde.htm for more on
  523.     the dde package included in Tcl 8.1.
  524.  
  525.     From a posting by Bill Schongar, at
  526.     http://www.deja.com/=dnc/getdoc.xp?AN=490725194, you can control
  527.     Microsoft Word from the dde command. First. be sure Word is
  528.     running, then try a command like the following to insert text into
  529.     the current document:
  530.  
  531.     package require dde
  532.     
  533.     dde execute -async Winword System {[Insert "Text from Tcl."]}
  534.  
  535.     To quit Word, or close a document, use the following commands as a
  536.     guide:
  537.  
  538.     dde execute Winword System {[FileExit 2]}
  539.     
  540.     dde execute Winword System {[FileClose 2]}
  541.  
  542.     In these examples, 2 = close without saving, 1 = save first, 0 =
  543.     prompt.
  544.  
  545.     For documentation on accessing Word, see the "wrdbasic.hlp" file,
  546.     which you can choose to install when you install Word.
  547.  
  548.     D-12: winfo interps and send fails on Windows
  549.  
  550.     Unfortunately, neither "winfo interp", nor "send" are implemented
  551.     in any of the Tk for Windows releases. Hopefully this will be
  552.     available in the next release.
  553.  
  554.     -Scott Stanton
  555.  
  556.     D-13: Installing Tcl/Tk Applications on Windows
  557.  
  558.     Steve Cassidy is working on a method for installing Tcl/Tk
  559.     applications with libraries and everything else. Here's his
  560.     message:
  561.  
  562.     I've posted here a couple of times saying that I'm working on an
  563.     installation method for tcl/tk apps under windows which bundles the
  564.     tcl/tk binaries and libraries with my own. Well I've just put
  565.     together an example of this which folks might want to look at and
  566.     evaluate.
  567.  
  568.     You can find a self extracting, self installing exe file at:
  569.  
  570.     ftp://srsuna.shlrc.mq.edu.au/pub/cassidy/emuwin-803.exe
  571.  
  572.     This contains the tcl/tk 8.0.3 distribution compiled by myself with
  573.     Borland v5.0 plus my extensions and some of my own standalone
  574.     executables. The self-installer runs a wish script which copies the
  575.     files into the appropriate place (after prompting), adds a program
  576.     group to the start menu (via the dde extension), and puts the
  577.     appropriate things in the registry (for tcl/tk and Emu). It also
  578.     builds an uninstall script which removes everything except the
  579.     start menu items (I can't figure out where they are).
  580.  
  581.     It should be possible to install this package beside an existing
  582.     tcl8.0 installation, I've modified the core to look for a different
  583.     registry key (../scriptics/tcl/emu, rather than
  584.     ../scriptics/tcl/8.0).
  585.  
  586.     ****TAKE CARE!!! I can take no responsibility for your machine, I
  587.     have been as careful as I know how to be but this code has only
  588.     been tested on one NT4 machine so far.******
  589.  
  590.     The application is a speech database system, tcl/tk is used as a
  591.     scripting language and to build gui elements like a labeller which
  592.     can display speech signals and spectrograms etc. If you want to
  593.     actually see how this works you will need some speech data and a
  594.     database template file see http://www.shlrc.mq.edu.au/emu for
  595.     details.
  596.  
  597.     If you do install this, you should be able to run the Emu Labeller
  598.     and get something other than an error message (without a database
  599.     template you can't do anything). You should also be able to run
  600.     wish80 and do any tcl stuff you desire.
  601.  
  602.     I'd be interested in any reports of success, failure or just
  603.     comments on this methodology. If this turns out to be of general
  604.     interest I will document and package up the scripts needed to
  605.     achieve the installation.
  606.     -Steve Cassidy
  607.  
  608.     D-14: Making executable scripts on NT
  609.     You can make a Tcl script into a direct executable following the
  610.     guidelines on the Web at:
  611.     http://www.jessikat.demon.co.uk/docdll.html.
  612.  
  613.     ------------------------------------------------------------------
  614.  
  615.  
  616.     Windows-Specific Bugs and Problems
  617.  
  618.     B-1: Puts bugs
  619.  
  620.     The following Tcl procedure may fail on Windows NT, depending on
  621.     the amount of data written to the file:
  622.  
  623.           
  624.     proc testPuts { fileName output times } {      
  625.     set fileID [ open $fileName w ]      
  626.     for { set i 0 } { $i < $times } { incr i } {      
  627.     puts $fileID $output      
  628.     }      
  629.     close $fileID      
  630.     }      
  631.  
  632.     When it fails, there are only a couple of characters in the output
  633.     file (basically garbage). The Tcl error reports back:
  634.  
  635.           
  636.     error writing "fileX": No error      
  637.  
  638.     For example, if I call:
  639.  
  640.           
  641.     testPuts {C:/TestFile} {HI THERE} 455      
  642.  
  643.     it works perfectly well. However, if I call:
  644.  
  645.           
  646.     testPuts {C:/TestFile} {HI THERE} 456      
  647.  
  648.     it fails.
  649.  
  650.     You can work around this bug by flushing the file descriptor after
  651.     each puts call, like the following:
  652.  
  653.           
  654.     proc testPuts { fileName output times } {      
  655.     set fileID [ open $fileName w ]      
  656.     for { set i 0 } { $i < $times } { incr i } {      
  657.     puts $fileID $output      
  658.     flush $fileID      
  659.     }      
  660.     close $fileID      
  661.     }      
  662.  
  663.     The big question is whether this is a bug in Tcl or Windows NT
  664.     3.51. Has anyone seen this before or have any related information?
  665.     If it is a bug in Windows NT, will Tcl7.5b2 handle this?
  666.  
  667.     -Brian L. Rubow
  668.  
  669.     B-2: fileevent only supports sockets under Windows until 8.1
  670.  
  671.     Fileevents are supported on Win32 platforms for sockets only.
  672.  
  673.     With Tcl8.1, you can now call fileevent on pipes on Windows.
  674.  
  675.     In the expect for NT distribution
  676.     http://bmrc.berkeley.edu/people/chaffee/expectnt.html the fileevent
  677.     problem on windows is solved for tcl8.0p2 too.
  678.  
  679.     -Leo Schubert
  680.  
  681.     B-3: You need at least 256 colors and may have problems with more
  682.     than 256
  683.  
  684.     A number of people have reported that wish simply won't work unless
  685.     you set your screen resolution to have at least 256 colors and
  686.     preferably, 1024x768 pixel resolution.
  687.  
  688.     If you have more than 256 colors, images may not display correctly
  689.     under Tk 4.2.
  690.  
  691.     B-4: Problems with clock command on Windows
  692.  
  693.     Beware of clock format commands across operating systems
  694.  
  695.     Tcl's clock format command eventually passes it's format string to
  696.     strftime(). strftime() may have different implementations depending
  697.     on the underlying operating system.
  698.  
  699.     For example, Windows NT 3.51 doesn't implement the %D, %e, and %h
  700.     directives. This can some interesting side effects.
  701.  
  702.     The bug report: If you do supply one of these unknown directives
  703.     (and nothing else), Tcl can go into a loop. The FormatClock routine
  704.     keeps calling strftime() because it mistakenly assumes that a 0
  705.     return must mean that the target buffer is too small. Indeed, if
  706.     you just pass it "%e", the strftime() function gets annoyed at it
  707.     as a directive and erroneously returns 0. Oddly enough adding a bit
  708.     of whitespace to the format command gets rid of the loop.
  709.  
  710.     This may be an NT oddity only, I don't think you can know for sure
  711.     that it won't happen elsewhere.
  712.  
  713.     -Dave Griffin
  714.  
  715.     B-5: wm iconbitmap doesn't work on Windows
  716.  
  717.     The wm iconbitmap command does not work on Windows. if you execute
  718.     the following command, you'll still see Tcl's icon for your
  719.     application:
  720.  
  721.           
  722.     wm iconbitmap . filename      
  723.  
  724.     To change this, you need to substitute your own .ico file and
  725.     recompile the relevant parts of the Tk source code.
  726.  
  727.     -Eric Foster-Johnson
  728.  
  729.     B-6: If you use a pipe (|) in open, until the child process has
  730.     terminated no events will be processed
  731.  
  732.     If you start a process in a pipe, e.g., 'open "| ...."' until the
  733.     child process has terminated no events will be processed.
  734.  
  735.     -John Robert LoVerso
  736.  
  737.     B-7: The rightmost mouse button is Button-3
  738.  
  739.     Even with a two-button mouse, the rigthmost mouse button is
  740.     identified in Tk as Button-3.
  741.  
  742.     This really isn't bad, especially if you coded your pop-up menus to
  743.     appear on Button-3 events, following the style of most Motif
  744.     programs. Your scripts will continue to work on Windows.
  745.  
  746.     -Eric Foster-Johnson
  747.  
  748.     B-8: Tk on Windows supports cursors
  749.  
  750.     The -cursor option should work on Windows now with all the built-in
  751.     X Window cursors.
  752.  
  753.     B-9: Sockets are not available on the system error
  754.  
  755.     If you get an error like the above, chances are you have not
  756.     installed the winsock.dll dynamic-link library that adds networking
  757.     socket functionality to Windows.
  758.  
  759.     B-10: toplevel -container does not work
  760.  
  761.     The -container option is not fully implemented on Windows at
  762.     present. The only functionally complete implementation is on X
  763.     Windows.
  764.  
  765.     You can use the '-use' option as long as the supplied window ID
  766.     identifies a window that is not managed by Tk. This is known to
  767.     work on both Unix and Windows. The Mac implementation is not, as
  768.     far as I know, able to handle this in the general case; we did
  769.     something special (a hack :) for the Tcl plugin on the Mac.
  770.  
  771.     I cannot say when things will get better on this front. It's on our
  772.     todo list and will percolate upwards according to demand etc etc..
  773.  
  774.     -Jacob Levy
  775.  
  776.     B-11: exec: couldn't create error file for command: Error 0
  777.  
  778.     If exec returns an error message of "couldn't create error file for
  779.     command: Error 0", the following may help:
  780.  
  781.     This problem exists under Unix and Windows NT. I have conclusive
  782.     proof that under Unix it was being caused by the temporary
  783.     directory not being world writable, which explains why superusers
  784.     were able to "exec" something but not a regular user. The "gotcha!"
  785.     is that /tmp is not necessarily the temporary directory that is
  786.     used, so people were not seeing an obvious problem. Tcl uses the
  787.     tmpnam() system call, which on many systems actually uses /var/tmp,
  788.     and on some systems that directory was not world writable. I would
  789.     like to call this a problem with one's site administration.
  790.  
  791.     Here's a simple program to determine your temporary directory:
  792.  
  793.           
  794.     main()      
  795.     {      
  796.     char name[100];      
  797.     tmpnam(name);      
  798.     puts(name);      
  799.     }      
  800.  
  801.     which prints out the full pathname for a potential new temporary
  802.     file. If the specified directory is not world writable, you can't
  803.     create temp files.
  804.  
  805.     Now, the question turns to Windows. This I have not yet resolved.
  806.     Under NT, which has users and directory permissions, it may be the
  807.     same problem as under Unix. However, since this problem is also
  808.     occurring under Windows 3.1 it may be another problem or
  809.     combination of the two. I will post results as soon as possible.
  810.  
  811.     -Colin Stevens
  812.  
  813.     ------------------------------------------------------------------
  814.  
  815.  
  816.     Old Bugs
  817.  
  818.     O-1: Wish uses a lot of system resources and doesn't free them.
  819.  
  820.     Wish does not release the system resources it uses even when it
  821.     exits normally. Run through the widget demo, exit and look at the
  822.     system resources count. You may find it dropped by 17%. During the
  823.     widget demo, monitoring system resources found that wish does not
  824.     seem to release system resources when it destroys widgets. During a
  825.     wish session free resources just keep declining. Given this
  826.     situation, large wish applications may slow down or crash.
  827.  
  828.     -Charles A. Shartsis
  829.  
  830.     O-2: Once exec fails, the next exec generates a fatal error.
  831.  
  832.     Tcl7.5a1/Tk4.1a1 bugs with exec on Windows.
  833.  
  834.     Once an exec command fails the next exec command results in a fatal
  835.     error (when typing exec commands into the Console window). For
  836.     example:
  837.  
  838.           
  839.     tcl> exec xyzzy      
  840.     Couldn't read output file "TMP37.$$$" for command: no such file or
  841. directory      
  842.     tcl> exec dir      
  843.  
  844.     and you will get a popup window about the fatal error...
  845.  
  846.     Other exec bugs on Windows:
  847.  
  848.     I'm using the recent b2 release with Windows 95 with tclsh75.
  849.  
  850.     Exec is not redirecting output properly. There seems to be a race
  851.     condition.
  852.  
  853.     When I try 'exec co -p foo.c > bar.c', co should write to stdout
  854.     and tclsh75 should redirect the output to a new file.
  855.  
  856.     Instead, co -p writes to stdout and it appears on the console
  857.     window. If I attempt to grab the output by doing:
  858.  
  859.           
  860.     set result [exec co -p foo.c > bar.c ]      
  861.  
  862.     result is set to "" after the command, even though co writes out
  863.     the file to stdout.
  864.  
  865.     Now it gets interesting: If I trace through Win32Pipeline() and
  866.     stop at the CreateProcess() call, and then step through it closing
  867.     the files, the whole thing works the way it should - that is, co
  868.     writes to stdout, which goes into a file. If after it stops at
  869.     CreateProcess() I hit the continue, everything breaks again. So it
  870.     seems that tclsh needs to create the rpocess and close down the
  871.     files before letting the child run. Very odd.
  872.  
  873.     -Josh Putnam
  874.  
  875.     - When you exec a command the screen blanks out (system -> DOS?)
  876.     and then redraws as the command ends. Can this be stopped?
  877.  
  878.     - There is a resource leak somewhere in the exec command. If you do
  879.     "exec dir" several times you will find that the Free Memory and
  880.     Free System Resources (as in Program manager/Help/About) decrease
  881.     each time.
  882.  
  883.     -Gordon Lack
  884.  
  885.     Calling exec brings on blank-screen mode
  886.  
  887.     In article <9603091208.AA08832@diana1.paisley.ac.uk>, Shicheng Tian
  888.     <tian_ci0@paisley.ac.uk> wrote:
  889.  
  890.     On my PC, from Windows, I run a tcl script file with the following
  891.     one line code:
  892.  
  893.     exec del "c:/rubish.tcl"
  894.  
  895.     The file 'rubish.tcl' DOES get deleted, but the trouble is:
  896.  
  897.     the PC goes back to the DOS environment (i.e. a black screen!),
  898.     then it comes back to Windows again.
  899.  
  900.     My enquiry is: is it possible to run the 'exec' command shown as
  901.     above WITHOUT showing the DOS black screen?
  902.  
  903.     You can change this behavior by modifying the .PIF file for MS-DOS
  904.     so that it does not use full-screen mode.
  905.  
  906.     -Scott Stanton
  907.  
  908.     Another way to call exec
  909.  
  910.     It wasn't obvious to me either how to get native DOS window
  911.     commands to work and it sometimes hung on me as well. I recently
  912.     got it working, however...
  913.  
  914.           
  915.     exec cmd.exe >&@stdout <@stdin /c dir      
  916.  
  917.     will do the directory command for the current directory. Check out
  918.     the Windows help for the switches available under cmd.exe. "/c"
  919.     tells it to execute the command and then exit. "/k" tells it to
  920.     execute the command and keep the DOS command interpreter active.
  921.     (Note that cmd.exe is the name of the MS-DOS interpreter on Windows
  922.     NT.)
  923.  
  924.     -Robert Philpott
  925.  
  926.     Only Call exec on 32-bit Applications
  927.  
  928.     Tcl 7.6 and Tk 4.2 seem to have solved the following problem.
  929.     (Thanks to Colin Stevens.)
  930.  
  931.     Tcl/TK for Win32 is really rotten at doing an exec on DOS mode
  932.     programs. This includes any of the DOS-like commands of the Win95
  933.     shell! If you use exec with any of the DOS mode commands, the
  934.     command might execute but control will never be returned to the
  935.     WISH shell.
  936.  
  937.     However, 32 bit programs work just fine with WISH. To see what I
  938.     mean, try the following command from the WISH console:
  939.  
  940.     exec notepad
  941.  
  942.     This command will run the Windows notepad editor and return control
  943.     to WISH after the notepad program is exited. If you want to run
  944.     notepad and return control immediately to WISH just use:
  945.  
  946.     exec notepad &
  947.  
  948.     This behavior is identical to the UNIX versions of Tcl/TK.
  949.  
  950.     So, the moral of the story is:
  951.  
  952.     Only "exec" 32 bit programs with the Win32 version of Tcl/TK.
  953.  
  954.     -Dennis R. LaBelle
  955.  
  956.     ------------------------------------------------------------------
  957.  
  958.  
  959.     Compiling and Writing C and C++ Extensions
  960.  
  961.     C-1: Getting the source code
  962.  
  963.     The Tcl releases officially support UNIX, Windows and Macintosh
  964.     platforms. The source code comes with a win/ directory with Windows
  965.     code. You can get the source code release on the Internet via FTP
  966.     from ftp.scriptics.com, in the directory /pub/tcl.
  967.  
  968.     For Windows users, you'll likely want the source code compressed in
  969.     ZIP format, rather than GNU gzip. Pick up the files ending in .zip.
  970.  
  971.     The source code was compiled with Microsoft Visual C++ 5.0. For
  972.     more on compiling the sources, see
  973.     http://www.scriptics.com/support/howto/compile.html.
  974.  
  975.     With MS VC++ 5.0, the default installation places the compiler in
  976.     \Program Files\DevStudio\VC. Because of the space in the name
  977.     Program Files the -I (include file) option in the makefiles may
  978.     fail because spaces are used to separate command-line parameters.
  979.  
  980.     You can use the short (DOS) directory name in place of the Program
  981.     Files, e.g. -Ic:\progra~1\devstudio\vc\include in place of
  982.     c:\Program Files\DevStudio\VC\include. You can also place the
  983.     commands in the makefile.vc files in quotes, e.g.:
  984.  
  985.           
  986.     cc32           = "$(TOOLS32)\bin\cl.exe"      
  987.     link32         = "$(TOOLS32)\bin\link.exe"      
  988.     rc32           = "$(IDE32)\bin\rc.exe"      
  989.     include32      = -I"$(TOOLS32)\include"      
  990.  
  991.     -Eric Foster-Johnson
  992.  
  993.     C-2: Tcl no longer compiled with Borland C++
  994.  
  995.     Until about Tcl 8.0.3, Tcl was compiled with Borland's C++
  996.     compiler. With 8.0.3 and beyond, the Scriptics team switched to
  997.     Microsoft's C++ compiler, Visual C++.
  998.  
  999.     Michael I Schwartz has a good note at
  1000.     http://www.egroups.com/list/wintcl/316.html on how to continue
  1001.     using Borland's C++ compiler with DLLs compiled by Microsoft's
  1002.     compiler.
  1003.  
  1004.     -Eric Foster-Johnson
  1005.  
  1006.     C-3: Tcl uses long file names
  1007.  
  1008.     Both Tcl and Tk use long file names. You'll need Windows 95 or
  1009.     Windows NT (with an NTFS file system) for the sources.
  1010.  
  1011.     You may also need a modern ZIP program to extract the archive and
  1012.     maintain its long file names. Older versions of pkzip, for example,
  1013.     only understand the old DOS eight character (with up to three
  1014.     characters for an extension) file names. I use WinZip, a shareware
  1015.     archiver program for Windows.
  1016.  
  1017.     -Eric Foster-Johnson
  1018.  
  1019.     C-4: Where are the .lib files?
  1020.  
  1021.     When you install Tcl, you can specify that you want the library
  1022.     files installed. If you do so, you'll see the libraries in the lib
  1023.     subdirectory wherever you installed Tcl. For example, C:\Program
  1024.     Files\Tcl\lib.
  1025.  
  1026.     C-5: Creating Dynamic Extensions on Windows
  1027.  
  1028.     See http://www.scriptics.com/support/howto/winext.html for more on
  1029.     building extensions for Windows.
  1030.  
  1031.     C-6: C++ and DLLs
  1032.  
  1033.     If you write your Tcl extensions in C++, you'll likely need to use
  1034.     the extern "C" { }; statement in C++ to use your functions in Tcl.
  1035.     This is due to the user of "name mangling" in most C++ compilers.
  1036.  
  1037.     -Eric Foster-Johnson
  1038.  
  1039.     This especially true for your exported Init routine for the
  1040.     extension.
  1041.  
  1042.     #ifdef __cplusplus
  1043.     extern "C"
  1044.     #endif
  1045.     EXTERN int Foo_Init (Tcl_Interp *interp) {
  1046.       ...
  1047.       return TCL_OK;
  1048.     };
  1049.  
  1050.     Where "Foo" is the DLL's name. If your extension is called
  1051.     calcBIG.dll, use "Calcbig_Init" for the function's name. Notice
  1052.     that the first letter is always capitalized and all following
  1053.     characters are lower case.
  1054.  
  1055.     -David Gravereaux
  1056.  
  1057.     C-7: Compiling with EGCS/Ming32
  1058.  
  1059.     To get Tcl/Tk to compile on Win32 systems with the EGCS compiler,
  1060.     you need patches available at
  1061.     http://www.xraylith.wisc.edu/~khan/software/tcl/.
  1062.  
  1063.     See http://www.xraylith.wisc.edu/~khan/software/gnu-win32/ for more
  1064.     on Ming32, EGCS, and other free compilers for Win32 systems.
  1065.  
  1066.     C-8: Allocate memory with Tcl_Alloc
  1067.  
  1068.     If you allocate memory from within a C or C++ program and pass that
  1069.     memory on the the Tcl DLLs, you must allocate that memory with
  1070.     Tcl_Alloc().
  1071.  
  1072.     If you allocate memory via some other means, pass that memory to
  1073.     Tcl and later get a crash, you were warned.
  1074.  
  1075.     C-9: Tcl and Microsoft Foundation Classes
  1076.  
  1077.     CTkView is a C++ class which can be used in MFC SDI or MDI
  1078.     applications. An instance of CTkView hosts an embedded Tk toplevel
  1079.     widget and performs some management chores for the widget so that
  1080.     it can size, update and react correctly to Windows events.
  1081.  
  1082.     -David Shepherd
  1083.  
  1084.     For more information, see
  1085.     http://home.t-online.de/home/dshepherd/tkview.htm.
  1086.  
  1087.     ------------------------------------------------------------------
  1088.  
  1089.  
  1090.     Extensions
  1091.  
  1092.     E-1: Expect
  1093.  
  1094.     Expect works on Windows NT. You can get it from:
  1095.  
  1096.     http://bmrc.berkeley.edu/people/chaffee/expectnt.html
  1097.  
  1098.     E-2: Tix works on Windows
  1099.  
  1100.     The Tix extension has been ported to windows.
  1101.  
  1102.     E-3: ODBC
  1103.  
  1104.     OdbcTcl 0.2 for Win32 provides a Tcl extension to call ODBC 2.0
  1105.     functions from Tcl.
  1106.  
  1107.     You can get it from ftp.neosoft.com in
  1108.     /pub/tcl/sorted/databases/odbctcl-0.2.
  1109.  
  1110.     A common problem appears regarding the DSN value. A cample connect
  1111.     command is:
  1112.  
  1113.     odbc_connect sql "DSN=mydb;UID=foo;PWD=bar"
  1114.  
  1115.     -Jose L Porcayo
  1116.  
  1117.     An ODBC extension to Tcl is available at
  1118.     http://www.megalos.fi/~rnurmi/tclodbc.html
  1119.  
  1120.     E-4: Network, Registry and ODBC Extensions
  1121.  
  1122.     NT, ODBC, network, and registry extensions available for the
  1123.     Windows version of TCL (7.6) are available at:
  1124.     ftp://ftp.maxwell.syr.edu/pub/tcl/tcl76/ntext-prelim.zip
  1125.  
  1126.     -Christopher M Sedore (cmsedore@maxwell.syr.edu)
  1127.  
  1128.     E-5: Itcl
  1129.  
  1130.     Itcl 2.2 and higher works on Windows.
  1131.  
  1132.     E-6: BLT Win32 Patches
  1133.  
  1134.     Patches for the BLT 2.1 extension for Win32 are available from:
  1135.  
  1136.     http://www.jessikat.demon.co.uk/bltpatches.html
  1137.  
  1138.     Status: Tiled widgets problematic, bgexec/busy not working,
  1139.     drag&drop ok with dde.
  1140.  
  1141.     In addition, you can get a Tcl Win32 Mem Debug patch, to allow for
  1142.     debugging output on memory allocations to get sent to the console.
  1143.     This is available from:
  1144.  
  1145.     http://www.jessikat.demon.co.uk/tclWA.html
  1146.  
  1147.     E-7: VerTcl/TkCon Provides a Useful Console On Windows
  1148.  
  1149.     VerTcl (also called TkCon) provides an enhanced console window that
  1150.     proves very useful on systems that don't provide built-in consoles,
  1151.     such as Windows and MacOS.
  1152.  
  1153.     You can get more information on VerTcl/TkCon, and the code, too,
  1154.     from http://www.purl.org/net/hobbs/tcl/script/tkcon/.
  1155.  
  1156.     E-8: OCX Extensions for Tcl
  1157.  
  1158.     There are a number of OCX extensions for Tcl, including:
  1159.  
  1160.       http://home.earthlink.net/~affriedl/TclOCX/index.html
  1161.             AxTcl (formerly TclOCX) is an ActiveX DLL extension. This
  1162.             enables Tcl to dynamically load command extensions from
  1163.             ActiveX DLL's.
  1164.  
  1165.       http://www.cs.cornell.edu/Info/Projects/zeno/tocx/index.html
  1166.             An ActiveX extension for Tcl. This extension allows you to
  1167.             use existing OCX or ActiveX controls in a widget-like way.
  1168.  
  1169.       TclControl
  1170.             An experimental ActiveX control.
  1171.  
  1172.     E-9: TkTable
  1173.  
  1174.     tkTable 2.3, an editable 2D table/matrix widget. Supports Unix
  1175.     Tcl/Tk variants and Windows, requires Tcl/Tk 8+.
  1176.  
  1177.     http://www.purl.org/net/hobbs/tcl/capp/
  1178.  
  1179.     E-10: MDI (Muliple Document Interface)
  1180.  
  1181.     There is a very nice Tcl-only package called mdw-lib (Multi
  1182.     Document Windows) written by Thomas Schwarze
  1183.     (mailto:swz@rtws18.ee.tu-berlin.de) that does that kinda stuff. You
  1184.     can find it at:
  1185.  
  1186.    
  1187. ftp://ftp.neosoft.com/languages/tcl/alcatel/potpourri/mdw_lib-1.0.tgz
  1188.  
  1189.     ftp://ftp.neosoft.com/languages/tcl/alcatel/potpourri/mdw_lib.lsm.Z
  1190.  
  1191.     -Frederic Bonnet
  1192.  
  1193.     E-11: Windows shortcuts extension
  1194.  
  1195.     This is an early release of a shortcut manipulation extension for
  1196.     tcl 7.6/tk 4.2. It allows you to create, modify, and get
  1197.     information from a NT 4.0 or Windows 95 shortcut.
  1198.  
  1199.     Docs are available at
  1200.     http://zazu.maxwell.syr.edu/nt-tcl/shortcut.htm
  1201.  
  1202.     Download from: ftp://ftp.maxwell.syr.edu/tcl/tcl76/shortcut.dll.
  1203.  
  1204.     -Chris Sedore
  1205.  
  1206.     E-12: TclX
  1207.  
  1208.     Extended Tcl is a set of Tcl extensions and a shell that are
  1209.     oriented towards Unix system programming tasks and large
  1210.     application development. TclX 7.6.0 is compatible with Tcl7.6 and
  1211.     Tk 4.2 releases.
  1212.  
  1213.     This release includes incomplete support for Windows 95/NT as well
  1214.     as a binary release for Windows 95/NT.
  1215.  
  1216.     Full source for Unix and Windows:
  1217.  
  1218.     ftp://ftp.neosoft.com/pub/tcl/tclx-distrib/tclX7.6.0.tar.gz
  1219.  
  1220.     Windows 95/NT binary release, tar and gzip format:
  1221.  
  1222.     ftp://ftp.neosoft.com/pub/tcl/incoming/tclXwin7.6.0.tar.gz
  1223.  
  1224.     Windows 95/NT binary release, zip format:
  1225.  
  1226.     ftp://ftp.neosoft.com/pub/tcl/incoming/tclXwin7.6.0.zip
  1227.  
  1228.     If you have any questions or problem, please remember to contact
  1229.     tcl-project@NeoSoft.com directly.
  1230.  
  1231.     E-13: Togl (Tk OpenGL)
  1232.  
  1233.     See http://www.informatik.uni-rostock.de/~rschultz/togl.html for
  1234.     information on Togl for NT,
  1235.     http://www.cs.umd.edu/~bederson/Togl.html for more on Togl.
  1236.  
  1237.     E-14: cc:Mail
  1238.  
  1239.     Electric Memo Ltd. has a shareware Tcl add-on called Xccm that
  1240.     allows access to cc:Mail via the VIM32 dlls.
  1241.  
  1242.     E-15: Tabbed dialogs, Combobox, etc.
  1243.  
  1244.     While this isn't an extension, Jeff Hobbs provides a number of
  1245.     widgets written in Tcl, including a tabbed dialog and combobox.
  1246.  
  1247.     E-16: DLL-Caller Extension
  1248.  
  1249.     Robin Becker's dll package, at
  1250.     http://www.jessikat.demon.co.uk/docdll.html, allows your Tcl
  1251.     scripts to call functions in Win32 DLLs (Dynamic Link Libraries).
  1252.  
  1253.     E-17: WinExec, Print, and Other Extensions
  1254.  
  1255.     Michael Schwartz offers a number of Windows extensions that include
  1256.     winexec to launch 16-bit Windows applications and print, which, as
  1257.     you'd expect, allows you to print from Tcl scripts.
  1258.  
  1259.     E-18: Winico Extension
  1260.  
  1261.     The Winico extension introduces one new command called "winico" to
  1262.     load .ico files from the harddisk or icon resources from the system
  1263.     and to set the taskbar-icon (when hitting Alt-Tab) and the icon in
  1264.     the caption of a Tk-toplevel. It can also display icons in the
  1265.     taskbar status area. Winico is available at
  1266.     http://ftp.bj-ig.de/pub/tcltk/. Send bug reports to leo@bj-id.de
  1267.  
  1268.     -Leo Schubert
  1269.  
  1270.     E-19: Img Image Extension
  1271.  
  1272.     The Img extension adds support for more image types to Tcl/Tk.
  1273.     available for Windows and UNIX from:
  1274.  
  1275.     http://home.wxs.nl/~nijtmans/img.html
  1276.  
  1277.     E-20: ActiveTcl BGI Tcl Windows Extension
  1278.  
  1279.     A new version of ActiveTcl (a ActiveX wrapper for tcl8) is
  1280.     available free of charge (for non-commercial use) from BGI
  1281.     www.bgi-sa.com).
  1282.  
  1283.     Two tcl loadable DLLs are also provided :
  1284.  
  1285.       *  tclwin is an interface for win32 to creates MDI interface and
  1286.         non-modal dialog boxes.
  1287.  
  1288.       *  Two sample scripts demonstrate the use of tclwin and tclodbc :
  1289.  
  1290.       *  Tclwined.tcl is a stand-alone dialog box editor and tcl
  1291.         generator.
  1292.  
  1293.       *  Odbcwiz is a general purpose ODBC query tool.
  1294.  
  1295.     Everything can work stand-alone or combined. A help file is
  1296.     provided in the package.
  1297.  
  1298.     Works with : tcl8 for win32 (NT,95,98).
  1299.  
  1300.     - N. Frankinet
  1301.  
  1302.     ------------------------------------------------------------------
  1303.  
  1304.  
  1305.     Windows 3.1 Issues
  1306.  
  1307.     W-1: Windows 3.1
  1308.  
  1309.     If you run Windows 3.1, you will need to install the Win32s
  1310.     subsystem. You may have already done that. Check that you have the
  1311.     Win32s DLL (dynamic-link library) at version 1.30. If not, you can
  1312.     get a self-extracting archive, w32s130.exe, from:
  1313.  
  1314.     ftp://ftp.scriptics.com/pub/tcl/misc/w32s130.exe
  1315.  
  1316.     Extract this file in an empty directory.
  1317.  
  1318.     If you use Windows NT or 95, you won't need the Win32s subsystem.
  1319.  
  1320.       Note: If you're using an older version of Win32s, you must
  1321.       upgrade to version 1.30.
  1322.  
  1323.       Note: Tcl/Tk support for Windows 3.1 is gone with Tcl 8.0.3. To
  1324.       run under Windows 3.1, you need to use an older version of
  1325.       Tcl/Tk, such as 7.6p2 or 8.0p2. You really need to upgrade to a
  1326.       newer version of Windows.
  1327.  
  1328.     -Eric Foster-Johnson
  1329.  
  1330.     W3-2: How to execute tclsh76.exe from Windows 3.1
  1331.  
  1332.     You can run tclsh76.exe under Windows 3.1, but not from a DOS
  1333.     shell. You can invoke tclsh76.exe by making a program manager icon
  1334.     for the command line that you want to execute. Since tclsh76.exe is
  1335.     not a DOS application, you can not invoke it from the shell.
  1336.  
  1337.     -Scott Stanton
  1338.  
  1339.     W3-3: Strange behaviour of exec under Win 3.1
  1340.  
  1341.     Unfortunately the support for exec under Win32s is very limited.
  1342.     Most of this is because of Win32s. There are definitely some
  1343.     improvements that could be made (e.g. letting you start Windows
  1344.     apps), but it is never going to be as good as the Windows 95 or NT
  1345.     versions. Basically Windows 3.1 doesn't have a very complete
  1346.     process model, and most of what you see in the DOS window is done
  1347.     using non-Windows APIs. I could probably get Tcl to do the same
  1348.     things, but it's going to require a lot of very Windows 3.1
  1349.     specific coding to get it to work. There are a number of other
  1350.     things that are higher priority, so it probably won't happen for a
  1351.     while. I would encourage anyone who really wants this feature to
  1352.     work on it and send me patches.
  1353.  
  1354.     -Scott Stanton
  1355.  
  1356.     W3-4: Windows 3 doesn't support help contents file
  1357.  
  1358.     The problem is that Win3.1/3.11 don't support the contents file. I
  1359.     think what is needed is an additional help page that lists the
  1360.     contents. This is redundant under Windows 95 and NT, but necessary
  1361.     for 3.1/3.11.
  1362.  
  1363.     For now, however, you should be able to use the keyword search
  1364.     facility to get to any of the man pages.
  1365.  
  1366.     -Scott Stanton
  1367.  
  1368.     W3-5: Wish generates a UAE error (Unhandled Win32s Exception) at
  1369.     startup.
  1370.  
  1371.     If you get a UAE error when starting wish on Windows 3.1 (this
  1372.     problem does not appear on Windows NT), here's what you can do.
  1373.  
  1374.     1. Add the following lines to your autoexec.bat file:
  1375.  
  1376.           
  1377.     set tcl_library=/tcl/lib/tcl8.0      
  1378.     set tk_library=/tcl/lib/tk8.0      
  1379.  
  1380.     Note that these paths refer to the standard installation of wish,
  1381.     e.g., C:\tcl. If you installed in a non-standard location, you'll
  1382.     need to modify this. Also note the forward (/), not backward (\)
  1383.     slashes for directory separators.
  1384.  
  1385.     2. You can also type in the values at a shell (i.e., DOS) command
  1386.     line, but wish is a Windows program, so this must be placed into
  1387.     the environment for Windows. When I typed these commands in at the
  1388.     DOS level, I received an error that I had run out of environment
  1389.     space. This may also be a problem for you. DOS 5 only allows a
  1390.     small amount of space for environment variables. If this is the
  1391.     case, you'll need to remove other environment settings (I pared
  1392.     down my PATH, which came from the manufacturer with extraneous
  1393.     options).
  1394.  
  1395.     3. You must reboot, since the autoexec.bat is only read at
  1396.     start-up.
  1397.  
  1398.     -Eric Foster-Johnson
  1399.  
  1400.     W3-6: Increasing environment space in DOS.
  1401.  
  1402.     If you type in the tcl_library and tk_library environment variables
  1403.     and get an out of space error, you can increase the amount of
  1404.     memory allocated to the DOS environment through the COMMAND.COM
  1405.     command line options. For example, add the following line to your
  1406.     CONFIG.SYS file:
  1407.  
  1408.           
  1409.     shell=c:\command.com /e:1024 /p      
  1410.  
  1411.     This sets the environment space to 1K. Note that (on my system, at
  1412.     least) the /c autoexec command is needed to make DOS run the
  1413.     autoexec.bat file during booting.
  1414.  
  1415.     -Alex Hubbard
  1416.  
  1417.     ------------------------------------------------------------------
  1418.  
  1419.     Thanks To:
  1420.     Frederic Bonnet
  1421.     John Buckman
  1422.     Steve Cassidy
  1423.     Gordon Chaffee
  1424.     Joe English
  1425.     N. Frankinet
  1426.     David Gravereaux
  1427.     Dave Griffin
  1428.     Jon Herlocker
  1429.     Alex Hubbard
  1430.     Dennis R. LaBelle
  1431.     Gordon Lack
  1432.     Ioi Lam
  1433.     Jacob Levy
  1434.     Don Libes
  1435.     John Robert LoVerso
  1436.     Cristian Mata
  1437.     Ola Noss
  1438.     Robert Philpott
  1439.     Jose L Porcayo
  1440.     Josh Putnam
  1441.     Brian L. Rubow
  1442.     Bill Schongar
  1443.     Leo Schubert
  1444.     Michael Schwartz
  1445.     Christopher M Sedore
  1446.     Charles A. Shartsis
  1447.     David Shepherd
  1448.     Hume Smith
  1449.     Scott Stanton
  1450.     Colin Stevens
  1451.     Larry Virden
  1452.     John Waterson
  1453.  
  1454.     Compiled by Eric Foster-Johnson, author of Graphical Applications
  1455.     with Tcl and Tk. Please send updates to erc@pconline.com.
  1456.  
  1457.     DISCLAIMER. This article is provided as is without any express or
  1458.     implied warranties. While every effort has been taken to ensure the
  1459.     accuracy of the information contained in this article, the
  1460.     maintainer assumes no responsibility for errors or omissions, or
  1461.     for damages resulting from the use of the information contained
  1462.     herein.
  1463.  
  1464.  
  1465. -- 
  1466. Eric Foster-Johnson
  1467. email: erc@pconline.com
  1468. Web:   http://www.pconline.com/~erc/
  1469.