init_tk (::quartus::misc)
The following table displays information for the init_tk Tcl command:
Tcl Package and Version |
Belongs to ::quartus::misc 1.0 |
||
Syntax | init_tk [-h | -help] [-long_help] | ||
Arguments | -h | -help | Short help | |
-long_help | Long help with examples and possible return values | ||
Description |
Initializes a Tk window. If you are using Tk functionality in Tcl, you must run this command first before running any Tcl scripts. |
||
Example Usage |
# Initialize the Tk library init_tk # Create a top level and add a title toplevel .top wm title .top "Hello World" # Add widgets button .top.hello -text Hello -command {puts stdout "Hello, World!"} pack .top.hello -padx 20 -pady 10 # Without "tkwait", the script finishes at this point and the # window is destroyed. The "tkwait" command prevents the # script from finishing until the you close the window. tkwait window .top |
||
Return Value | Code Name | Code | String Return |
TCL_OK | 0 | INFO: Operation successful |