Purpose: to cover the use of Tcl under the variations of [Microsoft Windows] that continues to grow at an alarming rate. Why is the growth in use of Tcl on these platforms alarming? ''A more likely interpretation of that sentence is that it is the growth of variations of [Microsoft Windows] that is alarming.'' ---- [Iain B. Findleton] ( Jan 2002 ) wrote an article on comp.lang.tcl about his experiences with Tcl on Windows. Read more at [http://groups.google.com/groups?as_q=&num=100&as_scoring=d&btnG=Google+Search&as_epq=&as_oq=&as_eq=&as_ugroup=&as_usubject=&as_uauthors=&as_umsgid=3C540DCE.F4A6FF2A@videotron.ca&lr=&as_drrb=q&as_qdr=&as_mind=12&as_minm=5&as_miny=1981&as_maxd=29&as_maxm=1&as_maxy=2002] ---- See also: http://markhobley.yi.org:8000/TclWin - Using Tcl under Microsoft Windows http://markhobley.yi.org:8000/TclCrossPlat- Cross Platform Development using Tcl [How to compile Tcl and related C extensions on Windows]. ---- See the latest FAQ [http://www.pconline.com/~erc/tclwin.htm] for information being maintained by the comp.lang.tcl Windows and Tcl FAQ maintainer. Note that this version is different than the one posted to comp.lang.tcl - there has been some problems trying to get the autoposting software version updated :-( ... See [Microsoft Windows and Tk] for information about the graphical extension and Windows. Also, the [Tcl Developer Xchange] hosts a surprisingly (well, it surprises [CL]) active Web forum on Win* issues [http://resource.tcl.tk/bboard/q-and-a.tcl?topic_id=31&topic=wintcl%20%2d%20Windows%20issues%20and%20extensions] Other info will be added as people encounter it. For instance, Tcl runs on Windows 95/98/Windows NT, Windows 2000, and soon [Windows/CE]. ---- A frequent problem in DOS/Windows vs. C/Tcl is the use of backslashes as path separators. Tcl parses c:\test to have a Tab (\t) as third character, with "est" following that. Since strings may get parsed several times, the safest is to use slashes internally. You can get that canonical form from a backslashed pathname with set canonicalpathname [file join $backslashedpathname] Going back to backslashes may be necessary for [exec]: set backslashedpathname [file nativename $canonicalpathname];#RS ---- How can one tell whether a given application is already running under Windows (e.g. is 'internet explorer' already running?), if it is running, how can one simply switch to it (without opening a new browser window or anything)? ---- On Windows I have a third party application (the dvi previewer Yap.exe) which can tell another application to go to a particular file and source line. Unfortunately it can't use dde (at least not directly) but can only execute a command line, so it wants to do something like this (it lets you design the command line): app.exe open %f -line %l where '%f' will be substitued by the file, and %l by the line. Now, I have a Tcl/Tk application already running, which wants that information. How can I get it to my application in the easiest way?? [RS] In [Inventory of IPC methods], I have sketched a proc '''fsignal''' which uses a file in a well-known directory. You could write a little script that calls fsignal send Open [list $filename $lineno] and your "receiving app" could, when idle, call foreach {filename lineno} [fsignal wait Open] break ---- A recent question and answer from comp.lang.tcl asks: ''What options are available for printing from a TCL (not TK) script running under Windows (NT/9x/2000)?'' (See also [Printing a canvas under Windows].) One way is to just open and write directly to a device like LPT1. set pr [open lpt1 w] If the printer isn't attached to the local PC, you will need to capture the device to the network queue. One way to do this is with a command-line like: net use lpt1 \\server\printer /persistent:yes ---- A topic that's sure to come up more and more often is "[What WinForms has to do with Tcl]". ---- A frequent, sometimes implicit, topic is "[How Tcl accesses the Win32 API]". Also important for getting the right Windows feel is to "[Register file types under Windows]". ---- See also: * [windows icons] * [Windows binary resources] * [Reading version information from Win32 executables] * [Building Tcl DLL's for Windows] * [Combining GUI applications developed with Tk and 'native' Windows toolkits] * [Consio] library for accessing Windows console functions * [Embedding Windows applications in Tk frames] * [Expect for Windows] * [Generating PDF on Windows] * [How to ensure my Windows or MacOS Tk process has a console] * [Integrating Tcl and Emacs on Windows] * [Parallel port] control on Win9x/NT/2k/XP, see also [LED display driven by the parallel port under tcl control] * [Playing with Windows file associations] * [Reading Portable Executable headers] * [Reading version information from Win32 executables] * [Robust environment variables on Windows] * [SDX under Windows] * [serial ports on Windows] * [Services under Microsoft Windows NT], * [Symbolic links in Windows/CE] * [Techniques for 'driving' Windows applications] * [Tk widgets look fine under Windows] * [TWAPI] - Tcl Windows API extension * [Using Kill on Windows 98] * [Using Windows Controls in Tk Windows] * [What WinForms has to do with Tcl] * [win32] * [winapi] - Another Windows API extension at a lower level * [wince] * [winChooseDirectory] * [Windows file finder] * [Windows Helper Utilities] * [Windows Registry Browser] * [Windows shell links] * [Windows Speed Cleaning] * [Windows Start menu] * [Windows wish console] * [Windows: getting desktop properties] * [winico] * [wintclsend] * [winutils] * [winutil] * [winpm] -- support for Windows power and session management * [WippleWobble - A Mini Web Browser (for Windows)] ---- '''Display control panel''': ''[Bob Techentin] wrote in [the comp.lang.tcl newsgroup]:'' According to knowledge base article "Q192806 How to Run Control Panel Tools by Typing a Command", just type "control desk.cpl" at a command prompt. You find that article at http://msdn.microsoft.com as well, if you get to the knowledge base and search for either the title or the article number. If you want to do this from C, you can look at Q232536. Works fine from ''[exec] control desk.cpl'' too, but returns an error code, so you might want to catch it. ---- [LV] 2007 July 12 For a list of some of the free code development environments on Windows, see [tcl editors] and [ide]s, If your favorite isn't listed, please update the appropriate page with your favorite tool's name, etc. ---- [LV] 2007 Oct 16 Note that there are several ways that one might use Tcl on Windows. One is natively. [ActiveState] makes [ActiveTcl] available, and there may be other distributions who also make Windows binary versions of the [tcl] and [tk] (as well as other) libraries. Another way to run Tcl applications on Windows is via an [X] window server. This mode would have the Tcl applications running on some other platform, and displaying via the X window protocol back to the Windows machine. This mode is more along the lines of an X terminal. More and more frequently, Unix developers find themselves faced with this situation. There are several tools which make this mode possible. One is the Hummingbird Exceed X Server. Another is called the Xming X window server. Cygwin used to have an X window server as well. I believe another is called X-Deep/32. Microsoft at one point had, I believe, some X server code as a part of their Posix implementation. There are others as well. If anyone has a link to a comparison of the various alternatives, please add it to this spot. ---- [RS] 2007-10-16: One recommended way of getting Windows binaries is [Building Tcl/Tk with Mingw], and I can recommend it too. You first install the mingw/msys development environment (just unzip one big file - gives you a [Unix]-like tool environment), then unzip the Tcl/Tk sources, configure, make, make install, and you end up with the tcl/tk libraries and executables. See the wiki page for detailed instructions. Worked well for me even on [Windows 95] with 8.5b1 (and that combination officially isn't supported any more). ---- [LV] If you find yourself needing to display X based Tk back to a Windows machine, and forced to use Exceed, I just want to document a head's up. I've been doing this now for several years. When I run the Tk test suite, tests that work just fine when displaying on a Sun based X display fail when displaying on the Exceed display. Here are some of the tests you will likely see fail (and yes, I have opened tk bug tickets on a number of these). === * canvRect-9.1 ScaleRectOval procedure FAILED * canvRect-10.1 TranslateRectOval procedure FAILED font-38.1 ParseFontNameObj procedure: begins with - FAILED font-38.3 ParseFontNameObj procedure: begins with -, doesn't look like list FAILED font-38.5 ParseFontNameObj procedure: begins with * FAILED font-38.6 ParseFontNameObj procedure: begins with * FAILED font-40.1 TkFontParseXLFD procedure: initial dash FAILED font-40.2 TkFontParseXLFD procedure: no initial dash FAILED font-40.3 TkFontParseXLFD procedure: not enough fields FAILED font-40.5 TkFontParseXLFD procedure: all fields specified FAILED font-43.1 FieldSpecified procedure: specified vs. non-specified FAILED * listbox-3.17 ListboxWidgetCmd procedure, "bbox" option FAILED * listbox-3.18 ListboxWidgetCmd procedure, "bbox" option, partial last line FAILED * listbox-3.78 ListboxWidgetCmd procedure, "scan" option FAILED * listbox-4.1 ConfigureListbox procedure FAILED * listbox-4.6 ConfigureListbox procedure FAILED * listbox-5.1 ListboxComputeGeometry procedure FAILED * listbox-5.2 ListboxComputeGeometry procedure FAILED * listbox-5.3 ListboxComputeGeometry procedure FAILED * listbox-5.4 ListboxComputeGeometry procedure FAILED * listbox-5.5 ListboxComputeGeometry procedure FAILED * listbox-6.12 InsertEls procedure FAILED * listbox-7.20 DeleteEls procedure FAILED * listbox-8.1 ListboxEventProc procedure FAILED * listbox-8.2 ListboxEventProc procedure FAILED * listbox-9.2 ListboxCmdDeletedProc procedure, disabling -setgrid FAILED * listbox-14.3 NearestListboxElement procedure FAILED main-3.1 Tk_ParseArgv: -help option FAILED scrollbar-3.12 ScrollbarWidgetCmd procedure, "cget" option FAILED scrollbar-3.36 ScrollbarWidgetCmd procedure, "fraction" option FAILED scrollbar-3.38 ScrollbarWidgetCmd procedure, "fraction" option FAILED scrollbar-6.12 ScrollbarPosition procedure FAILED scrollbar-6.29 ScrollbarPosition procedure FAILED scrollbar-6.35 ScrollbarPosition procedure FAILED scrollbar-6.44 ScrollbarPosition procedure FAILED select-10.2 ConvertSelection procedure FAILED select-11.1 TkSelPropProc procedure FAILED text-1.10 text options FAILED * text-31.11 peer widget -start, -end FAILED textDisp-27.7 SizeOfTab procedure, center alignment, wrap -none (potential numerical problems) FAILED textDisp-29.2 miscellaneous: lines wrap but are still too long FAILED textDisp-29.2.1 miscellaneous: lines wrap but are still too long FAILED textDisp-29.2.2 miscellaneous: lines wrap but are still too long FAILED textDisp-29.2.3 miscellaneous: lines wrap but are still too long FAILED textDisp-29.2.4 miscellaneous: lines wrap but are still too long FAILED textDisp-32.2 elide and tags FAILED textImage-3.2 delayed image management FAILED unixSelect-1.4 TkSelGetSelection procedure: simple i18n text, iso2022 FAILED unixSelect-1.5 TkSelGetSelection procedure: INCR i18n text, iso2022 FAILED unixSelect-1.6 TkSelGetSelection procedure: simple i18n text, iso2022 FAILED unixWm-4.1 moving window while withdrawn FAILED unixWm-4.3 moving window while withdrawn FAILED unixWm-50.1 Tk_CoordsToWindow procedure, finding a toplevel, x-coords FAILED unixWm-50.8 Tk_CoordsToWindow procedure, more basics FAILED unixWm-50.10 Tk_CoordsToWindow procedure, unmapped windows FAILED === I understand that the items above preceeded by * are pixel related and that different "window management" software handles things differently. So your mileage may vary a bit. Another observation - when I run the test suites of various widget sets, such as tktable, tklib, etc. - I typically see Exceed display go into what I call '''burst mode''', where I see about 8 seconds of no activity on the windows machine at all, followed by a quick "catch up" on whatever events were generated during that time, then another 8 seconds of no activity, etc. Once the test suite finishes, performance returns to normal. ---- !!!!!! %|[Category Windows] | [Windows specific Tcl commands] | [Arts and crafts of Tcl-Tk programming]|% !!!!!!