From: shags72 on
HI again. I like I have said before am pretty new at writing tcl code
which is the only code I know at this time and I want to write a
simple ap or interface or something like it that does a simple math
equation. I would like it to be an icon to click on and have it bring
up a gui and have some input and a return. I do not know how and I do
know some basic tcl but no tk. Any help would be great and Thanks in
advance.
From: jr4412 on
On Jan 31, 2:10 am, shags72 <je...(a)mtco.com> wrote:
> HI again. I like I have said before am pretty new at writing tcl code
> which is the only code I know at this time and I want to write a
> simple ap or interface or something like it that does a simple math
> equation. I would like it to be an icon to click on and have it bring
> up a gui and have some input and a return. I do not know how and I do
> know some basic tcl but no tk. Any help would be great and Thanks in
> advance.

perhaps you could post some Tcl code excerpts which demonstrate what
"a simple math equation" looks like?
From: Jan Kandziora on
shags72 schrieb:
> I would like it to be an icon to click on
>
That's done by the desktop environment.


> and have it bring up a gui and have some input and a return. I do not know
> how and I do know some basic tcl but no tk.

------------------------------
package require Tk

entry .e
label .l

bind .e <Return> {.l configure -text [expr [.e get]]}

pack .e
pack .l
------------------------------

Now try to understand what it does and how it works.

Kind regards

Jan
From: Robert Heller on
At Sat, 30 Jan 2010 19:35:19 -0800 (PST) jr4412 <jr4412(a)googlemail.com> wrote:

>
> On Jan 31, 2:10=A0am, shags72 <je...(a)mtco.com> wrote:
> > HI again. I like I have said before am pretty new at writing tcl code
> > which is the only code I know at this time and I want to write a
> > simple ap or interface or something like it that does a simple math
> > equation. I would like it to be an icon to click on and have it bring
> > up a gui and have some input and a return. I do not know how and I do
> > know some basic tcl but no tk. Any help would be great and Thanks in
> > advance.
>
> perhaps you could post some Tcl code excerpts which demonstrate what
> "a simple math equation" looks like?

One of the applications in the Model Railroad System in fact implements
'a simple math equation'--Ohm's Law. The 'Resistor' application.

>

--
Robert Heller -- 978-544-6933
Deepwoods Software -- Download the Model Railroad System
http://www.deepsoft.com/ -- Binaries for Linux and MS-Windows
heller(a)deepsoft.com -- http://www.deepsoft.com/ModelRailroadSystem/

From: shags72 on
On Jan 30, 10:38 pm, Robert Heller <hel...(a)deepsoft.com> wrote:
> At Sat, 30 Jan 2010 19:35:19 -0800 (PST) jr4412 <jr4...(a)googlemail.com> wrote:
>
>
>
> > On Jan 31, 2:10=A0am, shags72 <je...(a)mtco.com> wrote:
> > > HI again. I like I have said before am pretty new at writing tcl code
> > > which is the only code I know at this time and I want to write a
> > > simple ap or interface or something like it that does a simple math
> > > equation. I would like it to be an icon to click on and have it bring
> > > up a gui and have some input and a return. I do not know how and I do
> > > know some basic tcl but no tk. Any help would be great and Thanks in
> > > advance.
>
> > perhaps you could post some Tcl code excerpts which demonstrate what
> > "a simple math equation" looks like?
>
> One of the applications in the Model Railroad System in fact implements
> 'a simple math equation'--Ohm's Law.  The 'Resistor' application.
>
>
>
> --
> Robert Heller             -- 978-544-6933
> Deepwoods Software        -- Download the Model Railroad Systemhttp://www.deepsoft.com/ -- Binaries for Linux and MS-Windows
> hel...(a)deepsoft.com       --http://www.deepsoft.com/ModelRailroadSystem/

The formula is

result = round to nearest digit({expr $var/50 + $var2/12 - $var3 of 4
or less/5]

I would have to look at this better to format and get the expr right
but I can figure that out. Just trying to learn how to do this as I
write simple tcl in an embedde system but never get to write anything
with an interface. I like to learn and I thought this would be a good
starting point. Thanks I will download the file you suggested Robert.
 |  Next  |  Last
Pages: 1 2 3
Prev: Changing icon on script
Next: some GPIB-tcl questions