'''Purpose:''' Provide a collection of hints for making Tk more convenient on Microsoft Windows. * The care and feeding of the system menu is discussed in [menu]. * [Windows Wish Console] has some tricks for dealing with the Tk console on the Windows platform. The [menu] page shows how to add a ''Show Console'' item to the system menu. * (''KBK'' 8 January 2001) The Wish console can also be used from within C++ code; [Cplusplus streams and Tcl channels] shows how. * [Printing a canvas under Windows] shows one way to get printout from the canvas on Windows. * There are various hints on running DDE, on a page called, predictably enough, [dde]. * Example of using the registry package can be found at [Windows Registry Browser] * [Invoking browsers] shows how to launch a Web browser under control of a Tcl script. * There is a collection of hints on how to deal with a [serial port]. * [Bag of algorithms] has help in dealing with the Windows file system, including how to test if a drive has media in it, how to tot up the free space on a drive, and how to deal with variant line terminators (CR/LF vs. LF only). * [TEA] includes a discussion of how to build a native-code extension on Windows using Visual C++. (Alas, it's an embarrassment to the Windows using portion of the Tcl community!) * '''Text widget contents''', even with exotic Unicodes, can be printed on WinNT by copying and pasting into a Notepad, provided you have a Unicode font like Bitstream Cyberbit (recent Microsoft fonts also support Greek, Russian, Arabic, Hebrew), and have set Notepad to use that. The "higher" editors like Wordpad and Word don't accept exotic text pasting so easy, since they refer to an explicit font setup that also includes the language. ''RS'' * An installation program will often want to [Register file types under Windows] so that users can invoke a Tcl script on a file by double-clicking the file. * If a Tk app pops up a fileselector dialog at its beginning, the main window may not react to clicks or keys even if it seems to be in focus. A (on Unix redundant) ''update'' before the fileselector command fixed that. - RS ---- TFW 3/02/01 The tk_chooseDirectory command is useful for selecting a folder via a graphical dialog. The one used in Tcl 8.4a2 and before is based on an old Windows 3.1 dialog that returns all of the names in uppercase. This can be quite annoying when you need the case name as shown on the system. The following script will return the proper case by using a file command that returns the proper cased name. ## # tk_chooseDirectory that works for Windows (gets good case name) # proc chooseDirectory {args} { set choice [eval tk_chooseDirectory $args] if {$choice == {}} { return {} } ;# end if if {$::tcl_platform(platform) == "windows"} { return [file attributes $choice -longname] } else { return $choice } } ---- See also [Microsoft Windows and Tcl] - [Windows: getting desktop properties] ---- [Arts and crafts of Tcl-Tk programming]