----- '''EDIT/RECENT CHANGES''' * Edit this page: http://wiki.tcl.tk/edit/11149@ * Recent Changes: http://wiki.tcl.tk/4 ----- '''Mail''' [Robert Abitbol] Thanks Peter for your excellent presentation on the "Answered Questions on ..." pages. The idea to put trails on each page (Home, back, and forward) was '''grand'''. The idea for a table of contents for each page was also very appropriate. The same goes for the excellent presentation on the [Answered Questions Index Page]. This is very professional work which makes those pages a pleasure to read. Thanks again! ---- ---- '''Please don't edit anything below this line. It's stuff from [Ask, and it shall be given.] that's being transferred to the "Answered Questions On: Whatever" pages. Thanks. Peter Newman, 29 October 2004.''' ---- ---- '''Category: ''' Nov 04, 2003 Newbie asks: I'm trying to create a "yellow stick note" app. I have created a little decoration-less window using wm overrideredirect, and now I need to generate window-moving events so that I can manually place the sticky note. I believe I need to use event generate, but how do I get drag coordinates into a little script, which would (I believe) call wm geometry? Thanks... Here's a solution: set ::moveable 0 wm overrideredirect . 1 bind . {set ::moveable 1} bind . {set ::moveable 0} bind . {if {!$::moveable} {break}; wm geometry %W +[expr %X-10]+[expr %Y-10]} JPT Newbie responds: Sacrosanct bovine, Batman! You guys sure make it look easy! Just to make myself feel better, I modified your solution so that the frame wouldn't 'jump' to the cursor: set ::moveable 0 set ::X 0 set ::Y 0 wm overrideredirect . 1 bind . {set ::moveable 1; set ::X [expr %X-$::X]; set ::Y [expr %Y-$::Y]} bind . {set ::moveable 0; set ::X [expr %X-$::X]; set ::Y [expr %Y-$::Y]} bind . {if {!$::moveable} {break}; wm geometry %W +[expr %X-$::X]+[expr %Y-$::Y]} ---- '''Category: ''' 22-Oct-2003 I'm using tclkit to run tcl stuff on windows plattforms, but i can't open files under Windows XP. Win 2000 works fine, are there any known issues with Win XP, maybe concerning filepaths? Bernd [Vince] -- no, there are no known problems on XP. You'll have to be much more precise about what your doing. Provide a short script (< 10 lines) which works on 2000 but fails on XP. This should be easy if you ''can't open files''. Well, a single line will do: "set FILE [open test/file.txt r]". This works fine on 2000 but fails to find the requested file on xp. The problem remains when i replace slash by backslash, i'd think both variants should work. There is nothing else in the script i used for my test, the script is wrapped for win using: "sdx wrap tclxp.exe -runtime tclkit-win32.upx.exe". -- Bernd I'm really surprised now, because i can't even open a file in the same directory ("set FILE [open file.txt r]"). So it's not a slash, backslash problem. -- Bernd [Vince] with any bug report, the ''error message'' you get is critical. Anyway, I suggest you report this on comp.lang.tcl or on sourceforge, not here. ---- Question on text widgets displaying large files moved to [text]. ---- '''Category: ''' 18-Oct-2003 Hello! I have a question about Winico. I have installed the package and have trouble loading it. After copying the winico03.dll into the working directory, I enter the following: load winico03.dll I get a cannot find library winico03.dll or one of its dependants. What would cause this and what do I do to overcome it? Thanking you in anticipation. ---- '''Category: ''' Broken Link??? Sep 30 - 2003 Hello. I tried the following link that was on the wiki site (ftp://ftp.dcade.de/pub/ml/tcl/packages/tcl_messageBox10.zip) but could not get through. Anyone have any luck as I would like to view this. Thanks Ep ---- '''Category: ''' Tcl Installation/Uninstallation Sep 30 - 2003 Hi all! I easily compiled and installed the latest Tcl source code. I was needing it for compiling expect. Now I am done with my tasks, I have successfully uninstalled expect, but I found that there is NO make uninstall available for the Tcl code. Does anybody know any way to uninstall Tcl source code, apart from searching by date and removing file by file!? Your help is much appreciated!! Have fun, Oscar ---- '''Category: ''' Sep 29 - 2003 How can i use the options(-error,-sockname,-peername) of configure command of socket ? The main problem is, like -sockname option returns three elements so how can i store these values to use further? ---- '''Category: ''' Sep 25, 2003 I have a channel that I have opened as: set cid [ socket -server cfg $port ] From time to time the client times out reading this channel. When that happens the data in the buffer (from a puts command) is no longer valid. I would like to throw it away. NOT [flush] it, which just sends it to the client the next time the client tries to do a read, but actually empty the buffer and throw the data away. How can I do this? Thank you in advance. ---- '''Category: ''' 20-Sep-2003 I'm messing around with tk_setPalette I have a problem with the foreground being black on black or more precisely very dark blue this is only a problem with errors which I can't read unless I edit both libs: dialog.tcl and bgerror .tcl. I made the foreground red which is readable. I hate messing with the lib scripts though, is there a way I can do this from within the main script? ----- '''Category: ''' 04/August/2003 (Formerly 31/July/2003, with added details) I am trying to analyze some hex numbers with odd size bit fields and was trying to write a tool to break up the bit fields. The problem is that I haven't been able to figure out how to enter hex numbers and have them not converted to decimal in the ENTRY field. It's hard to figure out if the rest of the code works when the display keeps changing to decimal on me. Thanks in advance! Okay. I had vTCL write a GUI where I enter a number at the top which will be HEX in the final version. Then I have fields that allow entry of up to 16 bit-field sizes and a a display area for each field's value. The last element is a "doit" button. The code then figures out how many fields there are and for each field it uses shifts to eliminate all bits outside the current field with the field ending up in the low order bits so it can be displayed. Now that I have the basic GUI, I'll make all the other changes myself. Here's an example: Initial number is A5A5, divide it into a 5 bit field, a six bit field and a five bit field: 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 <-- Bit number | 1 | 0 | 1 | 0 | 1 | 0 | 1 | 0 | 1 | 0 | 1 | 0 | 1 | 0 | 1 | 0 | <-- Bit Value ----------------------------------------------------------------- | 1 0 1 0 1 | 0 1 0 1 0 1 | 0 1 0 1 0 | <-- Desired fields 0x15 0x15 0xA <-- Values of desired fields in HEX The problem is the initial entry of the hex numbers. Here's my current entry command where I've tried to limit the input to hex digits, but it treats the entry as a decimal integer (I currently have to enter decimal to get it to take a number, so I had to increase the field size and chose 8): entry $base.ent61 \ -background white -takefocus {} -textvariable RawHex -width 8 \ -validate key -vcmd {expr {[string is xdigit %P] && [string length %P] < 8]} [FW]: So does it ''treat'' the entry as a decimal integer, or actually convert it? You've said both. -------- '''Category: ''' Question (12 June 2003) [MAK] I recently had a visually-impaired prospective customer, who uses a screen reader program called Jaws [http://www.freedomscientific.com/] evaluating one of my products that uses Tcl/Tk for the GUI. I decided to try it myself to see how the GUI could be improved for such use. Not surprisingly there were some problems, mainly with some custom megawidgets that aren't really conducive to screen reader use, though many would be fairly simple to fix (such as allowing elements to take focus that currently don't). Some basic widgets/elements such as menus and text widgets seem to work okay, others like entry widgets don't, at least the way they're currently used. Some work partly: the text widget speaks when you select text, but for some reason my syntax highlighting causes only parts of the text (the non-highlighted parts) to be spoken. Perhaps someone has experience writing screen-reader-friendly Tcl/Tk applications and could write a bit of a tutorial or tips page of some sort on developing Tcl/Tk applications that are compatible with screen readers? Thanks. Note: I did see [Speech Synthesis, or Talk to me Tcl] but it seems like it might be better to make use of any features inherent in Tcl/Tk widgets to tie into Windows Accessibility features that a screen reader such as Jaws use. Some items work fine, so why not all? ---- '''Category: ''' Question (9 jun 2003) : I'm trying to compile a c++ dll library (under Windows 2000, using Dev-Cpp) that interfaces with tcl scripts. Even if I've linked the tcl83.lib and tk83.lib, and include tcl.h, I get the linking error: "undefined reference to _imp__Tcl_CreateInterp" and other similar. Same error if I try to compile a simple c/c++ program. The strangest thing is that, if I split the tcl functions in a testing procedure in the same file as the main it works. But as I use a different file for the procedure, the compiler gives the same linking error. Could anyone help me? Please write to: eyes.wide.shut@katamail.com ---- '''Category: ''' 04/Aug/2003 When I am using "for_file" in windows version TCL/TK then I am getting error like invalid command name "for_file" while executing for_file std_msg c:/Tool/iisver {break} Is for_file command is not exist in windows version, if so, then what's the best way to use in windows instead of for_file ? [lv] [for_file] is a part of [tclx]. Make certain you have downloaded and [install]ed that [extension], and that your application includes a line such as package require Tclx before you use for_file. [RS]: If you can't get TclX, see the [for_file] page. ---- '''Category: ''' 04/Aug/2003 when I am using below systax executing in tcl/tk, then I am getting error. Syntax is set dirinfo [exec command.com/c dir] Error I am getting, when I am executing this is 'invalid command name "command.com/c"' How can I execute this? Could you please suggest me. [lv] does [DOS bat magic] help? - [RS] Put a space between the filename command.com and the switch /c. DOS shells can do without the space, but Tcl requires whitespace between words. ---- '''Category: ''' 30/July/2003 I am facing some problems in tcl/tk windows version I am using tcl/tk 8.4.4.0 version on win 98. When I am using "exec" then I am getting errors. example: set msg [ exec c:\cssplit.exe]; where cssplit is "C" program and cssplit.exe executable file, when executing this, it's giving error "child process exited abnormally while executing exec cssplit". when I am executing batch files then it's givng couldn't execute test-spec.bat no such file or directory, but file is existing, not only this what ever I give with "exec" command all are getting errors. Could you please suggest me to execute this command. [lv] I suspect that the problem here is that cssplit is either producing output on stderr or returning a non-zero return code. See [catch] for a way to account for these two alternatives. Note that it is easier to answer a question when you show us exactly what you type and what the output in return is, than when someone tries to ''summarize''; in cases of errors, more information is likely to be beneficial... And another question is related to "ctoken". ctoken in windows version tcl/tk not working why? Is there any another method replacing this in windows version tcl/tk? Could you kindly suggest me. [lv] ctoken is a part of [tclx], not of tcl. After you do a package require Tclx ; does that help any? ----- '''Category: ''' (JULY 30, 2003) How does someone make interactive graphics with Tk? I mean, smooth presentations. Environment of our program is somewhat loaded (many background checks for events), and redrawing of screen leaves it in grey background color for noticeable amount of time. It would be good to at least preserve old picture before draw anything new. What tricks or what methods do you use to achieve smooth Tk graphics performance? [SZ] [lv] by interactive graphics what do you mean? Smooth animation? [SZ] Yes, smooth change of pictures composed of text and images. When we destroyed previous frame with picture and creating new one we get gray (standard background) regions on a screen for a moment. What technique to use to avoid that? [FW]: Try reconfiguring the -file for the image, which (I believe) will redraw it without destroying anything.