tcl problem
Hi all
i am making a program that takes a number and convert it to integer and then use it i do that Quote:
any help?? |
Can you describe your problem in more detail please? I can't tell from looking at it what's wrong with it.
|
ok man
i thought the output will be Quote:
but the output was Quote:
|
Hm, in both Tcl/Tk 8.5 and Tcl/Tk 8.6b1 I see what you expected to see. What version are you using?
|
i don't know but i work on rhel 4
and i have slackware but i don't try it yet |
You are using columnspan 5 for the labels. So they will be stretched over 5 columns. By definition they will be overwritten by the input field which is in column 5.
Code:
grid $labelPath1 -row 1 -column 1 -columnspan 1 BTW, your error descriptions "it doesn't work" and "result is not as expected" are not very helpful. jlinkels |
thanks man
but doesn't columnspan tell me the number of column in a row??? |
Usually columnspan tells how many columns are occupied by an element.
I assume in Tk as many columns are created as needed which is determined from the context. jlinkels |
Thanks man
I have a little question can tcl deal with negative numbers? because i have a problem adding or multiplying with negative numbers |
Yes of course
Code:
% set n -3 jlinkels |
ok man
i will check it again |
it works fine
I have a problem i am making a calculator i made entry and buttons for numbers and functions(add sub log sin cos) the one operand functions worked fine for me i.e i take the data in entry and make function on it (sin cos tan) my problem with the 2 operand function like add and sub i don't know how to make the calculator take the number and clear the entry when entering new data and then make calc when he bush the calc button I only need ideas and i will try to implement it my self :) |
Sorry, can't help you with that. That is not simple knowledge I have, I have to start thinking on that as well, and I don't have the time for that.
jlinkels |
Thanks for the previous help
really i appreciate your help |
For ongoing problems, I suggest trying #tcl on FreeNode or the Tcler's chat (see http://wiki.tcl.tk/1178) -- they're actually joined together so by getting on one you'll be talking on both. I'm on there (via XMPP) as tcv, and most everybody there is quite nice. Also check out the Tcler's Wiki (see http://wiki.tcl.tk/) and the manual pages online (http://www.tcl.tk/man/tcl8.5/).
An important thing to remember with Tcl is that, generally speaking, most things have a string representation. Commands themselves decide how to interpret their inputs. The [expr] command decides to treat things as numbers, and as such it chooses to implement negative numbers as they appear anywhere else. Note that the best syntax to use for [expr] is to enclose the arithmetic in {} like so: set x [expr {-1 + 3 * 2}]. This is more safe for evaluation, less of a chance for variable expansions to throw off the results. |
All times are GMT -5. The time now is 08:24 AM. |