![]() |
![]() |
![]() |
![]() |
Example 1 - Create a "Hello World" button widget
Before you begin the examples make sure you have completed "Initial setup" .
In this example you will study a "hello world" button that prints a message when pressed.
source hello.tclthen run the procedure defined within hello.tcl:
hello_example
The file hello.tcl was read into the ModelSim Tcl interpreter. The instructions in the hello_example procedure were then executed by ModelSim, and "Hello World" was printed to the Main transcript (or invoking shell on UNIX). Selecting the button will print the message again.
You've just created your first top-level widget!
- Invoke the hello_example procedure again and notice how the new button replaces the original button. The procedure destroyed the first button and created the new one. Get a closer look at the source Tcl file with the notepad:
notepad hello.tcl
![]() Model Technology Incorporated Voice: (503) 641-1340 Fax: (503)526-5410 www.model.com sales@model.com |
![]() |
![]() |
![]() |
![]() |