See also [Ask, and it shall be given.], [Ask, and it shall be given # 2], [Ask, and it shall be given # 3]. Please post your question on the latest version of ''Ask, and it shall be given.'' Please put the date along with your name. ----- '''Welcome to Ask, and it shall be given # 4''' * '''Starting on:''' 9 April 2006 * '''Ending on:''' ---- '''Once it has been answered, please leave your question (and the answer of course) on this page but copy it to the appropriate page on Wikit so that all questions will be regrouped thematically. If you cannot find a page, please create a new one.''' ---- 2006-07-19: I would like to test whether a Tcl/Tk application of mine also works on Windows/CE. I don't have any device myself. Could someone please provide installation instructions on how to get started with Tcl/Tk using Microsoft's ''Standalone Device Emulator 1.0 with Windows Mobile OS Images'' [http://www.microsoft.com/downloads/details.aspx?FamilyID=c62d54a5-183a-4a1e-a7e2-cc500ed1f19a&displaylang=en]? I.e., what software to install, how to run it, and how to copy your own code between Windows and the emulator? ---- [ECS] 2006-07-17: Is there a way to use a compressed (zlib) stream? I would like to use something as was done for [tls], just register a compression/decompression layer. Thanks in advance. [MG] There are various libraries mentioned on the [zlib] page for (de)compression. Taking a guess that you're talking about the [http] package (and the way you can [[http::register https 443 ::tls::socket]] for https web pages), I would imagine the best way would be to use the standard method, and then decompress the data after it's been downloaded. If that's not the kind of thing you mean, could you provide more info? [ECS] Thanks. I did not made myself clear. I have a client-server application. Client and server use a plain ASCII stream to communicate. I would like something as [SSH] (a compressed byte stream or, at least, it seems this way). Encryption is not needed, only compression. I could do a call to [zlib] to compress data before every put and do a call to [zlib] to decompress data after every gets but I am looking for an easier way :-) [MG] Ahh, I see. Well, to be honest, I think doing that is probably the easiest way. Or, at least, something like proc _puts {args} { if { !$::compress } { puts {expand}$args return; } set str [lindex $args end] set str [zlib compress $str];# compress string if { [llength $args] > 1 } { puts {expand}[lrange $args 0 end-1] $str } else { puts $str } } so that you can easily turn it on and off by setting $::compress to true/false. (I wouldn't recommend renaming [puts] - other packages you include are likely to call it for various things which wouldn't benefit from unexpected zlib compression. Better to just use _puts yourself when you want the compression.) ---- [Robert Abitbol] July 13 2006 The wonderful adventures of Robert Abitbol into the world of widgets continue. :-) In this page: http://wiki.tcl.tk/11861, it was taught how to compile a TCL script into an exe. I have always used that method and it has always worked excellently, A1 as we say. Now, does anyone know how to add a Widgets library or any library in the list so that it gets compiled also? ----- [Robert Abitbol] July 7 2006 I run every Tcl script with [JCW]'s great tclkit.exe. (I copy the script and I paste it in tclkit.exe) The Tclkit.exe file is installed in c:\Tcl. This way: c:\Tcl\tclkit.exe Now I install libraries in the lib this way: c:\Tcl\lib\Widget Unfortunately I get an error message everytime I want to run a script that requires a certain library. It seems that I am missing something here: I believe I should not simply copy the library in c:\Tcl\lib\. Something else needs to be done. What? Thanks for the answer! [SEH] 20060707 -- Do you run the [load] command to load the libraries (I assume you're talking about Tcl stubs-enabled shared libraries)? [Robert Abitbol] Thanks Steve. No I don't load the libraries. I don't know how to do that. Maybe I should execute tcl.exe and when I get the prompt (as we used to call it in the DOS days), I should install the libraries. Is that how it should be done? What is the syntax? I am talking about libraries such as BWidgets. Perhaps I should get a copy of tclkit.tcl and make an exe out of it incorporating the needed widgets. Or perhaps use the tcl.exe and type in the info. First enter the load library function and then the run function. Anyone has an idea what the syntax will be to load a library and to run a program? [Sarnold] See [starkit]. You'll probably be happy with a Starkit. * put all your code into a directory 'myproject.vfs' * put the main file as 'myproject.vfs/main.tcl' * put the libraries you need into 'myproject.vfs/lib' (e.g. 'myproject.vfs/lib/BWidgets/*.tcl') Then you would need [sdx] to wrap these files into 'myproject.kit'. Libraries into the 'lib' subdirectory are automatically loaded by [package require]. [fr] to return to tclkit.exe: see [auto_path] to know where libraries are searched. Type "set auto_path" in the console window to see. To include the working directory of c:/Tcl/tclkit.exe, insert the line "lappend auto_path c:/Tcl" on top of the main script. Or set the environment variable TCLLIBPATH, if present its value is the last element in the list auto_path. If you got it right the following should show your path: set version [package require "Widget"] puts [package ifneeded "Widget" $version] [Robert Abitbol] Un grand merci Stéphane! Les Bleus, dimanche, dommage! Thanks to you also Roland. This is what I did: 1) I typed in the console the following: set auto_path and this is what I got: : {C:TCL/TCLKIT.EXE/lib/tcl8.4} {C:/TCL/TCLKIT.EXE/lib} {C:/TCL/TCLKIT.EXE/lib/tk8.4} (Tcl) 4 % 2) I'll put the following line on top in the main program: "lappend auto_path c:/Tcl" 3) Then if I type in set auto_path in the console, I should get: set version [package require "Widget"] puts [package ifneeded "Widget" $version] Am I right so far? 4) Afterwards, all I'll have to do to execute the script is to paste it into tclkit.exe like before? Will the line "lappend auto_path c:/Tcl" tell tclkit.exe to load all the libraries in: C:/TCL/TCLKIT.EXE/lib/ for the program I am working on? '''10 minutes later''': I did steps 1, 2 3, 4. It's still not working. I am missing something. [fr] the last element in auto_path seems to be incomplete (TCL) should be /Tcl alternative: look for the file pkgIndex.tcl in your library directory and insert "source /the_path/pkgIndex.tcl" instead of "package require .." (this is what package require normally does) [Robert Abitbol] OK! I have a pkgIndex.tcl file in: c:\TCL\Lib\BWidgets. This is the code I have in the beginning of the file: if {[catch {package require Tcl}]} return package ifneeded BWidget 1.7 "\ package require Tk 8.1.1;\ [list tclPkgSetup $dir BWidget 1.7 { {arrow.tcl source {ArrowButton ArrowButton::create ArrowButton::use}} I'll change the third line: package require Tk 8.1.1;\ to source /the_path/pkgIndex.tcl; \ Is that right? [fr] using BWidget 1.7 in c:/Tcl/lib/BWidget-1.7 # using absolute path lappend auto_path c:/Tcl/lib # using path relative to working directory, where Tclkit.exe is # lappend auto_path [file join [pwd] lib] # using path relative to where the script is, i.e where these lines are inserted # lappend auto_path [file join [info script] lib] package require BWidget or set dir c:/Tcl/lib/BWidget-1.7 ;# variable required inside pkgIndex.tcl source [file join $dir pkgIndex.tcl] package require BWidget or insert general initializations in file wishrc.tcl and place this in the home directory, see $env(HOME) ----- [GWM] I have changed the icon on my toplevel window to an xbm file using wm iconbitmap . @folder.xbm and the icon is restricted to the 2 colours used by the wish feather icon. How can I change the colours to (say) red and green, or pink and transparent? Reply moved to [how do I give my application a color icon] ---- [Sarnold] (21 June 2006) I have a strategy game with Tcl/Tk under Windows XP ([Mancala]). I wrote a small library (dll) providing commands to compute the computer move. Previously, when I ran into a command of this extension, it freezed the GUI events. I found the solution and moved it into [Threads vs. events] (I tried both, and events won). ---- seo - (15 June 06) Double click event won't fired ... I typed in wish bind . {puts "double clicked"} bind . <1> {puts "clicked"} and expectd this when double-click on toplevel window clicked double clicked but it shows clicked clicked I tried tclkit version 8.4.13 / 8.5b4 / etcl 1.0 rc6 / ActiveTcl 8.4.13.0 on windows xp sp2 (korean version) Double click rate are ok with other apps. Is there a way configure double click rate on Tk? or am I missing something? [MG] This works fine for me in ActiveTcl 8.4.9 and Tclkit 8.4.11. I'm fairly sure that the double-click speed is taken from XP, too, so that shouldn't cause a problem, if you're clicking fast enough for XP to consider it a double click (which you can test in the Mouse properies under Control Panel). Are you sure that you had both the bindings set? I do get the behaviour you experienced if I bind to <1>, but not to . seo - Thanks MG. But I checked it several times. Tested Tclkit 8.4.11 also, but it still act like above. When googled comp.lang.tcl, I found out there are others suffered from same symptom( [http://groups.google.co.kr/group/comp.lang.tcl/browse_thread/thread/62296ca69bd34ecc/9e56cf55853083b0?q=double+click+event&rnum=1#9e56cf55853083b0] and [http://groups.google.co.kr/group/comp.lang.tcl/browse_thread/thread/f3585bec37487a92/cf7380435f83e6a8?q=double+click+event&rnum=2#cf7380435f83e6a8] ). By his name(at first link), he may be korean, too. I suspect this behaviour is something to do with korean version (or non-english version) of Windows. Is there anyone who experienced similar case on non-english version of windows? [MG] If it's not the double-click speed, and you're not moving the mouse at all between clicks (which does seem to 'interrupt' a double-click, as those posts suggest) then you may be right, though I unfortunately can't test that for you. Anyone else out there on a non-English version of Windows who can try it? seo - MG, I really appreciate your concern. I finally figure out what makes it wrong. The korean IME! By turning off korean IME, Tk behaves properly. This bug has existed for a long time, and still be there! [http://groups.google.co.kr/group/comp.lang.tcl/browse_thread/thread/c1c9c6439a51636/e768d517e07ef317?q=double+click+korean&rnum=2#e768d517e07ef317] ---- [LB] I think I'm making something that should be easy much too hard -- time to ask. I have a grid-based input screen. Some of the entry widgets can be populated from pick lists activitated by a button to the right of the entry. I want the pick lists to appear over or just under the entry and to disappear when the selection is made. AFAIK, only frames and toplevels can be made to appear and disappear. When I place a frame in the cell below the entry, it "works" but the appearance distorts the screen. So I'm using a toplevel which works but is hard to place. The issues are cosmetic, but I fear the windoze users will reject my work on this basis. This is such a common convention in GUIs that I have to believe there is a simple way, perhaps a special widget designed just for this. I'd be grateful for any pointers. The simpler the better -- this development is not my primary job, and I'm under some pressure to produce quickly (part of how I sold Tcl/Tk). TIA, [aricb]: [Tile] has a [combobox] widget, as does BWidgets. A menubutton or other popup menu also works nicely for this kind of thing. ---- [Robert Abitbol] I'd like the name of the file to appear in File Name: when I click on Save as. Anyone knows what code I should enter so that the name of the file appears? Thanks! -- See [http://www.tcl.tk/man/tcl8.4/TkCmd/getOpenFile.htm] for the '''-initialfile''' option to [tk_getSaveFile]. You should also set -initialdir then. ----- [Robert Abitbol] I am on a split screen in my editor: there is a left window and a right window. A file is opened in each window. I want the user to be able to save the file on the left when the cursor is in the left window and vice-versa to save the file on the right when the cursor is in the right window. Is this hard to do? Is this cursor approach ok or do I instead have to find another way to let the program know that we are on a split-screen? I also get the similar problem when I click on Find. The Find works only in the right window even if the cursor is on the left window! I obviously have window geometry problems. Anyone less geometrically-challenged than I am with an answer? I was told 8.4 tcl had a paned window function. Would that help? Thanks again! [fr] how to query which widget has the focus: # the name of the active window is displayed in the title catch {destroy .f} frame .f entry .f.left entry .f.right pack .f.left -side left -padx 5 pack .f.right -side right -padx 5 pack .f -pady 5 catch {destroy .l} label .l -text "Use Tab-key or mouseclick to change the active widget" pack .l -pady 5 catch {destroy .b} button .b -text "Which entry is active?" -command {wm title . [focus -lastfor .]} pack .b [Robert Abitbol] Thanks Roland! I know the right window is active and not the left. I asked [Maurice Ulis] and he provided me with an answer so clear even I, a total beginner could understand! This is it (I have translated his text from French to English): You must use ::current_ht instead of ::main_ht. Current_ht seems to have been made for this purpose. But before, the ::current_ht must be updatated everytime the user changes windows. Changing windows can mean two things: Option 1: putting the cursor in a specific window Option 2: putting the mouse in a specific window The procedure to determine which window has been opened is specific to the choice made. For option 1, the event must be followed in the two text widgets. For the option 2, the event must be followed in in the two text widgets. I did understand the algorithm. But to code it is another story altogether. :-) ----- [rdt] (2006 May 30) I have read about Wikit & producing a wiki with wikit.kit and using wikit.tkd. My question is how would one start such a wiki with _no_ pages built in. That is, the default wikit.tkd seems to have some extra pages up to 14. I realize that pages 0 through 9 are "special" and thats ok. Its the others and the, what seems to be built in, Recent Changes that I'm asking about. [rdt] Ok, here is how I finally solved this. * Get [dgMKviewer], * Get it to work (I had to temporarily patch it not to reload main.tcl), * Use dgMKviewer on a default wikit.tkd to clean out all the old pages/references, etc. ---- [LB] (25 May 06) My question is on cross-platform starkits that have binary extensions. In this case, the only platforms are MS Windows and Linux (XP and FC3, but I doubt if the versions are the issue). I have a program that requires Pgtcl. When I move the source and platform-appropriate Pgtcl libraries/dlls to the machines by hand, the program executes perfectly on both. The Linux kit version also works perfectly. However the Win XP kit gives an error message: couldn't load library "C:\DOCUMEN~1\lbarnes\LOCALS~1\Tmp\Tcl19.tmp" ... and then a trace dump back to the require Pgtcl line. The "19" in the above actually has incremented on each invocation (?? curious). For the record, the .vfs structure is ./foo.vfs/lib/Pgtcl1.5 with the pkgIndex.tcl and dll's inside that. Any thoughts? [LB] I seem to do a lot of answering my own questions. Pgtcl1.5 for windows is not stubs enabled. When I replaced it with Pgtcl1.4 which is, all was well. "Never give up! Never surrender!" - Cmdr. Peter Quincy Taggart, Galaxy Quest ---- [LB] (26 May 06) I cannot get auto_path to work within a starkit. I unwrap foo.kit into foo.vfs. Within that, I try at various stages in the code, including in main.tcl (after initialization but bfore requiring my app) to do this: lappend auto_path "/home/lbarnes/foo.kit/lib/linux" But this has no effect. I still get the error that my package can't be found. Since the only package path recognized seems to be foo.kit/lib, I'm forced to surmise that auto_path is not how starkits control package searches. What, if anything, does? The goal, which may be easier another way, is to have several different platform specific binary packages made available from within one starkit. Again, TIA [aricb] Tile was released as a multi-platform starkit; maybe it can give you some ideas. On the download page (http://sourceforge.net/project/showfiles.php?group_id=11464), look under tile-0-7-2 for tile07.kit. ---- [Robert Abitbol] (22 May 2006) I would like the cursor to appear on the top left of the edit box when I click ''new'' on my editor. I have inserted: ''$::main_ht mark set insert 1.0'' and it still does not work. Any one has an idea what the code could be? Thanks! [fr] supposed the caret is not visible, try focus -force $::main_ht [Robert Abitbol] I did and it works '''impeccably'''! Thanks so much, [fr]! Now I am really '''intrigued'''. When I place a focus -force $::main_ht in the open file procedure, it does not work. Why? It's because first the dialog window is opened. How do we tell the program to ''focus force main ht'' (that is to put the cursor on the top of the edit box) '''after''' the user has selected a file. [fr] main_ht is the name of the text widget? set filename [tk_getOpenFile ...] # dialog lost focus # open the file and insert text into widget focus $main_ht ;# use option -force if executed in console window [Robert Abitbol] main_ht is apparently the editing area. I believe the variable where the name of the file is inserted is: (file rootname [file tail $f))) (put parentheses instead of square brackets) Therefore the whole function asking to put the cursor on the top of the file selected would be this? (file rootname (file tail $f))) focus -force $::main_ht (file rootname (file tail $f))) [fr] to have a working example take this modified procedure from [A minimal editor] proc loadText {w fn} { if {$fn==""} return wm title . [file tail $fn] set fp [open $fn] $w delete 1.0 end $w insert end [read $fp] $w mark set insert 1.0 focus $w close $fp } [Robert Abitbol] Well, all I would need at this stage is to be able to tell the program to put the cursor on the top of the editing zone '''once the user has opened a file'''. I remember there was a similar function in C. ----- [Ron] I just installed TCL on Solaris system. When I type tclsh the message "ld.so.1: tclsh: fatal: libgcc_s.so.1: open failed: No such file or directory c/r Killed" It looks like it compiled, but something else is wrong. Any ideas? [RJ] had this - you need to -add- /usr/local/lib to your LD_LIBRARY_PATH environment variable. You will probably have other directories in it for some other application, It would find libgcc_s.so.1 if you did not. Unsetting the env variable is preferable (to allow it to look in shared default locations for load libraries, but that will probably break whatever app put it there. Just append /usr/loca/lib to the LD_LIBRARY_PATHvariable in .cshrc with a colon between directories. To approximate default search order: setenv LD_LIBRARY_PATH = /usr/local/X11/lib:/usr/local/lib:/usr/openwin/lib:" (for csh) set LD_LIBRARY_PATH = /usr/local/X11/lib:/usr/local/lib:/usr/openwin/lib: then export LD_LIBRARY_PATH (for sh) ---- [Robert Abitbol] 2006-05-17 I have a peculiar problem with the file association command on Windows (the file type). I have a file called: Story.wer . I gave the association on File type: wer, open c:\wer.exe The program opens ok when I click on: Story.wer . What it does wrong however, is it does not show the file name correctly and also does not show the directory name correctly. It only shows a few characters. What could be the problem? Thanks! I am getting there! They say half the fun in a trip is the journey getting there. Indeed! [MG] I assume that 'wer.exe' is a Tcl program which you've wrapped into an executable? In which case, how did you wrap it, and how are you trying to display the file's name and path? Does it work correctly using an unwrapped copy of the Tcl script (ie, if you do Start->Run, "wish c:\wer.tcl c:\story.wer")? [Robert Abitbol] Yes indeed. wer.exe is a tcl program I have wrapped into an executable. It does work very well as an executable. I can see the file name and the directory name just fine. It also works well when I copy the wer.tcl file and paste it into tcl.exe (I use [JCW]'s tcl.exe a lot; it's very useful and it works A1; I am not familiar with the Start->Run, "wish c:\wer.tcl c:\story.wer" however)? It's just when I click on a file to open the program that I have the problems mentioned above. I'll look into the way the directory name and the file name are displayed and I'll get back to you with the answer. Thanks Mike! By the way, Mike, your bindings for home and key work '''very well''' (at: [Home, End and other formatting problems]. A million thanks! For two years I was editing like a crippled man with home and end working badly. Now, thanks to you, those keys work A1! It's a new day in my life! '''Later'''. Here is what I believe is the code showing the directory on the top of the program. proc update.wm.title {args} { # FRINK: array ::tcl_platform # FRINK: set ::data_dir if {"windows" == $::tcl_platform(platform)} { wm title . [string map {/ \\} "HLE [file normalize $::data_dir]" ] } else { wm title . "HLE [file normalize $::data_dir]" } } #END src/update.wm.title.proc Thanks! [MG] (I edited the code you pasted in to format it properly for the wiki.) That is the code which changes the title. It just sets it to the value of the global variable $::data_dir though (after running [[file normalize]] on it, which isn't going to be what's breaking it). You'll need to find where that variable is set - seems like that's where the problem is occurring. Incidently, rather than that [[string map]], a better way to show the path is to use wm title . "HLE [file nativename [file normalize $::data_dir]]" which can be used on any platform, so you don't need the [if]. (Glad you found the text widget bindings useful, btw.) Ahh.. if you use Win 98, you might not have the Windows Start menu/Run, it's been so long since I used '98 I really can't remember. But does the same problem happen if you run the (unwrapped) Tcl script and tell it to load your .wer file, or does it only happen with the wrapped version? How did you produce the .exe ([freeWrap], from a starkit, etc)? [Robert Abitbol] Thanks Mike! You write: ''But does the same problem happen if you run the (unwrapped) Tcl script and tell it to load your .wer file, or does it only happen with the wrapped version? How did you produce the .exe (freeWrap, from a starkit, etc)?'' I don't use the program that allows to load a file. I simply use the excellent tcl.exe to execute a tcl script. Great idea this pasting of the file into tcl.exe! I have shown it to a programmer-friend and he thought it was brilliant. The programmer did provide me with an exe. I have no clue what program he has used. ----- [wdb] 2006/05/17 Hi everybody! Is there any tutorial, or sample of ideas for such, intended for children (aged 10-18)? E.g. some popular game simply to realise in Tcl/Tk (except Lara Croft because tomb raidering is '''evil''')? Any idea welcome! -----> Question and answers moved to [Teach programming to children]. ----- [Ravi Christianosk] Have d'loaded a TCL editor and I seem to have problems with the cursor; when I click Home I get to the beginning of the paragraph instead then the beginning of the line. Vice-versa: end gets me to the end of the paragraph. When I wanna an ascii code, I get the code 3 pages down instead of the location of the cursor. What seems to be the problem and how to fix it? -----> Question and answers moved to [Home, End and other formatting problems] ---- [GWM] how do I add a completely new configure option to a Tk widget? I have read [Overloading widgets] but that example shows how to create a megawidget such that the code can configure either the frame or its text content. I want to add a new option called 'pencolour' to a canvas such that when I call my 'addline' routine the new line will be drawn in the 'pencolour'. The addline procedure works fine as described. To be plain I want the following code to work: set ga [grapharea .mygraph -height 200 -width 400] ;# make a canvas that is overloaded as in [Overloading widgets] $ga configure -pencolour pink $ga addline 10 10 200 125 this will use the addline proc to add a line to the canvas, and I need the pencolour option to be configured to define the line's colour. I think I could do this by adding a global variable $ga.pencolour but distaste for globals.... Can I add a new option to the widget (I have tried option add pencolour red interactive but this just added the option red, and would not let me modify it to pink, or even orange.) [aricb] You need to write your [[grapharea]] proc so that it can parse such an option, and you need to create a persistent variable (such as a namespace variable) to remember it. I'd recommend that you create a [Snit] widgetadaptor. I think it will greatly simplify your task. [GWM] I have added my code as a (now slightly useful) example [Another Graphing Widget]. I have used a global variable to retain the value, but I am not happy spraying globals around - is there a better way, preferably such that the globals would be destroyed if the associated widget is destroyed. ---- [MK] I am using iwidgets::tabnotebook. If I reduce the size of my tabnotebook by using the mouse, the widgets displayed in the selected page starts disappearing. To avoid this problem I think , I need to add scrollbar in each of the pages. Can someone tell me how to implement this, or any better solution to the above mentioned problem. [fr] minimal window sizes could be defined by wm minsize toplevel width height (using the window manager) grid columnconfigure ... -minsize ... (geometry manager for child widgets) ---- MSH 16-Jun-2006: I am porting some of my apps to LINUX/Gnome and would like to have the same icons on the taskbar as I have under windows, is it possible to use a gif image or an XPM file instead of an XBM (only black and white) for a 'wm iconbitmap' command or is there some other way (xxx.so) which would allow this change ? [MG] Take a look at [How do I give my application a color icon], which uses the [wm iconwindow] command for it. Thanks, I tried that and it does not seem to work with either of my windows managers KDE or GNOME, I used the code from [KDE window icons] which works on my KDE with a slight change to my startup alias and judicious choice of the name (I do not have permission to write to the /usr/share/... directories). I was looking for a small piece of critcl 'c' code or a small .so file, I guess I will have to wait for the TIP 159 [http://www.tcl.tk/cgi-bin/tct/tip/159.html] to arrive. ---- [RPR] 2006JUN20: I am writing a Tcl/Tk application running under Windows98 via Tcl/TK 8.4.13. I use [file join $disk $dirpath $filename ] to create the full disk-to-filename path string. The full path string comes out looking like C:/foo/bar/filename.txt (call that version 1) which is perfectly acceptable to Windows98 even though it's not according to the published preferred standards. However, It is NOT acceptable to the program (IrfanView) which I am running via exec, which requires that paths be like C:\foo\bar\filename.txt. (Version 2). So what I'm look for is a code snippet, preferably debugged, that will take the version 1 path name as input and yield the version 2 path name. The only difference is that the forward slashes in version1 are converted into backward slashes in version 2. [MG] This is actually a nice simple one :) % set path [file join c:/ foo bar filename.txt] c:/foo/bar/filename.txt % set path [file nativename $path] c:\foo\bar\filename.txt [RPR] Many thanks. Just what I wanted. ---- [RPR] 2006JUN27: I am (still) writing a Tcl/Tk application running under Windows98 via Tcl/TK 8.4.13. It has a textentry widget. It also spawns IrfanView as graphics display mechanism (faster than Img), using the & option of exec, so that the tcl script can continue processing while the IrFanView executable is running. The spawning process is a one line console-type input (i.e. no further keyboard or mouse input is needed. The problem is that when IrfanView is finished displaying the image, (and waiting for further mouse or keyboard input), it is still the Windows98 window that has the machine's focus (blue strip at top of window is blue, not greyed out). What I'm looking for is a command that I can execute from the tcl script that will get Windows98 to put the machine's focus back on the wish window executing the tcl script. Things that work: tk_messageBox -type ok -message " Stopped here. " Things that don't work (so far): focus grab Working name for command: ComeBackHereYouSOB . . . (grin) [MG] This might work focus -force . If your app doesn't already have the focus, you need to use -force to "steal" it from the application which does. [RPR] Once again, many thanks. It worked perfectly! ---- [goldshell7] new item on 30JUN2006. I need a screenshot loaded on TCL/wiki for {Refrigerator_Magnetic_Poetry} in category toys. I can email a gif, but not sure who's on vacation? thankx. [MG] If you have any webspace anywhere (plenty of places offer free webspace) you can just upload the image there, and then link to it in the normal way. I'm not sure if/how you can get an image hosted on the mini.net server, though I know some are. ---- [Barney Blankenship] I'm having a problem that I'm not sure why it's a problem, I'm thinking it's either vTCL or ActiveTCL related (caused, not sure). Anyhow, a "keysym" binding is what I need, for control sequence keys, like Ctrl+Z, which I have SEEN used... but when I use them I get an "invalid keysym" error. I seem to only be able to use the keysyms listed in the ActiveState help list for keysyms, like or and such. I really need those other sequences, such as copy, etc... what gives? [MG] You just need to get the names (exactly) right - it's "Control", not "Ctrl". So something like bind $widget [list doUndo $widget] [Barney Blankenship] Just tried and tested your solution, it works! Thank you so much! ---- MSH 2006-07-04 I have an application using tclkit with tktreectrl 2.1 and tile0.6 which works great under windows and linux, I have a user who would like it to run on a sun-sparc I thought no-problem recovered tclkit (8.4.9) for sparc and wrapped up the tktreectrl and the tile06.so from the tile06.kit file into a starkit but the tile 06.so refuses to load and gives : couldn't load file "/var/tmp/tcl9iaWnk": ld.so.1: Program.SUN: fatal: libgcc_s.so.1: open failed: No such file or directory while executing "load /home/smith/sources/Program.SUN/lib/tile0.6/SunOS-sparc/tile06.so" ("package ifneeded" script) invoked from within "package require tile" Does anyone have a version of tile 0.6 which runs on a sun sparc platform ? I can load a later version but would have to recode a large library to work with tile 0.7 which is not compatible. (maybe the active tcl archives but which version was delivered with tile0.6 ?) (I do not have access to ftp from work) ---- RPR 2006JUL19 I've made a text widget with TCL/TK 8.4.13 from Activ running under Windows 98 SE text .txt -height 8 -font " courier 16 bold " After putting a bunch of text in the widget on several lines, I cue the user for input with .txt insert end "?>" At that point I'd like to have the characters entered by the user via the keyboard (up to the {ENTER} key) appear underlined (as they are being entered). Nothing I've tried so far works. Suggestions? [Category Discussion] - [Category Development]