logo

Noumena Corporation

Whitmore Lake
Michigan

A sample package from Tcl/Tk for Real Programmers that demonstrates a technique for building a Tk megawidget within a namespace.
To use this package, download and unzip, then make these changes to the megaDummy.tcl file.

GLOBAL EDITS

  • ; Replace dummyPkg with name of package
  • ; Global replace dummyNameSpace with namespace identifier.
  • ; Global replace dummyState with the name of a state array.
  • ; Global Replace dummyWidgetProc with widget procedure name.
  • ; Replace megaDummy with widgetName
  • ; Replace dummy with name of widget.
  • ; Replace scroll list fr with real subwidget names.

Insert tk widgets


        ;#v vv vv vv vv vv vv vv vv vv vv vv vv vv vv vv vv vv vv vv vv vv
        ; CREATE THE TK WIDGETS HERE, using whatever settings from cmd line

        # EXAMPLE FOR LABEL:
        # label $f1.l -text $dummyState($f1.text)
        # set dummyState(subWidgetName.label) l
        # pack $f1.l -side left
        
        update ; update idle;

        ;#^ ^^ ^^ ^^ ^^ ^^ ^^ ^^ ^^ ^^ ^^ ^^ ^^ ^^ ^^ ^^ ^^ ^^ ^^ ^^

Get megaDummy.zip