Intel® Quartus® Prime Pro Edition User Guide: Scripting

ID 683432
Date 12/13/2021

A newer version of this document is available. Customers should click here to go to the newest version.

Document Table of Contents init_tk (::quartus::misc)

The following table displays information for the init_tk Tcl command:

Tcl Package and Version

Belongs to ::quartus::misc

Syntax init_tk [-h | -help] [-long_help]
Arguments -h | -help Short help
  -long_help Long help with examples and possible return values

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

# 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