Blame examples/tclexample.tcl

Packit Service 50c9f2
## \file tclexample.tcl
Packit Service 50c9f2
# File documentation.
Packit Service 50c9f2
#\verbatim
Packit Service 50c9f2
Packit Service 50c9f2
# Startup code:\
Packit Service 50c9f2
exec tclsh "$0" "$@"
Packit Service 50c9f2
#\endverbatim
Packit Service 50c9f2
## Documented namespace \c ns .
Packit Service 50c9f2
# The code is inserted here:
Packit Service 50c9f2
#\code
Packit Service 50c9f2
namespace eval ns {
Packit Service 50c9f2
  ## Documented proc \c ns_proc .
Packit Service 50c9f2
  # param[in] arg some argument
Packit Service 50c9f2
  proc ns_proc {arg} {}
Packit Service 50c9f2
  ## Documented var \c ns_var .
Packit Service 50c9f2
  # Some documentation.
Packit Service 50c9f2
  variable ns_var
Packit Service 50c9f2
  ## Documented itcl class \c itcl_class .
Packit Service 50c9f2
  itcl::class itcl_class {
Packit Service 50c9f2
    ## Create object.
Packit Service 50c9f2
    constructor {args} {eval $args}
Packit Service 50c9f2
    ## Destroy object.
Packit Service 50c9f2
    destructor {exit}
Packit Service 50c9f2
    ## Documented itcl method \c itcl_method_x .
Packit Service 50c9f2
    # param[in] arg Argument
Packit Service 50c9f2
    private method itcl_method_x {arg}
Packit Service 50c9f2
    ## Documented itcl method \c itcl_method_y .
Packit Service 50c9f2
    # param[in] arg Argument
Packit Service 50c9f2
    protected method itcl_method_y {arg} {}
Packit Service 50c9f2
    ## Documented itcl method \c itcl_method_z .
Packit Service 50c9f2
    # param[in] arg Argument
Packit Service 50c9f2
    public method itcl_method_z {arg} {}
Packit Service 50c9f2
    ## Documented common itcl var \c itcl_Var .
Packit Service 50c9f2
    common itcl_Var
Packit Service 50c9f2
    ## \protectedsection
Packit Service 50c9f2
    
Packit Service 50c9f2
    variable itcl_var1;#< Documented itcl var \c itcl_var1 .
Packit Service 50c9f2
    variable itcl_var2;#< Documented itcl var \c itcl_var2 .
Packit Service 50c9f2
  }
Packit Service 50c9f2
  ## Documented oo class \c oo_class .
Packit Service 50c9f2
  oo::class create oo_class {
Packit Service 50c9f2
    ## Create object.
Packit Service 50c9f2
    # Configure with args
Packit Service 50c9f2
    constructor {args} {eval $args}
Packit Service 50c9f2
    ## Destroy object.
Packit Service 50c9f2
    # Exit.
Packit Service 50c9f2
    destructor {exit}
Packit Service 50c9f2
    ## Documented oo var \c oo_var .
Packit Service 50c9f2
    # Defined inside class
Packit Service 50c9f2
    variable oo_var
Packit Service 50c9f2
    ## \private Documented oo method \c oo_method_x .
Packit Service 50c9f2
    # param[in] arg Argument
Packit Service 50c9f2
    method oo_method_x {arg} {}
Packit Service 50c9f2
    ## \protected Documented oo method \c oo_method_y .
Packit Service 50c9f2
    # param[in] arg Argument
Packit Service 50c9f2
    method oo_method_y {arg} {}
Packit Service 50c9f2
    ## \public Documented oo method \c oo_method_z .
Packit Service 50c9f2
    # param[in] arg Argument
Packit Service 50c9f2
    method oo_method_z {arg} {}
Packit Service 50c9f2
  }
Packit Service 50c9f2
}
Packit Service 50c9f2
#\endcode
Packit Service 50c9f2
Packit Service 50c9f2
itcl::body ::ns::itcl_class::itcl_method_x {argx} {
Packit Service 50c9f2
  puts "$argx OK"
Packit Service 50c9f2
}
Packit Service 50c9f2
Packit Service 50c9f2
oo::define ns::oo_class {
Packit Service 50c9f2
  ## \public Outside defined variable \c oo_var_out .
Packit Service 50c9f2
  # Inside oo_class
Packit Service 50c9f2
  variable oo_var_out
Packit Service 50c9f2
}
Packit Service 50c9f2
Packit Service 50c9f2
## Documented global proc \c glob_proc .
Packit Service 50c9f2
# param[in] arg Argument
Packit Service 50c9f2
proc glob_proc {arg} {puts $arg}
Packit Service 50c9f2
Packit Service 50c9f2
variable glob_var;#< Documented global var \c glob_var\
Packit Service 50c9f2
  with newline
Packit Service 50c9f2
#< and continued line
Packit Service 50c9f2
Packit Service 50c9f2
# end of file