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 />

entries to the File menu. Of these two new entries, Open calls launchFileOpen,<br />

which in turn calls launchEdit if the user selects a file to open.<br />

Example 3-3<br />

Open Command and Customized File Menu Initialization<br />

#############################################################################<br />

#<br />

#<br />

# launchExtInit - collects personal launcher initialization<br />

#<br />

# This routine is invoked when the launcher begins executing, and collects<br />

# all the initialization (other than global and proc definitions)<br />

# defined in this file.<br />

#<br />

# SYNOPSIS:<br />

# launchExtInit<br />

#<br />

# RETURNS: N/A<br />

#<br />

# ERRORS: N/A<br />

#<br />

proc launchExtInit {} {<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 />

# Add "Open" command to File menu<br />

}<br />

menuButtonCreate File "Open..." O {<br />

launchFileOpen<br />

;# defined in launch.tcl<br />

}<br />

#############################################################################<br />

#<br />

#<br />

# launchFileOpen - called from File menu to run an editor on an arbitrary<br />

file<br />

#<br />

# This routine supports an Open command added to the File menu. It prompts<br />

# the user for a filename; if the user selects one, it calls launchEdit to<br />

# edit the file.<br />

#<br />

# SYNOPSIS:<br />

# launchFileOpen<br />

#<br />

# RETURNS: N/A<br />

88

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

Saved successfully!

Ooh no, something went wrong!