| <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> |
| <html> |
| <head> |
| <title>Tk Intro</title> |
| <link rel="stylesheet" href="style.css"> |
| </head> |
| |
| <body> |
| <? prevnext "<h1>Tk Introduction</h1>" ?> |
| |
| Tk was (and still is) a revolutionary concept - it allows you to |
| quickly and easily create graphical tools, in a semi object oriented |
| fashion. |
| |
| <PRE> |
| <B><FONT COLOR="#A020F0">label</FONT></B> .result -textvariable Result -anchor e |
| <B><FONT COLOR="#A020F0">entry</FONT></B> .input -textvariable Input |
| |
| <B><FONT COLOR="#A020F0">pack</FONT></B> .result -fill both -expand 1 |
| <B><FONT COLOR="#A020F0">pack</FONT></B> .input -fill both -expand 1 |
| |
| <B><FONT COLOR="#A020F0">bind</FONT></B> .input <Return> { |
| <B><FONT COLOR="#A020F0">if</FONT></B> { [<B><FONT COLOR="#A020F0">catch</FONT></B> { |
| <B><FONT COLOR="#A020F0">set</FONT></B> Result [<B><FONT COLOR="#A020F0">expr</FONT></B> $<FONT COLOR="#B8860B">Input</FONT>] |
| } err] } { |
| <B><FONT COLOR="#A020F0">set</FONT></B> Result $<FONT COLOR="#B8860B">err</FONT> |
| } |
| }</PRE> |
| |
| <p align="center"> |
| <img src="calc.png" alt="very simple calculator"> |
| </p> |
| |
| </body> |
| </html> |