View · Index

Unit 1 / Package Constructor

# We are still in the Tcl namespace ::demo in file note-procs.tcl

  ...

  # The folder_id is an parameter of the Package.  
  # Each time we initialize our package, we want to have the
  # folder id ready. So we extend the basic ::xo::Package class,
  # provide an additional parameter folder_id and create the folder on
  # the fly when necessary.

  Package instproc init {} {
    next
    my folder_id [::demo::Note require_folder  -name demo-note -package_id [my id]]
  }
  ...