in tk, we classify some of the variables as special variables and they have a predefined usage/functionality. the list of special variables is listed below.
| sr.no. | special variable & description |
|---|---|
| 1 |
tk_library used for setting the location of standard tk libraries. |
| 2 |
tk_patchlevel refers to the current patch level of the tk interpreter. |
| 3 |
tk_strictmotif when non-zero, tk tries to adhere to motif look-and-feel as closely as possible. |
| 4 |
tk_version displays the tk version. |
the above special variables have their special meanings for the tk interpreter.
examples for using tk special variables
lets see the examples for special variables.
tk version
#!/usr/bin/wish puts $tk_version
when you run the program, you will get a similar output as shown below.
8.5
tk library path
#!/usr/bin/wish puts $tk_library
when you run the program, you will get a similar output as shown below.
/library/frameworks/tk.framework/versions/8.6/resources/scripts
tk patch level
#!/usr/bin/wish puts $tk_patchlevel
when you run the program, you will get a similar output as shown below.
8.6.1
tk strictmotif
#!/usr/bin/wish puts $tk_strictmotif
when you run the program, you will get a similar output as shown below.
0