02.03.2014 Views

Tornado

Tornado

Tornado

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

<strong>Tornado</strong> 2.0<br />

User’s Guide<br />

Table 3-2<br />

<strong>Tornado</strong> UI Tcl Extensions Used in Launcher Customization Examples<br />

Tcl Extension<br />

noticePost<br />

menuButtonCreate<br />

Description<br />

Display a popup notice or a file selector.<br />

Add a command to an existing menu.<br />

Re-Reading Tcl Initialization<br />

Because the launcher has no direct command-line access to Tcl, it is not as<br />

convenient as other tools (such as WindSh or CrossWind) for experimentation with<br />

Tcl extensions. The following example makes things a little easier: it adds a<br />

command to the File menu that reloads the .wind/launch.tcl file. This avoids<br />

having to Quit the launcher and invoke it again, every time you change launcher<br />

customization.<br />

Example 3-1<br />

Tcl Reinitialization<br />

# "Reinitialize" command for Launcher.<br />

# Adds item to File menu; calls Tcl "source" primitive directly.<br />

menuButtonCreate File "Re-Read Tcl" T {<br />

source ~/.wind/launch.tcl<br />

}<br />

Quit Launcher Without Prompting<br />

When you select the Quit command from the launcher File menu, the launcher<br />

displays the short form shown in Figure 3-6 to make sure you selected Quit<br />

intentionally.<br />

Figure 3-6<br />

Form: Quit Confirmation<br />

86

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!