Error processing request

Parameters

CONTENT_LENGTH0
REQUEST_METHODGET
REQUEST_URI/revision/Show+me+an+example?V=47
QUERY_STRINGV=47
CONTENT_TYPE
DOCUMENT_URI/revision/Show+me+an+example
DOCUMENT_ROOT/var/www/nikit/nikit/nginx/../docroot
SCGI1
SERVER_PROTOCOLHTTP/1.1
HTTPSon
REMOTE_ADDR172.70.38.174
REMOTE_PORT9914
SERVER_PORT4443
SERVER_NAMEwiki.tcl-lang.org
HTTP_HOSTwiki.tcl-lang.org
HTTP_CONNECTIONKeep-Alive
HTTP_ACCEPT_ENCODINGgzip, br
HTTP_X_FORWARDED_FOR100.26.35.111
HTTP_CF_RAY86ba1fb15c17082b-IAD
HTTP_X_FORWARDED_PROTOhttps
HTTP_CF_VISITOR{"scheme":"https"}
HTTP_ACCEPT*/*
HTTP_USER_AGENTclaudebot
HTTP_CF_CONNECTING_IP100.26.35.111
HTTP_CDN_LOOPcloudflare
HTTP_CF_IPCOUNTRYUS

Body


Error

Unknow state transition: LINE -> END

-code

1

-level

0

-errorstack

INNER {returnImm {Unknow state transition: LINE -> END} {}} CALL {my render_wikit {Show me an example} '''Show\ me\ an\ Example'''\ is\ a\ step-by-step\ guide\ to\ \[Beginning\ Tcl%|%getting\nstarted\]\ with\ \[Tcl\].\n\n\n\n**\ Hello,\ World!\ **\n\nThere\ are\ two\ ways\ to\ experiment\ with\ Tcl.\ One\ can\ either\ take\ \[An\ Interactive\nApproach\ to\ Experimenting\ with\ Tcl\],\ or\ one\ can\ write\ their\ Tcl\ scripts\ into\ntext\ files\ and\ ask\ a\ \[Tcl\]\ \[interpreter\]\ to\ execute\ them,\ which\ is\ what\ this\nintroduction\ describes.\n\nThe\ canonical\ first\ program\ (according\ to\ \[Brian\ Kernighan\]\ and\ \[Dennis\nRitchie\],\ creators\ of\ the\ \[C\]\ language)\ simply\ prints\ the\ message\ \"hello,\nworld\".\ \ In\ Tcl,\ this\ program\ is:\n\n======\n#!\ /bin/env\ tclsh\n\nputs\ \{hello,\ world\}\n======\n\nUsing\ your\ favorite\ text\ editor,\ save\ the\ example\ above\ to\ a\ file\ named\n\"hello.tcl\".\n\nThe\ next\ step\ is\ to\ use\ the\ Tcl\ shell\ to\ interpret\ your\ program.\ \ Depending\ on\nyour\ operating\ system,\ the\ particular\ version\ installation,\ etc.\ your\ Tcl\ shell\ncould\ be\ named\ '\[tclsh\]',\ 'tclsh8.3',\ or\ some\ other\ numbered\ variant.\n\nIf\ you\ are\ a\ \[Microsoft\ Windows\]\ user,\ running\ a\ scripts\ is\ a\ little\ more\ncomplicated.\ \ Windows\ distinguishes\ between\ \"console\"\ applications,\ which\ run\nin\ a\ terminal\ window\ environment,\ and\ \"windows\"\ applications,\ which\ have\ a\n\[GUI\].\ \ The\ default\ Tcl/Tk\ installation\ on\ Windows\ runs\ all\ '''.tcl'''\ files\ in\nthe\ \[wish\]\ shell,\ as\ a\ graphical\ application.\ \ Just\ put\ the\ file\ on\ the\ desktop\nor\ find\ it\ in\ the\ explorer\ and\ click\ on\ it.\ \ But\ since\ our\ simple\ script\ndoesn't\ create\ any\ windows,\ and\ it\ isn't\ clear\ where\ the\ words\ \"hello,\ world\"\nwould\ go,\ this\ program\ won't\ appear\ to\ do\ too\ much.\ \ You\ can\ run\ this\ program\nby\ starting\ \[tclsh\]\ from\ the\ ''start''\ menu,\ then\ typing\ the\ command\ `source\nc:/hello.tcl`.\ \ Note\ that\ the\ traditional\ Windows\ `\\`\ is\ replaced\ with\ `/`.\n\n\[RS\]:\ Another\ possibility\ on\ Windows:\ add\ the\ line\n\n======\ncatch\ \{console\ show\}\n======\n\nto\ your\ script.\ This\ will\ open\ a\ console\ window\ which\ displays\ `hello\ world`,\neven\ if\ you\ just\ double-click\ the\ hello.tcl\ file.\n\n\nFor\ this\ example,\ we\ will\ assume\ the\ name\ of\ the\ interpreter\ is\ \[tclsh\].\ \ From\na\ command\ line,\ type\n\n======none\ntclsh\ hello.tcl\n======\n\n,\ and\ you\ should\ see\ the\ message:\n\n======\nhello,\ world\n======\n\nThe\ program\ you\ just\ ran\ was\ a\ complete\ Tcl\ script,\ comprised\ of\ one\ command,\n`\[puts\]`,\ and\ one\ word,\ `hello\ world`.\ \ Like\ English,\ Tcl\ normally\ separates\nwords\ by\ looking\ for\ the\ whitespace\ between\ them,\ but\ the\ braces\ around\ `hello,\nworld`\ tell\ Tcl\ that\ it\ is\ a\ single\ value,\ including\ the\ whitespace.\ \ Unlike\nEnglish,\ in\ Tcl\ any\ single\ value\ is\ referred\ to\ as\ a\ '''word'''.\ \n\nThe\ first\ word\ of\ each\ command\ is\ the\ name\ of\ the\ command,\ and\ any\ additional\nwords\ are\ the\ values\ that\ Tcl\ passes\ to\ the\ command\ when\ invoking\ it.\ \ These\nadditional\ words\ are\ called\ '''arguments'''.\ \ `\[puts\]`\ accepts\ either\ one\ or\ntwo\ arguments,\ and\ in\ the\ script\ above,\ there\ was\ only\ one:\ `hello\ world`.\n\nA\ Tcl\ script\ is\ nothing\ more\ than\ a\ a\ sequence\ of\ \[Tcl\ commands\].\ \ To\ interpret\na\ script,\ Tcl\ reads\ the\ text\ of\ each\ command,\ looks\ up\ the\ command\ by\ the\ first\nword\ in\ the\ text,\ prepares\ the\ arguments\ to\ the\ command\ as\ described\ by\ any\nother\ words\ in\ the\ text,\ and\ invokes\ the\ command,\ passing\ it\ the\ prepared\narguments.\n\nA\ word\ can\ be\ assigned\ to\ a\ \[variable\],\ which\ can\ then\ be\ used\ in\ place\ of\ the\nliteral\ word:\n\n======\nset\ greeting\ hello\nputs\ \$greeting\n\nset\ addressee\ world\nputs\ \"\$greeting,\ \$addressee\"\n======\n\nThe\ result\ is\n\n======none\nhello\nhello,\ world\n======\n\n\n`\$greeting`\ and\ `\$addressee`\ are\ both\ variables.\ \ The\ first\ word\ to\ `\[set\]`\ is\nthe\ name\ of\ a\ variable,\ and\ the\ second\ word\ is\ the\ value\ to\ assign\ to\ that\nname.\ \ `\$`\ tells\ Tcl\ to\ retrieve\ the\ value\ out\ of\ some\ variable\ and\ substitute\nthat\ value\ into\ the\ place\ of\ the\ variable.\ \ The\ double\ quotes,\ like\ the\nbraces\ in\ the\ previous\ example,\ tell\ Tcl\ that\ `\$greeting,\ \$addressee`\ is\ a\nsingle\ word\ to\ be\ given\ to\ `\[puts\]`.\ \ Between\ double\ quotes,\ `\$`\ tells\ Tcl\ to\ndo\ variable\ substitution,\ but\ between\ braces,\ `\$`\ is\ not\ special.\ \ It's\ just\n`\$`.\n\nBefore\ it\ called\ `\[set\]`,\ Tcl\ substituted\ `\$greeting`\ with\ `hello`\ and\n`\$addressee`\ with\ `world`.\n\nTo\ subsitute\ a\ variable,\ Tcl\ takes\ the\ sequence\ of\ alpha-numeric\ characters\ and\nunderscores\ immediately\ following\ `\$`.\ \ The\ comma\ after\ `\$greeting`\ is\ not\ an\nalpha-numeric\ character\ or\ underscore,\ so\ Tcl\ knew\ where\ the\ end\ of\ the\nvariable\ name\ was.\ \ Because\ `\$`\ is\ also\ not\ an\ alpha-numeric\ character,\nvariables\ can\ be\ \"smashed\ together\".\ \ `\$hello\$world`\ would\ result\ in\n`greetingworld`.\n\nAnother\ way\ to\ specify\ the\ variable\ name\ is\ to\ put\ it\ in\ braces:\n\n======\nset\ ->\ world\nputs\ \$greeting,\$\{->\}\n======\n\nThe\ result\ is\n\n======\nhello,world\n======\n\nIt's\ a\ good\ idea\ to\ give\ variables\ understandable\ names,\ but\ as\ the\ example\nabove\ illustrates,\ there's\ nothing\ stopping\ you\ from\ naming\ a\ variable\nsomething\ odd,\ like\ `->`.\ \ There\ were\ no\ double\ quotes\ or\ braces\ around\n`\$greeting,\$\{->\}`\ because\ it\ didn't\ have\ any\ spaces\ in\ it,\ so\ there\ was\ no\ need\nto\ do\ anything\ special\ to\ tell\ Tcl\ that\ it\ was\ a\ single\ value.\n\n\n\n======\n\nThe\ result\ is\n\n======none\nhello\nhello,\ world\n======\n\n\n`\n**\ Hello,\ World:\ the\ GUI\ Version\ **\n\nOne\ of\ the\ greatest\ things\ about\ Tcl\ is\ that\ you\ also\ get\ to\ use\ \[Tk\].\ \ The\n\"hello\ world\"\ program\ for\ Tk\ is\ almost\ as\ simple.\ \ We\ just\ have\ to\ define\ a\ncommand\ button\ which\ will\ perform\ the\ printing\ action,\ then\ use\ one\ of\ the\ngeometry\ managers\ to\ position\ it\ on\ the\ screen.\ \ The\ program\ looks\ like\ this:\n\n======\n#!\ /bin/env\ tclsh\npackage\ require\ Tk\nbutton\ .b\ -text\ \{Push\ Me\}\ -command\ \{tk_messageBox\ -message\ \{hello,\ world\}\}\npack\ .b\n======\n\nAnd\ you\ run\ it\ using\ either\ \[tclsh\]\ or\ \[wish\].\ \ (Windows\ users\ can\ just\ double\nclick\ on\ the\ file.)\n\nThe\ first\ line\ of\ your\ program\ creates\ a\ pushbutton\ named\ `.b`\ with\ the\ label,\n`Push\ Me`.\ \ Instead\ of\ our\ favorite\ `puts`\ command,\ we\ create\ a\ Tk\n\[messageBox\],which\ is\ a\ modal\ \[dialog\],\ with\ our\ message.\ \ The\ second\ line\ninstructs\ the\ `\[pack\]`\ \[geometry\ manager\]\ to\ display\ your\ pushbutton.\n\n`\[button\]`\ \[return%|%returns\]\ the\ name\ of\ the\ button\ \[widget\]\ that\ it\ creates,\n`.b`\ in\ this\ case.\ This\ allows\ us\ to\ kill\ two\ birds\ with\ one\ stone:\n\n======\n#!\ /bin/env\ Tclsh\npackage\ require\ Tk\npack\ \[button\ .b\ -text\ \{Push\ Me\}\ -command\ \{\n\ \ \ \ tk_messageBox\ -message\ \{hello,\ world\}\n\}\]\n======\n\n\n**\ Hello,\ Windows!\ **\n\nIf\ you're\ feeling\ really\ ambitious,\ with\ less\ than\ two\ dozen\ lines\ of\ Tcl/Tk\ncode\ you\ can\ emulate\ the\ hello\ sample\ from\ the\ Microsoft\ Foundation\ Class,\nincluding\ comments\ and\ white\ space!\n\n======\n#!\ /bin/env\ tclsh\npackage\ require\ Tk\n#\ \ Create\ the\ main\ message\ window\nmessage\ .m\ -text\ \{Hello\ Tcl!\}\ -background\ white\npack\ .m\ -expand\ true\ -fill\ both\ -ipadx\ 100\ -ipady\ 40\n\n#\ \ Create\ the\ main\ menu\ bar\ with\ a\ Help-About\ entry\nmenu\ .menubar\nmenu\ .menubar.help\ -tearoff\ 0\n.menubar\ add\ cascade\ -label\ Help\ -menu\ .menubar.help\ -underline\ 0\n.menubar.help\ add\ command\ -label\ \{About\ Hello\ ...\}\ \\\n\ \ \ \ -accelerator\ F1\ -underline\ 0\ -command\ showAbout\n\n#\ \ Define\ a\ procedure\ -\ an\ action\ for\ Help-About\nproc\ showAbout\ \{\}\ \{\n\ \ \ \ tk_messageBox\ -message\ \"Tcl/Tk\\nHello\ Windows\\nVersion\ 1.0\"\ \\\n\ \ \ \ \ \ \ \ -title\ \{About\ Hello\}\n\}\n\n#\ \ Configure\ the\ main\ window\ \nwm\ title\ .\ \{Hello\ Foundation\ Application\}\n.\ configure\ -menu\ .menubar\ -width\ 200\ -height\ 150\nbind\ .\ \{<Key\ F1>\}\ \{showAbout\}\n======\n\nThis\ industrial\ strength\ GUI\ sample,\ including\ a\ popup\ dialog\ and\ a\ menu\naccelerator,\ is\ implemented\ in\ something\ like\ 250\ lines\ of\ Win32\ C++\ code\ and\nresource\ files.\ \ The\ advantage\ to\ Tcl/Tk\ commands\ is,\ of\ course,\ that\ it\ also\nruns\ on\ UNIX\ (and\ maybe\ even\ on\ a\ Mac).\n\n\[jcw\]:\ \ Yes,\ the\ Mac\ version\ works\ (but\ not\ F1,\ and\ the\ message\ box\ icon\ I\ see\nin\ the\ about\ box\ is\ weird\ -\ I'm\ using\ my\ own\ build\ of\ TclKit\ on\ Mac\n\nrlb:\ Using\ Mac\ OS\ X\ and\ wish,\ F1\ works\ in\ combination\ with\ fn\ key\ for\ me.\n\n\[pps\]:\ \ This\ is\ obvously\ on\ a\ laptop(iBook).\ It\ works\ with\ F1\ on\ my\ Mac\ G4\ B&W.\nWhat\ Wish\ seems\ not\ to\ accept\ on\ MacOSX\ is\ a\ paste\ from\ a\ clipboard\ with\nCopyPaste\ installed\ (it\ just\ writes\ v\ after\ cmd-v).\ I\ have\ to\ type\ the\ commands\n(or\ quit\ CopyPaste).\n\n\n\n**\ Misc\ **\n\n\[escargo\]\ 2005-08-08:\ \ If\ you\ want\ a\ script\ that\ runs\ like\ a\ program\ on\n\[Windows\]\ you\ should\ look\ at\ \[DOS\ BAT\ magic\]\ or\ you\ want\ it\ to\ run\ on\ \[Linux\]\nor\ \[Unix\]\ you\ should\ look\ at\ \[exec\ magic\].\n\n\[RS\]:\ On\ Windows,\ installing\ \[ActiveTcl\]\ usually\ also\ associates\ the\ extension\n.tcl\ to\ running\ wish\ with\ it,\ so\ scripts\ can\ run\ by\ just\ double-clicking\ them.\n\[escargo\]:\ And\ using\ \[ActiveTcl\]\ is\ the\ ''suggested''\ way....\n\n\n\n**\ See\ also\ **\n\n\ \ \ \[Beginning\ Tcl\]:\ \ \ \n\n\n\ \ \ \[The\ Hello\ World\ program\ as\ implemented\ in\ Tcl/Tk\]:\ \ \ \n\n\n<<categories>>\ Beginning\ Tcl\ |\ Tutorial regexp2} CALL {my render {Show me an example} '''Show\ me\ an\ Example'''\ is\ a\ step-by-step\ guide\ to\ \[Beginning\ Tcl%|%getting\nstarted\]\ with\ \[Tcl\].\n\n\n\n**\ Hello,\ World!\ **\n\nThere\ are\ two\ ways\ to\ experiment\ with\ Tcl.\ One\ can\ either\ take\ \[An\ Interactive\nApproach\ to\ Experimenting\ with\ Tcl\],\ or\ one\ can\ write\ their\ Tcl\ scripts\ into\ntext\ files\ and\ ask\ a\ \[Tcl\]\ \[interpreter\]\ to\ execute\ them,\ which\ is\ what\ this\nintroduction\ describes.\n\nThe\ canonical\ first\ program\ (according\ to\ \[Brian\ Kernighan\]\ and\ \[Dennis\nRitchie\],\ creators\ of\ the\ \[C\]\ language)\ simply\ prints\ the\ message\ \"hello,\nworld\".\ \ In\ Tcl,\ this\ program\ is:\n\n======\n#!\ /bin/env\ tclsh\n\nputs\ \{hello,\ world\}\n======\n\nUsing\ your\ favorite\ text\ editor,\ save\ the\ example\ above\ to\ a\ file\ named\n\"hello.tcl\".\n\nThe\ next\ step\ is\ to\ use\ the\ Tcl\ shell\ to\ interpret\ your\ program.\ \ Depending\ on\nyour\ operating\ system,\ the\ particular\ version\ installation,\ etc.\ your\ Tcl\ shell\ncould\ be\ named\ '\[tclsh\]',\ 'tclsh8.3',\ or\ some\ other\ numbered\ variant.\n\nIf\ you\ are\ a\ \[Microsoft\ Windows\]\ user,\ running\ a\ scripts\ is\ a\ little\ more\ncomplicated.\ \ Windows\ distinguishes\ between\ \"console\"\ applications,\ which\ run\nin\ a\ terminal\ window\ environment,\ and\ \"windows\"\ applications,\ which\ have\ a\n\[GUI\].\ \ The\ default\ Tcl/Tk\ installation\ on\ Windows\ runs\ all\ '''.tcl'''\ files\ in\nthe\ \[wish\]\ shell,\ as\ a\ graphical\ application.\ \ Just\ put\ the\ file\ on\ the\ desktop\nor\ find\ it\ in\ the\ explorer\ and\ click\ on\ it.\ \ But\ since\ our\ simple\ script\ndoesn't\ create\ any\ windows,\ and\ it\ isn't\ clear\ where\ the\ words\ \"hello,\ world\"\nwould\ go,\ this\ program\ won't\ appear\ to\ do\ too\ much.\ \ You\ can\ run\ this\ program\nby\ starting\ \[tclsh\]\ from\ the\ ''start''\ menu,\ then\ typing\ the\ command\ `source\nc:/hello.tcl`.\ \ Note\ that\ the\ traditional\ Windows\ `\\`\ is\ replaced\ with\ `/`.\n\n\[RS\]:\ Another\ possibility\ on\ Windows:\ add\ the\ line\n\n======\ncatch\ \{console\ show\}\n======\n\nto\ your\ script.\ This\ will\ open\ a\ console\ window\ which\ displays\ `hello\ world`,\neven\ if\ you\ just\ double-click\ the\ hello.tcl\ file.\n\n\nFor\ this\ example,\ we\ will\ assume\ the\ name\ of\ the\ interpreter\ is\ \[tclsh\].\ \ From\na\ command\ line,\ type\n\n======none\ntclsh\ hello.tcl\n======\n\n,\ and\ you\ should\ see\ the\ message:\n\n======\nhello,\ world\n======\n\nThe\ program\ you\ just\ ran\ was\ a\ complete\ Tcl\ script,\ comprised\ of\ one\ command,\n`\[puts\]`,\ and\ one\ word,\ `hello\ world`.\ \ Like\ English,\ Tcl\ normally\ separates\nwords\ by\ looking\ for\ the\ whitespace\ between\ them,\ but\ the\ braces\ around\ `hello,\nworld`\ tell\ Tcl\ that\ it\ is\ a\ single\ value,\ including\ the\ whitespace.\ \ Unlike\nEnglish,\ in\ Tcl\ any\ single\ value\ is\ referred\ to\ as\ a\ '''word'''.\ \n\nThe\ first\ word\ of\ each\ command\ is\ the\ name\ of\ the\ command,\ and\ any\ additional\nwords\ are\ the\ values\ that\ Tcl\ passes\ to\ the\ command\ when\ invoking\ it.\ \ These\nadditional\ words\ are\ called\ '''arguments'''.\ \ `\[puts\]`\ accepts\ either\ one\ or\ntwo\ arguments,\ and\ in\ the\ script\ above,\ there\ was\ only\ one:\ `hello\ world`.\n\nA\ Tcl\ script\ is\ nothing\ more\ than\ a\ a\ sequence\ of\ \[Tcl\ commands\].\ \ To\ interpret\na\ script,\ Tcl\ reads\ the\ text\ of\ each\ command,\ looks\ up\ the\ command\ by\ the\ first\nword\ in\ the\ text,\ prepares\ the\ arguments\ to\ the\ command\ as\ described\ by\ any\nother\ words\ in\ the\ text,\ and\ invokes\ the\ command,\ passing\ it\ the\ prepared\narguments.\n\nA\ word\ can\ be\ assigned\ to\ a\ \[variable\],\ which\ can\ then\ be\ used\ in\ place\ of\ the\nliteral\ word:\n\n======\nset\ greeting\ hello\nputs\ \$greeting\n\nset\ addressee\ world\nputs\ \"\$greeting,\ \$addressee\"\n======\n\nThe\ result\ is\n\n======none\nhello\nhello,\ world\n======\n\n\n`\$greeting`\ and\ `\$addressee`\ are\ both\ variables.\ \ The\ first\ word\ to\ `\[set\]`\ is\nthe\ name\ of\ a\ variable,\ and\ the\ second\ word\ is\ the\ value\ to\ assign\ to\ that\nname.\ \ `\$`\ tells\ Tcl\ to\ retrieve\ the\ value\ out\ of\ some\ variable\ and\ substitute\nthat\ value\ into\ the\ place\ of\ the\ variable.\ \ The\ double\ quotes,\ like\ the\nbraces\ in\ the\ previous\ example,\ tell\ Tcl\ that\ `\$greeting,\ \$addressee`\ is\ a\nsingle\ word\ to\ be\ given\ to\ `\[puts\]`.\ \ Between\ double\ quotes,\ `\$`\ tells\ Tcl\ to\ndo\ variable\ substitution,\ but\ between\ braces,\ `\$`\ is\ not\ special.\ \ It's\ just\n`\$`.\n\nBefore\ it\ called\ `\[set\]`,\ Tcl\ substituted\ `\$greeting`\ with\ `hello`\ and\n`\$addressee`\ with\ `world`.\n\nTo\ subsitute\ a\ variable,\ Tcl\ takes\ the\ sequence\ of\ alpha-numeric\ characters\ and\nunderscores\ immediately\ following\ `\$`.\ \ The\ comma\ after\ `\$greeting`\ is\ not\ an\nalpha-numeric\ character\ or\ underscore,\ so\ Tcl\ knew\ where\ the\ end\ of\ the\nvariable\ name\ was.\ \ Because\ `\$`\ is\ also\ not\ an\ alpha-numeric\ character,\nvariables\ can\ be\ \"smashed\ together\".\ \ `\$hello\$world`\ would\ result\ in\n`greetingworld`.\n\nAnother\ way\ to\ specify\ the\ variable\ name\ is\ to\ put\ it\ in\ braces:\n\n======\nset\ ->\ world\nputs\ \$greeting,\$\{->\}\n======\n\nThe\ result\ is\n\n======\nhello,world\n======\n\nIt's\ a\ good\ idea\ to\ give\ variables\ understandable\ names,\ but\ as\ the\ example\nabove\ illustrates,\ there's\ nothing\ stopping\ you\ from\ naming\ a\ variable\nsomething\ odd,\ like\ `->`.\ \ There\ were\ no\ double\ quotes\ or\ braces\ around\n`\$greeting,\$\{->\}`\ because\ it\ didn't\ have\ any\ spaces\ in\ it,\ so\ there\ was\ no\ need\nto\ do\ anything\ special\ to\ tell\ Tcl\ that\ it\ was\ a\ single\ value.\n\n\n\n======\n\nThe\ result\ is\n\n======none\nhello\nhello,\ world\n======\n\n\n`\n**\ Hello,\ World:\ the\ GUI\ Version\ **\n\nOne\ of\ the\ greatest\ things\ about\ Tcl\ is\ that\ you\ also\ get\ to\ use\ \[Tk\].\ \ The\n\"hello\ world\"\ program\ for\ Tk\ is\ almost\ as\ simple.\ \ We\ just\ have\ to\ define\ a\ncommand\ button\ which\ will\ perform\ the\ printing\ action,\ then\ use\ one\ of\ the\ngeometry\ managers\ to\ position\ it\ on\ the\ screen.\ \ The\ program\ looks\ like\ this:\n\n======\n#!\ /bin/env\ tclsh\npackage\ require\ Tk\nbutton\ .b\ -text\ \{Push\ Me\}\ -command\ \{tk_messageBox\ -message\ \{hello,\ world\}\}\npack\ .b\n======\n\nAnd\ you\ run\ it\ using\ either\ \[tclsh\]\ or\ \[wish\].\ \ (Windows\ users\ can\ just\ double\nclick\ on\ the\ file.)\n\nThe\ first\ line\ of\ your\ program\ creates\ a\ pushbutton\ named\ `.b`\ with\ the\ label,\n`Push\ Me`.\ \ Instead\ of\ our\ favorite\ `puts`\ command,\ we\ create\ a\ Tk\n\[messageBox\],which\ is\ a\ modal\ \[dialog\],\ with\ our\ message.\ \ The\ second\ line\ninstructs\ the\ `\[pack\]`\ \[geometry\ manager\]\ to\ display\ your\ pushbutton.\n\n`\[button\]`\ \[return%|%returns\]\ the\ name\ of\ the\ button\ \[widget\]\ that\ it\ creates,\n`.b`\ in\ this\ case.\ This\ allows\ us\ to\ kill\ two\ birds\ with\ one\ stone:\n\n======\n#!\ /bin/env\ Tclsh\npackage\ require\ Tk\npack\ \[button\ .b\ -text\ \{Push\ Me\}\ -command\ \{\n\ \ \ \ tk_messageBox\ -message\ \{hello,\ world\}\n\}\]\n======\n\n\n**\ Hello,\ Windows!\ **\n\nIf\ you're\ feeling\ really\ ambitious,\ with\ less\ than\ two\ dozen\ lines\ of\ Tcl/Tk\ncode\ you\ can\ emulate\ the\ hello\ sample\ from\ the\ Microsoft\ Foundation\ Class,\nincluding\ comments\ and\ white\ space!\n\n======\n#!\ /bin/env\ tclsh\npackage\ require\ Tk\n#\ \ Create\ the\ main\ message\ window\nmessage\ .m\ -text\ \{Hello\ Tcl!\}\ -background\ white\npack\ .m\ -expand\ true\ -fill\ both\ -ipadx\ 100\ -ipady\ 40\n\n#\ \ Create\ the\ main\ menu\ bar\ with\ a\ Help-About\ entry\nmenu\ .menubar\nmenu\ .menubar.help\ -tearoff\ 0\n.menubar\ add\ cascade\ -label\ Help\ -menu\ .menubar.help\ -underline\ 0\n.menubar.help\ add\ command\ -label\ \{About\ Hello\ ...\}\ \\\n\ \ \ \ -accelerator\ F1\ -underline\ 0\ -command\ showAbout\n\n#\ \ Define\ a\ procedure\ -\ an\ action\ for\ Help-About\nproc\ showAbout\ \{\}\ \{\n\ \ \ \ tk_messageBox\ -message\ \"Tcl/Tk\\nHello\ Windows\\nVersion\ 1.0\"\ \\\n\ \ \ \ \ \ \ \ -title\ \{About\ Hello\}\n\}\n\n#\ \ Configure\ the\ main\ window\ \nwm\ title\ .\ \{Hello\ Foundation\ Application\}\n.\ configure\ -menu\ .menubar\ -width\ 200\ -height\ 150\nbind\ .\ \{<Key\ F1>\}\ \{showAbout\}\n======\n\nThis\ industrial\ strength\ GUI\ sample,\ including\ a\ popup\ dialog\ and\ a\ menu\naccelerator,\ is\ implemented\ in\ something\ like\ 250\ lines\ of\ Win32\ C++\ code\ and\nresource\ files.\ \ The\ advantage\ to\ Tcl/Tk\ commands\ is,\ of\ course,\ that\ it\ also\nruns\ on\ UNIX\ (and\ maybe\ even\ on\ a\ Mac).\n\n\[jcw\]:\ \ Yes,\ the\ Mac\ version\ works\ (but\ not\ F1,\ and\ the\ message\ box\ icon\ I\ see\nin\ the\ about\ box\ is\ weird\ -\ I'm\ using\ my\ own\ build\ of\ TclKit\ on\ Mac\n\nrlb:\ Using\ Mac\ OS\ X\ and\ wish,\ F1\ works\ in\ combination\ with\ fn\ key\ for\ me.\n\n\[pps\]:\ \ This\ is\ obvously\ on\ a\ laptop(iBook).\ It\ works\ with\ F1\ on\ my\ Mac\ G4\ B&W.\nWhat\ Wish\ seems\ not\ to\ accept\ on\ MacOSX\ is\ a\ paste\ from\ a\ clipboard\ with\nCopyPaste\ installed\ (it\ just\ writes\ v\ after\ cmd-v).\ I\ have\ to\ type\ the\ commands\n(or\ quit\ CopyPaste).\n\n\n\n**\ Misc\ **\n\n\[escargo\]\ 2005-08-08:\ \ If\ you\ want\ a\ script\ that\ runs\ like\ a\ program\ on\n\[Windows\]\ you\ should\ look\ at\ \[DOS\ BAT\ magic\]\ or\ you\ want\ it\ to\ run\ on\ \[Linux\]\nor\ \[Unix\]\ you\ should\ look\ at\ \[exec\ magic\].\n\n\[RS\]:\ On\ Windows,\ installing\ \[ActiveTcl\]\ usually\ also\ associates\ the\ extension\n.tcl\ to\ running\ wish\ with\ it,\ so\ scripts\ can\ run\ by\ just\ double-clicking\ them.\n\[escargo\]:\ And\ using\ \[ActiveTcl\]\ is\ the\ ''suggested''\ way....\n\n\n\n**\ See\ also\ **\n\n\ \ \ \[Beginning\ Tcl\]:\ \ \ \n\n\n\ \ \ \[The\ Hello\ World\ program\ as\ implemented\ in\ Tcl/Tk\]:\ \ \ \n\n\n<<categories>>\ Beginning\ Tcl\ |\ Tutorial} CALL {my revision {Show me an example}} CALL {::oo::Obj1029261 process revision/Show+me+an+example} CALL {::oo::Obj1029259 process}

-errorcode

NONE

-errorinfo

Unknow state transition: LINE -> END
    while executing
"error $msg"
    (class "::Wiki" method "render_wikit" line 6)
    invoked from within
"my render_$default_markup $N $C $mkup_rendering_engine"
    (class "::Wiki" method "render" line 8)
    invoked from within
"my render $name $C"
    (class "::Wiki" method "revision" line 31)
    invoked from within
"my revision $page"
    (class "::Wiki" method "process" line 56)
    invoked from within
"$server process [string trim $uri /]"

-errorline

4