next up previous contents
Next: Writing an online manual Up: Creating packages Previous: Loading a package   Contents

Writing a code for the package

The script file you must edit to implement a program is the ''6#6package name5#5.tcl'' file in the scripts directory in the Package Directory (in this example, pkg/foobar1.0/scripts/foobar.tcl).

The script file can be read as:

####################################################
########## foobar.tcl
##########
########## Copyright 2008 Manabu Inuzuka <manabu@example.com>
##########
########## package name:foobar
########## package version:1.0
########## tkDerm version:1.4.0
##########
--some lines are omitted here for saving the space--
namespace eval foobar {

### variable declaration should be here

    namespace export *
}

### init will be executed when your package is selected from package menu.
proc foobar::init {} {

}
--the script is continuing--

  1. The lines commented out at the top of the script reflect the information you gave in the Create Package dialog.
  2. The lines to define a namespace start from the '' namespace eval 6#6package name5#5'' line. You should define variables to be used in the package and export functions here.
  3. The procedure named ''init'' is the one that will be called when you choose the package from the Package menu. You should implement this procedure to make the package do what you want.
  4. The following get_help_text and display_help procedures (not shown here) are the functions that will display the online manual. You need not to edit them. On how to write the online manual, you should read the following section.

tkDerm should have been shipped with some useful packages. Studying them will help you to implement your own package.


next up previous contents
Next: Writing an online manual Up: Creating packages Previous: Loading a package   Contents
manabu 2010-11-14