Error processing request

Parameters

CONTENT_LENGTH0
REQUEST_METHODGET
REQUEST_URI/revision/Gub?V=24
QUERY_STRINGV=24
CONTENT_TYPE
DOCUMENT_URI/revision/Gub
DOCUMENT_ROOT/var/www/nikit/nikit/nginx/../docroot
SCGI1
SERVER_PROTOCOLHTTP/1.1
HTTPSon
REMOTE_ADDR172.70.126.189
REMOTE_PORT57124
SERVER_PORT4443
SERVER_NAMEwiki.tcl-lang.org
HTTP_HOSTwiki.tcl-lang.org
HTTP_CONNECTIONKeep-Alive
HTTP_ACCEPT_ENCODINGgzip, br
HTTP_X_FORWARDED_FOR3.128.79.88
HTTP_CF_RAY8802e8d169a5298c-ORD
HTTP_X_FORWARDED_PROTOhttps
HTTP_CF_VISITOR{"scheme":"https"}
HTTP_ACCEPT*/*
HTTP_USER_AGENTMozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; ClaudeBot/1.0; [email protected])
HTTP_CF_CONNECTING_IP3.128.79.88
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 Gub Gub\ -\ Gui\ Builder\n\nThe\ World's\ Fastest\ GUI\ Builder.\n\nDirections\ to\ find\ it\ at\ \[Stu\]\n\n\[Stu\]\ 2015-05-20\ Version\ 0.6.\n\n\[Stu\]\ 2012-06-17\ Version\ 0.5.\n\n\[Stu\]\ 2012-08-11\ Added\ tutorial\ #2\ to\ this\ page.\n----\n\[Stu\]\ 2008-11-13\n\nGub\ is\ a\ simple\ GUI\ builder\ that\ takes\ a\ simple\ spec\ and\ generates\ GUI\ code.<<br>>\nTkGub\ is\ an\ interactive\ GUI\ builder\ based\ on\ Gub.<<br>>\nInspired\ by\ cool\ web\ tools\ like\ build-html\ or\ build-regexp\ as-you-type,\ I\ (initially)\ threw\ this\ together.\n----\n\[JBR\]\ -\ Here\ is\ something\ similar\ \[Laying\ out\ widgets\ in\ a\ grid\]\n----\n\[Stu\]\ 2008-11-13\ They're\ both\ in\ a\ highly\ raw,\ experimental\ and\ possibly\ volatile\ state\ right\ now.<<br>>\nNo\ docs\ -\ the\ source\ and\ screenshot\ should\ help\ get\ you\ on\ your\ way\ -\ have\ fun!\ \;)\n----\n\[Stu\]\ 2008-12-20\ New\ version\ 0.2\ with\ full\ complement\ of\ widgets\ and\ more/improved\ functionality.<<br>>\nThe\ screenshot\ is\ a\ bit\ dated\ now\ but\ is\ still\ a\ working\ example.\n----\n\[Stu\]\ 2008-12-29\ Version\ 0.3.<<br>>\nSome\ notes\ about\ Gub:<<br>>\nGub\ generates\ code.<<br>>\nGub\ is\ a\ learning\ tool.<<br>>\nGub\ requires\ knowing\ what\ you're\ doing.<<br>>\nGub\ is\ a\ minimal\ and\ fast\ notation\ for\ describing\ (parts\ of)\ GUIs.<<br>>\n\nGub\ currently\ works\ fairly\ well.\nNested\ frames\ are\ still\ buggy\ and\ the\ row/columnconfigures\ aren't\ exactly\ right\ either.\nAs\ I\ continue\ to\ actually\ attempt\ to\ use\ Gub\ in\ other\ programs,\ it\ is\ subject\ to\ change\ based\ on\ my\ needs\ and\ whims\ (probably\ a\ good\ thing\ :).\n\nThe\ screenshot\ is\ less\ applicable\ to\ the\ current\ state\ of\ Gub\ so\ it's\ now\ a\ link\ instead\ of\ an\ inline\ image.<<br>>\nhttp://img249.imageshack.us/img249/7812/gubscrld0.png\n----\n\[Stu\]\ 2012-06-17\ Version\ 0.5.<<br>>\nAfter\ a\ period\ of\ actually\ using\ and\ developing\ Gub,\ a\ new\ version\ is\ ready\ for\ mass\ consumption.<<br>>\nNotable\ changes/additions:\n\ \ \ \ *\ Widget\ map,\ allowing\ any\ Tk-style\ widget\ to\ be\ used.\n\ \ \ \ *\ Automatic\ scrollbar\ linking.\n\ \ \ \ *\ Automatic\ handling\ of\ panedwindows\ and\ notebooks.\n\ \ \ \ *\ Powerful\ expansion\ syntax\;\ saves\ typing.\n\ \ \ \ *\ TkGub\ has\ been\ replaced\ with\ GubTool\;\ a\ command-line\ and\ gui\ tool.\n\ \ \ \ *\ More\ code\ generation\ options.\n\ \ \ \ *\ Slightly\ better\ docs\ and\ examples.\n----\nRelease\ notes\n======none\nSpring\ 2015\ -\ Version\ 0.6\n\nGub:\nSource\ code\ generation\ for:\ Tcl\n\nNew\ exported\ procs:\ngubLangs\ -\ List\ available\ languages\ngubUA\ -\ Underline\ Ampersand\nngub\ -\ newer\ interface\ to\ Gub.\ Offers\ more\ control.\ Use\ it.\n\nNew\ exported\ 'gob'\ procs:\ngubOpGob,\ gubBindGob,\ gubAddGob,\ gubWrapToggleGob,\ gubOpListGob\n\nBetter\ gubbing\nNew:\ up\ operator\ \"^\"\nNew:\ brace\ \"\{\}\"\ expansion\nMore\ better\ expansion\ in\ more\ places\nAutoscrollbars\ can\ be\ disabled\ with\ \"!%-\"\ and\ \"!%|\"\nMore/improved\ docs\ and\ examples\nNew:\ tutorials\nUpdated\ spite.conf\ for\ newer\ SPITE\nFixed\ bug\ in\ binds:\ \".\"\ being\ used\ instead\ of\ \"in\"\n\nGUB\ INCOMPATIBILITIES\nThe\ \"script\"\ key\ of\ the\ dict\ returned\ by\ \[ngub\]\nhas\ been\ replaced\ by\ \"\$lang\ src\"\nwhere\ \$lang\ is\ one\ of\ tcl\n\nHorizontal\ scrollbar\ link\ has\ changed\ from\ \"=\"\ to\ \"%-\"\nVertical\ scrollbar\ link\ has\ changed\ from\ \"^\"\ to\ \"%|\"\n\nGubtool:\nNow\ requires\ Meb\nRemoved\ notes\nAdded\ tutorials\nAdded\ source\ tab\nMore/better\ arg\ processing\n\n\nSpring\ 2012\ -\ Version\ 0.5\nSummer\ 2009\ -\ Version\ 0.4\nFall/Winter\ 2008\ -\ Version\ 0.3\n======\n\nREADME\n======none\nGub:\ The\ World's\ Fastest\ GUI\ Builder.\n\n\nGub\ is\ a\ GUI\ builder\ Tcl\ extension\ that\ntakes\ a\ simple\ spec\ and\ generates\ GUI\ code.\n\nGubTool\ is\ a\ command-line\ tool\ and\ninteractive\ GUI\ builder\ based\ on\ Gub.\n\nRequires\ Tcl/Tk\ 8.5+\n\n\nInstallation:\n\nPut\ the\ files\ gub.tcl\ and\ pkgIndex.tcl\nin\ a\ directory\ in\ the\ ::auto_path.\n\nor\n\nCopy\ gub.tcl\ to\ gub-0.6.tm\ in\ a\ directory\nin\ the\ \[::tcl::tm::path\ list\].\n\nor\n\nInstall\ with\ SPITE:\n\$\ spite\ |\ sh\ -s\ --\ --install\n\nFor\ SPITE\ install\ help:\n\$\ spite\ |\ sh\ -s\ --\ --help\n\nor\n\nWith\ SPITE'd\ Gub:\n\$\ gzcat\ gub-0.6.spite.gz\ |\ sh\ -s\ --\ --install\n======\n----\nGobs\ (a\ 'gob'\ being\ what\ you\ feed\ to\ Gub):\n\na)\n======non\nb\ e\ b\ b\nb\ b\ b\n======\n\nb)\n======none\nf\ b\ e\ b\ b\nf\ b\ b\ b\n======\n\nc)\n======none\nb\ bqb\n.b\ -text\ moo\ -bg\ red\n.b2\ -text\ cow\n.bq\ -bg\ green\n======\n\nd)\n======none\n#\ TkGub\ test\ gui\n\nf\ t\ sv\n\ \ sh\n\n.t\ -width\ 20\n.t\ -height\ 10\n.s1\ -orient\ horizontal\n\n:s0\ -sticky\ ns\n:s1\ -sticky\ ew\n:t0,f0\n\n|f0\n-f0\n|.\n-.\n\n#\ end\n======\n\[Twig\]\ for\ 'd':\n======none\n#\ Twig\ for\ TkGub\ test\ gui\n21911\ 4\ 66C6D4817EB7CC475DE76AD1DE8CEA4F\n======\nLoading\ into\ GubTool\ with\ Twig:\n======none\necho\ '21911\ 4\ 66C6D4817EB7CC475DE76AD1DE8CEA4F'\ |\ twig\ -c\ -\ |\ gubtool\ -\n======\n----\n**Gub\ Tutorial\ #1**\n======none\nA\ common\ widget\ layout\ is\ a\ frame\ containing\ a\ text\ widget\ connected\ to\ two\ scrollbar\ widgets.\nLooking\ at\ the\ default\ widget\ map,\ we\ can\ see\ that\ 'f'\ is\ \[frame\],\ 't'\ is\ \[text\]\ and\ 's'\ is\ \[scrollbar\].\nNotice\ that\ 'f'\ in\ the\ default\ widget\ map\ has\ 'container'\ in\ its\ 'properties'.\nAll\ widgets\ to\ the\ right\ of\ a\ container\ will\ be\ children\ of\ that\ container.\n\nSo\ we\ make\ this\ little\ gob:\n\nf\ t\ s\n\ \ s\n\nWhich\ will\ make\ 't'\ and\ 's'\ children\ of\ 'f'.\nThe\ 't'\ will\ be\ at\ -row\ 0,\ -column\ 0\ of\ 'f'.\nThe\ first\ 's'\ will\ be\ at\ -row\ 0,\ -column\ 1\ of\ 'f'.\nThe\ second\ 's'\ will\ be\ at\ -row\ 1,\ -column\ 0\ of\ 'f'.\n\nDigression...\n\nGub\ understands\ a\ grid-style\ layout.\nEvery\ widget\ is\ represented\ by\ one\ character\ which\ maps\ to\ a\ widget\ command.\nEvery\ widget\ in\ the\ layout\ is\ two\ columns\ wide\ by\ one\ row\ high.\nThe\ first\ position\ is\ the\ widget\ character,\ the\ second\ is\ a\ single-character\ label.\n\nThe\ wrong\ way\ to\ grid\ two\ rows\ of\ three\ buttons:\n\nbbb\nbbb\n\nThe\ right\ way\ to\ grid\ two\ rows\ of\ three\ buttons:\n\nb\ b\ b\nb\ b\ b\n\nGridding\ two\ rows\ of\ three\ buttons\ with\ single-character\ labels:\n\nbjbkbl\nbxbybz\n\nThis\ tutorial\ will\ not\ go\ into\ further\ detail\ on\ this\ subject\;\ read\ gub_referring.txt\ for\ more\ information.\n\nContinued\ ...\n\nLooking\ at\ the\ default\ widget\ map\ entry\ for\ 't',\ we\ can\ see\ that\ is\ has\ 'scrollable'\ in\ its\ 'properties'.\nLooking\ at\ the\ default\ widget\ map\ entry\ for\ 's',\ we\ can\ see\ that\ is\ has\ 'scroller'\ in\ its\ 'properties'.\nGub\ will\ automatically\ attach\ a\ 'scroller'\ to\ 'scrollable'\ if\ the\ 'scroller'\ is\ immediately\ to\ the\ right\nor\ immediately\ below\ the\ 'scrollable'.\nGub\ will\ also\ set\ the\ orientation\ and\ grid\ options\ of\ the\ 'scroller'\n\nThe\ result\ of\ running\ this\ through\ Gub:\n\ngrid\ \[frame\ .f0\]\ -row\ 0\ -column\ 0\ngrid\ \[text\ .f0.t0\ -xscrollcommand\ \[list\ .f0.s1\ set\]\ -yscrollcommand\ \[list\ .f0.s0\ set\]\]\ -row\ 0\ -column\ 0\ngrid\ \[scrollbar\ .f0.s0\ -orient\ vertical\ -command\ \[list\ .f0.t0\ yview\]\]\ -sticky\ ns\ -row\ 0\ -column\ 1\ngrid\ \[scrollbar\ .f0.s1\ -orient\ horizontal\ -command\ \[list\ .f0.t0\ xview\]\]\ -sticky\ ew\ -row\ 1\ -column\ 0\n\nThis\ is\ nice\ but\ there\ is\ still\ something\ missing:\nWe\ want\ the\ widgets\ to\ change\ size\ when\ the\ toplevel\ is\ resized.\n\nFor\ grid\ options\ we\ use\ the\ ':'\ grid\ operator,\ so\ we\ add:\n\n:t0\n\nWhich\ is\ Gub\ shorthand\ for\ 'grid\ this\ widget\ -sticky\ nsew'.\nWe\ specified\ the\ widget\ as\ 't0'\ which\ is\ the\ first\ 't'.\n\nWe\ could\ have\ written:\n\n:t0\ -sticky\ nsew\n\nWhich\ would\ accomplish\ the\ same\ thing.\nWhen\ no\ grid\ options\ are\ supplied,\ Gub\ will\ automatically\ generate\ '-sticky\ nsew'.\nGub\ tries\ to\ provide\ defaults\ for\ the\ most\ common\ usages.\n\nWe\ also\ need\ to\ row\ and\ column\ configure\ the\ frame\ ('f0').\nFor\ this\ we\ use\ the\ '|'\ columnconfigure\ and\ '-'\ rowconfigure\ operators.\n\n|f0\n-f0\n\nWe\ could\ have\ written:\n\n|f0\ 0\ -weight\ 1\n-f0\ 0\ -weight\ 1\n\nWith\ no\ options,\ these\ operators\ automatically\ generate\ '0\ -weight\ 1'.\nGub\ tries\ to\ provide\ defaults\ for\ the\ most\ common\ usages.\n\nSo\ now\ we\ have:\n\nf\ t\ s\n\ \ s\n:t0\n|f0\n-f0\n\nWhich\ is\ better\ but\ still\ not\ fully\ working.\nWe\ have\ to\ take\ care\ of\ 'f'\ inside\ its\ parent.\nWe\ need\ to\ add:\n\n:f0\n|.\n-.\n\nGub\ treats\ '.'\ as\ the\ parent\ window,\ not\ the\ root\ ('.')\ window.\nIn\ this\ case\ the\ parent\ is\ the\ root.\n\nGub\ expands\ widget\ specifications,\ so\ instead\ of\ writing:\n\n:t0\n:f0\n\nWe\ can\ write\ (order\ unimportant):\n\n:t0,f0\n\nSo\ now\ we\ have:\n\nf\ t\ s\n\ \ s\n:f0,t0\n|.,f0\n-.,f0\n\nWhich\ results\ in\ what\ we\ want:\n\ngrid\ \[frame\ .f0\]\ -sticky\ nsew\ -row\ 0\ -column\ 0\ngrid\ \[text\ .f0.t0\ -xscrollcommand\ \[list\ .f0.s1\ set\]\ -yscrollcommand\ \[list\ .f0.s0\ set\]\]\ -sticky\ nsew\ -row\ 0\ -column\ 0\ngrid\ \[scrollbar\ .f0.s0\ -orient\ vertical\ -command\ \[list\ .f0.t0\ yview\]\]\ -sticky\ ns\ -row\ 0\ -column\ 1\ngrid\ \[scrollbar\ .f0.s1\ -orient\ horizontal\ -command\ \[list\ .f0.t0\ xview\]\]\ -sticky\ ew\ -row\ 1\ -column\ 0\ngrid\ rowconfigure\ .f0\ 0\ -weight\ 1\ngrid\ rowconfigure\ .\ 0\ -weight\ 1\ngrid\ columnconfigure\ .f0\ 0\ -weight\ 1\ngrid\ columnconfigure\ .\ 0\ -weight\ 1\n\nNow\ let's\ add\ a\ few\ things:\ a\ label\ and\ a\ checkbutton\ on\ top,\ a\ button\ on\ the\ bottom\ and\ a\ button\ binding.\nWe'll\ be\ using\ the\ '.'\ property\ operator,\ a\ 'reference'\ (specified\ with\ '//')\nand\ we'll\ have\ to\ change\ some\ of\ the\ row/column\ configures.\nWell\ make\ the\ checkbutton\ change\ the\ word\ wrap\ type\ of\ the\ text\ widget\ and\ the\ button\ exit\ the\ program.\n\nFirst\ let's\ add\ the\ widgets.\nLooking\ at\ the\ default\ widget\ map,\ we\ can\ see\ that\ 'l'\ is\ \[label\],\ 'k'\ is\ \[checkbutton\]\ and\ 'b'\ is\ \[button\].\n\nf\ l\ k\n\ \ t\ s\n\ \ s\nb\n:f0,t0\n|.,f0\n-.,f0\n\nNot\ bad,\ but\ we\ need\ a\ rowconfigure\ adjustment,\ so\ change:\n\n-.,f0\n\nTo:\n\n-.\n-f0\ 1\n\nWith\ a\ single\ option,\ these\ row/column\ configure\ operators\ automatically\ generate\ '-weight\ 1'.\n\nWe\ also\ need\ to\ set\ some\ widget\ options,\ for\ example,\ the\ button\ should\ say\ and\ do\ things.\nFor\ this,\ we\ use\ the\ property\ ('.')\ operator:\n\n.b0\ -text\ Exit\ -command\ exit\n\nAnd\ the\ label\ should\ have\ some\ text:\n\n.l0\ -text\ Input\n\nWe'd\ also\ like\ the\ label\ to\ be\ on\ the\ left\n\n:l0\ -sticky\ w\n\nWe'd\ also\ like\ to\ be\ able\ to\ exit\ on\ a\ kepyress\ so\ let's\ use\ the\ '&'\ binding\ operator:\n\n&b0\ Control+q\n\nThe\ binding\ operator\ works\ differently\ depending\ on\ the\ options\ given.\nWhat\ we're\ asking\ for\ here\ is\ for\ the\ keypress\ to\ invoke\ the\ button's\ -command.\nNotice\ that\ we've\ used\ 'Control+q'\ when\ we'd\ be\ expecting\ to\ see\ 'Control-q'.\nGub\ will\ expand\ bindings\ that\ contain\ '+'\ into\ both\ upper\ and\ lower\ case.\nThe\ above\ gob\ will\ generate:\n\nbind\ .\ <Control-q>\ \".b0\ invoke\"\nbind\ .\ <Control-Q>\ \".b0\ invoke\"\n\nLastly,\ let's\ have\ the\ checkbutton\ control\ the\ word\ wrap\ mode\ of\ the\ text\ widget.\nFor\ this\ we\ need\ a\ 'reference'\ which\ is\ a\ widget\ spec\ in\ slashes.\nThe\ 'reference'\ will\ be\ replaced\ by\ the\ actual\ widget\ name.\nAlso,\ we\ don't\ want\ the\ checkbutton\ to\ take\ focus:\n\n.k0\ -takefocus\ 0\ -command\ \{/t0/\ configure\ -wrap\ \[expr\ \{\[/t0/\ cget\ -wrap\]\ eq\ \"none\"\ ?\ \"word\"\ :\ \"none\"\}\]\}\n\nLet's\ also\ add\ a\ binding:\n\n&k0\ Alt+w\n\nPutting\ it\ all\ together,\ we\ have:\n\nf\ l\ k\n\ \ t\ s\n\ \ s\nb\n.l0\ -text\ Input\n.b0\ -text\ Exit\ -command\ exit\n.k0\ -takefocus\ 0\ -command\ \{/t0/\ configure\ -wrap\ \[expr\ \{\[/t0/\ cget\ -wrap\]\ eq\ \"none\"\ ?\ \"word\"\ :\ \"none\"\}\]\}\n:l0\ -sticky\ w\n:f0,t0\n|.,f0\n-.\n-f0\ 1\n&b0\ Control+q\n&k0\ Alt+w\n\nRunning\ this\ through\ Gub\ gives:\n\ngrid\ \[frame\ .f0\]\ -sticky\ nsew\ -row\ 0\ -column\ 0\ngrid\ \[label\ .f0.l0\ -text\ Input\]\ -sticky\ w\ -row\ 0\ -column\ 0\ngrid\ \[checkbutton\ .f0.k0\ -command\ \{.f0.t0\ configure\ -wrap\ \[expr\ \{\[.f0.t0\ cget\ -wrap\]\ eq\ \"none\"\ ?\ \"word\"\ :\ \"none\"\}\]\}\ -takefocus\ 0\]\ -row\ 0\ -column\ 1\ngrid\ \[text\ .f0.t0\ -xscrollcommand\ \[list\ .f0.s1\ set\]\ -yscrollcommand\ \[list\ .f0.s0\ set\]\]\ -sticky\ nsew\ -row\ 1\ -column\ 0\ngrid\ \[scrollbar\ .f0.s0\ -orient\ vertical\ -command\ \[list\ .f0.t0\ yview\]\]\ -sticky\ ns\ -row\ 1\ -column\ 1\ngrid\ \[scrollbar\ .f0.s1\ -orient\ horizontal\ -command\ \[list\ .f0.t0\ xview\]\]\ -sticky\ ew\ -row\ 2\ -column\ 0\ngrid\ \[button\ .b0\ -command\ exit\ -text\ Exit\]\ -row\ 1\ -column\ 0\ngrid\ rowconfigure\ .f0\ 1\ -weight\ 1\ngrid\ rowconfigure\ .\ 0\ -weight\ 1\ngrid\ columnconfigure\ .f0\ 0\ -weight\ 1\ngrid\ columnconfigure\ .\ 0\ -weight\ 1\nbind\ .\ <Control-q>\ \".b0\ invoke\"\nbind\ .\ <Control-Q>\ \".b0\ invoke\"\nbind\ .\ <Alt-w>\ \".f0.k0\ invoke\"\nbind\ .\ <Alt-W>\ \".f0.k0\ invoke\"\n\n\nNotice\ that\ we\ didn't\ have\ to\ fiddle\ with\ widget\ paths\ or\ rows\ and\ columns.\nGub\ does\ a\ lot\ of\ the\ drudge\ work\ for\ us.\n======\n----\n**Gub\ Tutorial\ #2**\n======none\nLet's\ build\ something!\nA\ directory\ and\ file\ browser.\n\nWhat\ we\ need:\nA\ treeview\ widget\ for\ directory\ names.\nA\ treeview\ widget\ for\ directory\ contents.\nA\ text\ widget\ for\ file\ contents.\nPanedwindows,\ scrollbars,\ etc.\n\nLayout:\n+--------------------------+\n|\ dir\ names\ |\ dir\ contents\ |\n+--------------------------+\n|\ \ \ \ \ \ file\ contents\ \ \ \ \ \ \ |\n+--------------------------+\n\nWe'll\ use\ Ttk\ widgets.\nCheck\ the\ standard\ Tk\ widget\ map\ for\ details.\n\nLet's\ start\ with\ a\ treeview\ and\ scrollbars:\nV\ S\nS\n\nEasy-peasy.\n\nAnd\ a\ text\ widget\ with\ scrollbars:\nt\ S\nS\n\nNotice\ we're\ mixing\ Tk\ and\ Ttk.\ That's\ ok.\n\nNow\ let's\ put\ things\ into\ panedwindows.\nWe'll\ need\ two\;\ one\ horizontal\ for\ the\ntext\ and\ second\ panedwindow,\ and\ the\nsecond\ panedwindow\ for\ the\ two\ treeviews.\n\nReferencing\ the\ standard\ Tk\ widget\ map\nwe\ can\ see\ that\ a\ panedwindow\ has\ a\nproperty\ of\ 'adder'.\ An\ adder\ is\ a\ form\nof\ container\ with\ the\ difference\ that\nwidgets\ are\ added\ whereas\ with\ containers\nthey\ are\ gridded.\n\nLet's\ start\ simple,\ with\ one\ panedwindow\ncontaining\ the\ two\ treeviews.\nWe'll\ need\ to\ put\ the\ treeviews\ and\ their\ncorresponding\ scrollbars\ into\ frames\ so\nthat\ we\ can\ set\ up\ the\ grid\ parameters\nneeded\ to\ make\ things\ nice.\ Also,\ a\npanedwindow\ can\ only\ add\ one\ thing\ into\nany\ one\ pane\ (I\ think).\n\nOk,\ so\ one\ Ttk\ frame\ containing\ a\ treeview\nand\ two\ Ttk\ scrollbars:\nF\ V\ S\n\ \ S\n\nAdding\ that\ to\ a\ panedwindow:\nP\ F\ V\ S\n\ \ \ \ S\n\nAdding\ two\ sets\ of\ frame/treeview/scrollbars:\nP\ F\ V\ S\n\ \ \ \ S\n\ \ F\ V\ S\n\ \ \ \ S\n\nPutting\ that\ into\ another\ panedwindow,\ and\ adding\na\ frame/text/scrollbars\ to\ the\ other\ panedwindow:\nP\ P\ F\ V\ S\n\ \ \ \ \ \ S\n\ \ \ \ F\ V\ S\n\ \ \ \ \ \ S\n\ \ F\ t\ S\n\ \ \ \ S\n\nThat's\ our\ layout!\n\nWe\ can\ paste\ that\ into\ GubTool\ and\ see\ that\nwe\ do\ indeed\ get\ our\ widgets.\n\nNow\ we\ need\ to\ make\ some\ adjustments.\n\nThe\ inner\ panedwindow\ needs\ to\ be\ horizontal\nso\ using\ the\ '.'\ (properties)\ operator:\n.P1\ -orient\ horizontal\n\nNow\ we\ need\ to\ take\ care\ of\ gridding.\nWe\ want\ to\ grid\ -sticky\ nsew\ the\ outer\npanedwindow,\ the\ two\ treeviews\ and\ the\ntext\ widget:\n:P0,V0,1,t0\n\nAlso,\ we\ want\ to\ row\ and\ column\ configure\nthe\ main\ window\ and\ all\ Ttk\ frames.\n-.,F\n|.,F\n\nOnce\ we've\ created\ all\ these\ widgets\nwe'll\ only\ really\ need\ to\ work\ with\nthree\ of\ them:\ the\ two\ treeviews\nand\ the\ text\ widget.\n\nWe'll\ use\ the\ '/'\ (save)\ operator\nand\ give\ our\ widgets\ names:\n/V0\ dirs\n/V1\ files\n/t0\ text\n\nBy\ default,\ widgets\ are\ saved\ in\na\ dict\ named\ 'gui'.\n\nThis\ is\ all\ well\ and\ good\ but\ now\nlet's\ look\ at\ using\ Gub\ in\ a\ program.\n\nRemember:\nGub\ splits\ input\ into\ lines\ on\ semicolons\ and\ newlines.\nLeading\ tabs\ are\ stripped.\nGub\ returns\ a\ script.\n\nA\ simple\ invocation,\ creating\ a\nlabel\ and\ an\ entry:\neval\ \[gub\ \"l\ e\"\]\n\nHere's\ how\ I\ like\ to\ write\ Gub-using\ code,\nshowing\ a\ frame\ containing\ two\ buttons:\neval\ \[gub\ \"\n\ \ \ \ \ \ \ \ F\ B\n\ \ \ \ \ \ \ \ \ \ B\n\"\]\n\nI\ consider\ this\ to\ be\ a\ bit\ dangerous\nsince\ a\ change\ in\ whitespace\ can\ndisrupt\ the\ layout,\ so\ I\ use\ semicolons:\neval\ \[gub\ \"\n\ \ \ \ \ \ \ \ \;F\ B\n\ \ \ \ \ \ \ \ \;\ \ B\n\"\]\n\nThe\ above\ could\ also\ be\ written\ as:\neval\ \[gub\ \"F\ B\;\ \ B\"\]\n\nHere's\ our\ complete\ file\ browser\ gui\ in\ a\ program,\nnotice\ how\ using\ semicolons\ also\ lines\ up\ the\nlayout\ and\ the\ operators\ for\ improved\ clarity:\n\neval\ \[gub\ \"\n\ \ \ \ \ \ \ \ \;P\ P\ F\ V\ S\n\ \ \ \ \ \ \ \ \;\ \ \ \ \ \ S\n\ \ \ \ \ \ \ \ \;\ \ \ \ F\ V\ S\n\ \ \ \ \ \ \ \ \;\ \ \ \ \ \ S\n\ \ \ \ \ \ \ \ \;\ \ F\ t\ S\n\ \ \ \ \ \ \ \ \;\ \ \ \ S\n\ \ \ \ \ \ \ \ .P1\ -orient\ horizontal\n\ \ \ \ \ \ \ \ :P0,V0,1,t0\n\ \ \ \ \ \ \ \ -.,F\ \;\ |.,F\n\ \ \ \ \ \ \ \ /V0\ dirs\n\ \ \ \ \ \ \ \ /V1\ files\n\ \ \ \ \ \ \ \ /t0\ text\n\"\]\n\nNotice\ that\ the\ row\ and\ column\ configures\nare\ on\ the\ same\ line,\ separated\ by\ semicolons.\nThis\ is\ a\ matter\ of\ taste.\n\nAfter\ running\ this\ we\ now\ have\ our\ dict\ with\nthe\ saved\ widgets.\ No\ more\ setting\ up\ or\ trying\nto\ keep\ track\ of\ widget\ path\ names\ with\ Gub!\n%\ set\ gui\ndirs\ .p0.p1.f0.v0\ files\ .p0.p1.f1.v1\ text\ .p0.f2.t0\n\nAnd\ we\ can\ use\ it,\ of\ course:\n\[dict\ get\ \$gui\ text\]\ insert\ end\ Gub!\n\nOne\ last\ thing\ to\ mention\ is\ how\ the\ '&'\ binding\noperator\ can\ be\ helpful\ here:\n&V0\ <<TreeviewSelect>>\ mySelector\n\nThat's\ the\ end\ of\ this\ tutorial.\nActually\ writing\ the\ code\ for\ a\ working\ file\ browser\nprogram\ is\ left\ as\ an\ exercise\ for\ the\ reader.\ :)\n\nAddendum.\nWith\ comments:\neval\ \[gub\ \"\n\ \ \ \ \ \ \ \ \;P\ P\ F\ V\ S\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \;#\ Gui\ layout\ for\n\ \ \ \ \ \ \ \ \;\ \ \ \ \ \ S\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \;#\ file\ browser\n\ \ \ \ \ \ \ \ \;\ \ \ \ F\ V\ S\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \;#\n\ \ \ \ \ \ \ \ \;\ \ \ \ \ \ S\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \;#\ Strange\ how\ these\ comments\n\ \ \ \ \ \ \ \ \;\ \ F\ t\ S\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \;#\ make\ this\ look\ like\ assembly\ code\n\ \ \ \ \ \ \ \ \;\ \ \ \ S\n\ \ \ \ \ \ \ \ .P1\ -orient\ horizontal\ \ \ \ \;#\ Relax\n\ \ \ \ \ \ \ \ :P0,V0,1,t0\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \;#\ Grid\ 'em\ good\n\ \ \ \ \ \ \ \ -.,F\ \;\ |.,F\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \;#\ Make\ sure\ things'll\ stretch\n\ \ \ \ \ \ \ \ /V0\ dirs\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \;#\ We'll\ need\ these\ for\ later\n\ \ \ \ \ \ \ \ /V1\ files\n\ \ \ \ \ \ \ \ /t0\ text\n\"\]\n======\n----\nOld\ code:\n\n**Gub**\n======\n#!\ /bin/sh\n#\ \\\nexec\ tclsh\ \"\$0\"\ \$\{1+\"\$@\"\}\n\n#\n#\ Gub\ -\ GUiBuilder\n#\n#\ Stuart\ Cassoff\n#\ Fall/Winter\ 2008\n#\n#\ Version\ 0.3\n#\n#\n#\ \"I\ have\ a\ gub.\"\ -\ Woody\ Allen\n#\n\n\nnamespace\ eval\ gub\ \{\n\npackage\ provide\ gub\ 0.3\n\nnamespace\ export\ gub\ gubParse\ gubAssemble\ gubProc\n\n\n\n#\n#\n#\nproc\ gub\ \{gob\ \{var\ \{gui\}\}\}\ \{\n\ \ \ \ \ \ \ \ return\ \[join\ \[gubAssemble\ \{*\}\[gubParse\ \$gob\]\ \$var\]\ \\n\]\n\}\n###\n\n\n\n#\n#\n#\nproc\ gubParse\ \{gob\}\ \{\n\ \ \ \ \ \ \ \ array\ set\ W\ \[list\ b\ button\ c\ canvas\ k\ checkbutton\ e\ entry\ f\ frame\ l\ label\ \\\n\ \ \ \ \ \ \ \ m\ labelframe\ o\ listbox\ p\ panedwindow\ r\ radiobutton\ a\ scale\ s\ scrollbar\ \\\n\ \ \ \ \ \ \ \ i\ spinbox\ t\ text\ B\ ttk::button\ K\ ttk::checkbutton\ X\ ttk::combobox\ E\ ttk::entry\ \\\n\ \ \ \ \ \ \ \ F\ ttk::frame\ L\ ttk::label\ M\ ttk::labelframe\ N\ ttk::notebook\ P\ ttk::panedwindow\ \\\n\ \ \ \ \ \ \ \ R\ ttk::radiobutton\ A\ ttk::scale\ S\ ttk::scrollbar\ V\ ttk::treeview\]\n\n\ \ \ \ \ \ \ \ set\ containers\ \[list\ f\ F\ m\ M\]\n\ \ \ \ \ \ \ \ foreach\ w\ \[array\ names\ W\]\ \{\ set\ N(\[string\ tolower\ \$w\])\ -1\ \}\n\ \ \ \ \ \ \ \ foreach\ a\ \{N\ C\ R\ S\ P\ G\ V\ H\ X\}\ \{\ array\ set\ \$a\ \{\}\ \}\n\ \ \ \ \ \ \ \ array\ set\ wigs\ \{.\ \{\}\}\n\ \ \ \ \ \ \ \ set\ todo\ \{\}\n\n\ \ \ \ \ \ \ \ foreach\ l\ \[split\ \$gob\ \\n\]\ \{\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ set\ ll\ \[string\ trimleft\ \[set\ l\ \[string\ trimright\ \$l\]\]\]\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ if\ \{\$ll\ eq\ \"\"\ ||\ \[string\ index\ \$ll\ 0\]\ eq\ \"#\"\}\ \{\ continue\ \}\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ foreach\ l\ \[split\ \$l\ \\\;\]\ \{\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ set\ ll\ \[string\ trimleft\ \[set\ l\ \[string\ trimright\ \$l\]\]\]\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ if\ \{\[set\ c\ \[string\ index\ \$ll\ 0\]\]\ ni\ \{/\ =\ ^\ !\ .\ :\ -\ |\}\}\ \{\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ if\ \{\[string\ length\ \$l\]\ %\ 2\ !=\ 0\}\ \{\ append\ l\ \"\ \"\ \}\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \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\ \ \ \ \ \ \ \ \ \}\n\ \ \ \ \ \ \ \ \n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ if\ \{\$x\ ==\ 0\ &&\ \[llength\ \$z\]\ >\ 0\}\ \{\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ lassign\ \[lindex\ \$z\ end\]\ in\ row\ col\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ set\ z\ \[lreplace\ \$z\ end\ end\]\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ incr\ row\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \}\n\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ if\ \{!\[info\ exists\ W(\$c)\]\}\ \{\ continue\ \}\ \;#meh\n\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ #\ \ \ \ \ \ \ \ \ \ \ \ command\ window\ options\ element\ gridoptions\ row\ col\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ set\ dd\ \[list\ \"\"\ \ \ \ \ \ \"\"\ \ \ \ \ \"\"\ \ \ \ \ \ \"\"\ \ \ \ \ \ \"\"\ \ \ \ \ \ \ \ \ \ -1\ \ -1\]\n\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ lset\ dd\ 0\ \$W(\$c)\n\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ set\ wig\ .\$in\[set\ lc\ \[string\ tolower\ \$c\]\]\[set\ n\ \[incr\ N(\$lc)\]\]\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ lset\ dd\ 1\ \$wig\n\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ set\ wigs(\$c\$n)\ \$wig\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ if\ \{\$m\ ne\ \"\"\ &&\ \$m\ ne\ \"\ \"\}\ \{\ set\ wigs(\$c\$m)\ \$wig\ \}\n\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ set\ these\ \[list\ all\ \$c\]\;\ if\ \{\$m\ ne\ \"\"\ &&\ \$m\ ne\ \"\ \"\}\ \{\ lappend\ these\ \$c\$m\ \}\;\ lappend\ these\ \$c\$n\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ foreach\ a\ \{p\ g\}\ A\ \{P\ G\}\ i\ \{2\ 4\}\ \{\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ unset\ -nocomplain\ \$a\;\ array\ set\ \$a\ \{\}\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ foreach\ what\ \$these\ \{\ if\ \{\[info\ exists\ \$\{A\}(\$what)\]\}\ \{\ array\ set\ \$a\ \[set\ \$\{A\}(\$what)\]\ \}\ \}\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ if\ \{\[llength\ \[array\ names\ \$a\]\]\ >\ 0\}\ \{\ lset\ dd\ \$i\ \[array\ get\ \$a\]\ \}\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \}\n\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ set\ those\ \[list\ \$c\$n\]\;\ if\ \{\$m\ ne\ \"\"\ &&\ \$m\ ne\ \"\ \"\}\ \{\ lappend\ those\ \$c\$m\ \}\;\ lappend\ those\ \$c\ all\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ foreach\ what\ \$those\ \{\ if\ \{\[info\ exists\ S(\$what)\]\}\ \{\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ if\ \{\$S(\$what)\ eq\ \"\"\}\ \{\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ if\ \{\$what\ eq\ \"all\"\ ||\ \$what\ eq\ \$c\}\ \{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 exists\ X(\$what)\]\}\ \{\ set\ container\ false\;\ break\ \}\ \}\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \}\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ if\ \{\$container\}\ \{\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ lappend\ z\ \[list\ \$in\ \$row\ \$col\]\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ set\ in\ \$in\[string\ tolower\ \$c\]\$n.\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ set\ row\ 0\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ set\ col\ 0\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \}\ else\ \{\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ incr\ col\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \}\n\ \ \ \ \ \ \ \ \}\}\n\n\ \ \ \ \ \ \ \ foreach\ a\ \{H\ V\}\ q\ \{x\ y\}\ \{\ foreach\ \{k\ v\}\ \[array\ get\ \$a\]\ \{\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ if\ \{\[set\ ki\ \[lsearch\ -index\ 1\ \$weegs\ \$wigs(\$k)\]\]\ ==\ -1\ ||\ \[set\ vi\ \[lsearch\ -index\ 1\ \$weegs\ \$wigs(\$v)\]\]\ ==\ -1\}\ \{\ continue\ \}\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ lset\ weegs\ \$ki\ \[linsert\ \[lindex\ \$weegs\ \$ki\]\ end\ -command\ \$wigs(\$v)\ \$\{q\}view\]\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ lset\ weegs\ \$vi\ \[linsert\ \[lindex\ \$weegs\ \$vi\]\ end\ -\$\{q\}scrollcommand\ \$wigs(\$k)\ set\]\n\ \ \ \ \ \ \ \ \}\}\n\n\ \ \ \ \ \ \ \ foreach\ a\ \{R\ C\}\ q\ \{row\ column\}\ \{\ foreach\ \{k\ v\}\ \[array\ get\ \$a\]\ \{\ foreach\ o\ \$v\ \{\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ if\ \{!\[info\ exists\ wigs(\$k)\]\}\ \{\ continue\ \}\ \;#meh\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ lappend\ rccs\ \[list\ \$\{q\}configure\ \$wigs(\$k)\ \$o\]\n\ \ \ \ \ \ \ \ \}\}\}\n\n\ \ \ \ \ \ \ \ return\ \[list\ \$weegs\ \$rccs\]\n\}\n###\n\n\n\n#\n#\n#\nproc\ gubAssemble\ \{weegs\ \{rccs\ \{\}\}\ \{var\ \{gui\}\}\}\ \{\n\ \ \ \ \ \ \ \ set\ zz\ \{\}\n\ \ \ \ \ \ \ \ foreach\ weeg\ \$weegs\ \{\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ set\ links\ \[lassign\ \$weeg\ command\ window\ options\ element\ gridoptions\ row\ col\]\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ set\ z\ grid\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ if\ \{\$element\ ne\ \"\"\}\ \{\ append\ z\ \"\ \"\ \"\\\[set\ \$\{var\}(\$element)\"\ \}\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ append\ z\ \"\ \"\ \"\\\[\"\ \$command\ \"\ \"\ \\\$w\$window\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ if\ \{\$options\ ne\ \"\"\}\ \{\ append\ z\ \"\ \"\ \$options\ \}\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ foreach\ \{opt\ win\ cmd\}\ \$links\ \{\ append\ z\ \"\ \"\ \$opt\ \"\ \"\ \"\\\[list\ \\\$w\$win\ \$cmd\]\"\ \}\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ if\ \{\$element\ ne\ \"\"\}\ \{\ append\ z\ \"\]\"\ \}\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ append\ z\ \"\]\"\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ if\ \{\$gridoptions\ ne\ \"\"\}\ \{\ append\ z\ \"\ \"\ \$gridoptions\ \}\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ if\ \{\$row\ !=\ -1\}\ \{\ append\ z\ \"\ \"\ -row\ \"\ \"\ \$row\ \}\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ if\ \{\$col\ !=\ -1\}\ \{\ append\ z\ \"\ \"\ -column\ \"\ \"\ \$col\ \}\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ lappend\ zz\ \$z\n\ \ \ \ \ \ \ \ \}\n\n\ \ \ \ \ \ \ \ foreach\ rcc\ \$rccs\ \{\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ lassign\ \$rcc\ command\ window\ options\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ set\ z\ grid\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ lappend\ zz\ \[append\ z\ \"\ \"\ \$command\ \"\ \"\ \\\$W\$window\ \"\ \"\ \$options\]\n\ \ \ \ \ \ \ \ \}\n\n\ \ \ \ \ \ \ \ return\ \$zz\n\}\n###\n\n\n\n#\n#\n#\nproc\ gubProc\ \{blob\ \{name\ \{widget\}\}\ \{var\ \{gui\}\}\}\ \{\n\ \ \ \ \ \ \ \ return\ \[regsub\ -line\ -all\ \{^\\t\$\}\ \[join\ \[list\ \"proc\ \$name\ \{\{w\ \{.\}\}\}\ \\\{\"\ \{set\ W\ \$w\;\ if\ \{\$w\ eq\ \".\"\}\ \{set\ w\ \"\"\}\}\ \"variable\ \$var\"\ \"\"\ \[join\ \[split\ \$blob\ \\n\]\ \\n\\t\]\ \"\"\ \{return\ \$W\}\]\ \\n\\t\]\\n\\\}\ \{\}\]\n\}\n###\n\n\n\}\;\ #\ End\ of\ gub\ namespace\n\n#\ EOF\n======\n\n**TkGub**\n======\n#!\ /bin/sh\n#\ \\\nexec\ tclsh\ \"\$0\"\ \$\{1+\"\$@\"\}\n\n#\n#\ TkGub\ -\ GUI\ frontend\ to\ Gub\n#\n#\ Stuart\ Cassoff\n#\ Fall/Winter\ 2008\n#\n#\ Version\ 0.3\n#\n\n\nnamespace\ eval\ tkgub\ \{\n\npackage\ require\ Tk\npackage\ require\ Ttk\npackage\ require\ gub\nnamespace\ import\ ::gub::*\n\n\n\n#\n#\n#\nproc\ gui\ \{\}\ \{\n\ \ \ \ \ \ \ \ variable\ cfg\n\ \ \ \ \ \ \ \ variable\ gui\n\n\ \ \ \ \ \ \ \ set\ w\ \[set\ gui(w)\ \{\}\]\n\ \ \ \ \ \ \ \ set\ W\ \[set\ gui(W)\ \$w.\]\n\n\ \ \ \ \ \ \ \ set\ gui(auto)\ 1\n\ \ \ \ \ \ \ \ eval\ \[gub\ \"f\ k\ b\\np\;.k0\ -text\ Auto\;.b0\ -text\ Go\;.p0\ -orient\ vertical\ -showhandle\ 1\;.k0\ -variable\ \[namespace\ current\]::gui(auto)\;:\;/p0\ mainPane\;/b0\ goButton\;/k0\;|.\;-.\ 1\ -weight\ 1\"\]\n\ \ \ \ \ \ \ \ \$gui(goButton)\ configure\ -command\ \[list\ \[namespace\ current\]::gubrun\ no\]\n\ \ \ \ \ \ \ \ \$gui(k0)\ configure\ -command\ \[namespace\ current\]::gubrun\n\ \ \ \ \ \ \ \ foreach\ what\ \{in\ run\}\ \{\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \$gui(mainPane)\ add\ \[set\ f\ \[labelframe\ \$gui(mainPane).f\$what\ -text\ \[string\ totitle\ \$what\]\]\]\ -sticky\ nsew\ -stretch\ always\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \{*\}\[gubProc\ \[gub\ \"\nt\ s\ns\n\n.t\ -height\ 10\ -wrap\ none\n.s1\ -orient\ horizontal\n\n^s0\ t0\ \;\ =s1\ t0\n\n:s0\ -sticky\ ns\n:s1\ -sticky\ ew\n:t\n\n|.\;-.\n\ \n/t0\ \$what\n\"\]\]\;widget\ \$f\n\ \ \ \ \ \ \ \ \}\n\n\ \ \ \ \ \ \ \ set\ M\ \[menu\ \$w.mMain\ -tearoff\ 0\]\n\ \ \ \ \ \ \ \ set\ menu\ file\n\ \ \ \ \ \ \ \ set\ mm\ \[menu\ \$M.\$menu\ -tearoff\ 0\]\n\ \ \ \ \ \ \ \ \$mm\ add\ command\ -label\ Load\ -command\ \[namespace\ current\]::Load\n\ \ \ \ \ \ \ \ \$mm\ add\ command\ -label\ Save\ -command\ \[namespace\ current\]::Save\n\ \ \ \ \ \ \ \ \$mm\ add\ command\ -label\ Exit\ -command\ exit\n\ \ \ \ \ \ \ \ \$M\ add\ cascade\ -label\ \[string\ totitle\ \$menu\]\ -menu\ \$mm\n\ \ \ \ \ \ \ \ set\ menu\ help\n\ \ \ \ \ \ \ \ set\ mm\ \[menu\ \$M.\$menu\ -tearoff\ 0\]\n\ \ \ \ \ \ \ \ \$mm\ add\ command\ -label\ About\ -command\ \[namespace\ current\]::about\n\ \ \ \ \ \ \ \ \$mm\ add\ command\ -label\ Readme\ -command\ \[namespace\ current\]::readme\n\ \ \ \ \ \ \ \ \$M\ add\ cascade\ -label\ \[string\ totitle\ \$menu\]\ -menu\ \$mm\n\n\ \ \ \ \ \ \ \ foreach\ t\ \{in\ run\}\ \{\ bind\ \$gui(\$t)\ <Control-Return>\ \[namespace\ current\]::run\\\;break\ \}\n\n\ \ \ \ \ \ \ \ bind\ a\ <Key>\ \[namespace\ current\]::gubrun\n\ \ \ \ \ \ \ \ bind\ a\ <Control-Return>\ \[namespace\ current\]::gubrun\\\;break\n\ \ \ \ \ \ \ \ bind\ b\ <Control-Return>\ \[namespace\ current\]::run\\\;break\n\ \ \ \ \ \ \ \ bindtags\ \$gui(in)\ \ \[linsert\ \[bindtags\ \$gui(in)\]\ end\ a\]\n\ \ \ \ \ \ \ \ bindtags\ \$gui(run)\ \[linsert\ \[bindtags\ \$gui(in)\]\ end\ b\]\n\n\ \ \ \ \ \ \ \ bind\ \$W\ <Control-q>\ exit\;\ bind\ \$W\ <Control-Q>\ exit\n\n\ \ \ \ \ \ \ \ bind\ \$W\ <Button-3>\ \[list\ \[namespace\ current\]::domenu\ %W\ \[mwowm\ \$w\]\ %X\ %Y\]\n\n\ \ \ \ \ \ \ \ \$W\ configure\ -menu\ \$M\n\n\ \ \ \ \ \ \ \ wm\ title\ \$W\ \$cfg(fullname)\n\n\ \ \ \ \ \ \ \ focus\ \$gui(in)\n\}\n###\n\n\n\n#\n#\n#\nproc\ mwowm\ \{w\}\ \{\n\ \ \ \ \ \ \ \ set\ M\ \[menu\ \$w.moptions\ -tearoff\ 0\]\n\ \ \ \ \ \ \ \ foreach\ widgets\ \[list\ \\\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \[list\ button\ canvas\ checkbutton\ entry\ frame\ label\ labelframe\ \\\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ listbox\ radiobutton\ scale\ scrollbar\ spinbox\ text\]\ \\\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \[list\ ttk_button\ ttk_checkbutton\ ttk_combobox\ ttk_entry\ \\\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ ttk_frame\ ttk_label\ ttk_labelframe\ ttk_notebook\ \\\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ ttk_radiobutton\ ttk_scale\ ttk_scrollbar\ ttk_treeview\]\ \\\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \]\ tk\ \{Tk\ Ttk\}\ \{\n\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ unset\ -nocomplain\ z\;\ array\ set\ z\ \{\}\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ foreach\ wg\ \$widgets\ \{\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \[string\ map\ \{_\ ::\}\ \$wg\]\ .wg\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ foreach\ ol\ \[.wg\ configure\]\ \{\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ lappend\ z(\[lindex\ \$ol\ 0\])\ \$wg\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \}\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ destroy\ .wg\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \}\n\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ foreach\ wg\ \[linsert\ \$widgets\ 0\ common\]\ \{\ set\ \$wg\ \{\}\ \}\n\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ foreach\ o\ \[lsort\ \[array\ names\ z\]\]\ \{\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ if\ \{\[llength\ \$z(\$o)\]\ ==\ \[llength\ \$widgets\]\}\ \{\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ lappend\ common\ \$o\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \}\ else\ \{\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ foreach\ wg\ \$z(\$o)\ \{\ lappend\ \$wg\ \$o\ \}\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \}\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \}\n\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ set\ mm\ \[menu\ \$M.m\$tk\ -tearoff\ 0\]\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \$M\ add\ cascade\ -label\ \$tk\ -menu\ \$mm\n\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ foreach\ wg\ \[linsert\ \$widgets\ 0\ common\]\ \{\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ set\ m\ \[menu\ \$mm.m\$wg\ -tearoff\ 0\]\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ foreach\ i\ \[set\ \$wg\]\ \{\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \$m\ add\ command\ -label\ \[string\ totitle\ \$i\]\ -command\ \[list\ \[namespace\ current\]::insert\ \$i\]\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \}\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \$mm\ add\ cascade\ -label\ \[string\ totitle\ \$wg\]\ -menu\ \$m\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \}\n\ \ \ \ \ \ \ \ \}\n\n\ \ \ \ \ \ \ \ catch\ \{grid\ .\ -banana\ yellow\}\ cow\n\ \ \ \ \ \ \ \ foreach\ moo\ \[split\ \$cow\ ,\]\ \{\ lappend\ grid\ \[lindex\ \[regexp\ -inline\ \{^.*(-.+)\$\}\ \$moo\]\ 1\]\ \}\n\ \ \ \ \ \ \ \ set\ wg\ grid\n\ \ \ \ \ \ \ \ set\ m\ \[menu\ \$M.m\$wg\ -tearoff\ 0\]\n\ \ \ \ \ \ \ \ foreach\ i\ \[set\ \$wg\]\ \{\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \$m\ add\ command\ -label\ \[string\ totitle\ \$i\]\ -command\ \[list\ \[namespace\ current\]::insert\ \$i\]\n\ \ \ \ \ \ \ \ \}\n\ \ \ \ \ \ \ \ \$M\ add\ cascade\ -label\ \[string\ totitle\ \$wg\]\ -menu\ \$m\n\ \ \ \ \ \ \ \ catch\ \{grid\ rowconfigure\ .\ 0\ -banana\}\ cow\n\ \ \ \ \ \ \ \ foreach\ moo\ \[split\ \$cow\ ,\]\ \{\ lappend\ gridrcc\ \[lindex\ \[regexp\ -inline\ \{^.*(-.+)\$\}\ \$moo\]\ 1\]\ \}\n\ \ \ \ \ \ \ \ set\ wg\ gridrcc\n\ \ \ \ \ \ \ \ set\ mm\ \[menu\ \$m.m\$wg\ -tearoff\ 0\]\n\ \ \ \ \ \ \ \ foreach\ i\ \[set\ \$wg\]\ \{\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \$mm\ add\ command\ -label\ \[string\ totitle\ \$i\]\ -command\ \[list\ \[namespace\ current\]::insert\ \$i\]\n\ \ \ \ \ \ \ \ \}\n\ \ \ \ \ \ \ \ \$m\ add\ cascade\ -label\ RowColConf\ -menu\ \$mm\n\n\ \ \ \ \ \ \ \ return\ \$M\n\}\n###\n\n\n\n#\n#\n#\nproc\ insert\ \{what\}\ \{\n\ \ \ \ \ \ \ \ variable\ where\n\ \ \ \ \ \ \ \ \$where\ insert\ insert\ \"\$what\ \"\n\}\n###\n\n\n\n#\n#\n#\nproc\ domenu\ \{w\ m\ x\ y\}\ \{\n\ \ \ \ \ \ \ \ variable\ where\ \$w\n\ \ \ \ \ \ \ \ tk_popup\ \$m\ \$x\ \$y\n\}\n###\n\n\n\n#\n#\n#\nproc\ about\ \{\}\ \{\n\ \ \ \ \ \ \ \ variable\ cfg\n\ \ \ \ \ \ \ \ catch\ \{destroy\ .q\}\n\ \ \ \ \ \ \ \ wm\ group\ \[toplevel\ .q\]\ .\n\ \ \ \ \ \ \ \ \{*\}\[gubProc\ \[gub\ \"l\\nl\\nl\\nb\n.l0\ -text\ \{\$cfg(fullname)\}\n.l1\ -text\ \{\$cfg(author)\}\n.l2\ -text\ \{\$cfg(when)\}\n.b0\ -text\ Ok\ -command\ \{destroy\ .q\}\n/b0\ ok\n\"\ aboot\]\ widget\ aboot\]\n\ \ \ \ \ \ \ \ widget\ .q\n\ \ \ \ \ \ \ \ wm\ title\ .q\ \"\$cfg(fullname)\ -\ About\"\n\ \ \ \ \ \ \ \ ::tk::PlaceWindow\ .q\ widget\ .\n\ \ \ \ \ \ \ \ variable\ aboot\n\ \ \ \ \ \ \ \ focus\ \$aboot(ok)\n\ \ \ \ \ \ \ \ unset\ aboot\n\}\n###\n\n\n\n#\n#\n#\nproc\ readme\ \{\}\ \{\n\ \ \ \ \ \ \ \ variable\ cfg\n\ \ \ \ \ \ \ \ set\ var\ readmeGUI\n\ \ \ \ \ \ \ \ catch\ \{destroy\ .q\}\n\ \ \ \ \ \ \ \ wm\ group\ \[toplevel\ .q\]\ .\n\ \ \ \ \ \ \ \ \{*\}\[gubProc\ \[gub\ \"\nf\ t\ s\n\ \ s\nb\n.b0\ -text\ Ok\ -command\ \{destroy\ .q\}\n.t0\ -wrap\ none\n.s1\ -orient\ horizontal\n^s0\ t0\ \;\ =s1\ t0\n:s1\ -sticky\ ew\n:f0,s0\n|f0,.\ \;\ -f0,.\n/t0\ text\n/b0\ button\n\"\ \$var\]\ widget\ \$var\]\n\ \ \ \ \ \ \ \ widget\ .q\n\ \ \ \ \ \ \ \ wm\ title\ .q\ \"\$cfg(fullname)\ -\ Readme\"\n\ \ \ \ \ \ \ \ variable\ \$var\n\ \ \ \ \ \ \ \ \[set\ \$\{var\}(text)\]\ insert\ end\ \"\$cfg(fullname)\n\n\$cfg(author)\n\$cfg(when)\n\n<Button-3>\ for\ widget\ options\n\nWidgets:\n\ b\ button\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ B\ ttk::button\n\ c\ canvas\n\ k\ checkbutton\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ K\ ttk::checkbutton\n\ e\ entry\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ E\ ttk::entry\n\ f\ frame\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ F\ ttk::frame\n\ l\ label\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ L\ ttk::label\n\ z\ labelframe\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ Z\ ttk::labelframe\n\ o\ listbox\n\ r\ radiobutton\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ R\ ttk::radiobutton\n\ a\ scale\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ A\ ttk::scale\n\ s\ scrollbar\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ S\ ttk::scrollbar\n\ i\ spinbox\n\ t\ text\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ X\ ttk::combobox\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ N\ ttk::notebook\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ V\ ttk::treeview\n\nLine\ format:\nSpacing\ is\ important.\nTwo\ (2)\ positions\ per\ widget.\nGenerally:\ widget\ ?tag?\ ?widget\ ?tag?\ ...?\nwtwtwt\nTags\ can\ be\ empty:\nw\ w\ w\ w\nPut\ things\ in\ a\ frame\ (note\ the\ positioning):\nf\ t\ s\n\ \ s\n\nOptions/Controls:\nGeneral\ form:\n?\ ==\ option/control\ described\ below\nw\ ==\ one\ of\ the\ above\ widget\ types\nn\ ==\ nth\ widget\ of\ type\ w\na\ ==\ widget\ of\ type\ w\ tagged\ 'a'\nd\ ==\ option/parm/data\ (one\ or\ more)\n\n?\ \ \ \ \ \ For\ all\n?w\ d\ \ \ For\ all\ w\n?wn\ d\ \ For\ nth\ w\n?wa\ d\ \ For\ w\ tagged\ 'a'\n\nTags\ are\ one\ char,\ user\ supplied.\nIndexes\ (nth)\ are\ generated\ for\neach\ widget\ type,\ starting\ at\ 0.\n\n.\ \ Widget\ options\ \ (\ .l0\ -text\ Hello\ )\n:\ \ Grid\ options\ \ \ \ (\ :l0\ -sticky\ nsew\ )\n^\ \ Scrollbar\ Ylink\ (\ ^s0\ t0\ )\n=\ \ Scrollbar\ Xlink\ (\ =s0\ t0\ )\n|\ \ Rowconfigure\ \ \ \ (\ |f0\ 0\ -weight\ 1\ )\n-\ \ Columnconfigure\ (\ -f0\ 0\ -weight\ 1\ )\n/\ \ Save\ widget\ as\ \ (\ /t0\ inputText\ )\n!\ \ Select\ alternate\ 'gub'\ behaviour.\n\nShortcuts:\n:l0\ same\ as\ :l0\ -sticky\ nsew\n|f0\ same\ as\ |f0\ 0\ -weight\ 1\n-f0\ 1\ same\ as\ -f0\ 1\ -weight\ 1\n:f0\ same\ as\ :f0\ -sticky,\ same\ as\ :f0\ -sticky\ nsew\n/f0\ same\ as\ /f0\ f0\n\nShort-shorts:\n:\ (grid\ all\ widgets\ -sticky\ nsew)\n.\ -cursor\ trek\ (set\ all\ widgets\ to\ have\ the\ 'trek'\ cursor)\n/\ (save\ all)\n!\ (alternate\ all)\n\nUse\ ','\ to\ apply\ an\ option/control\ to\ multiple\ widgets:\n.b0,l0\ -bg\ red\n|f0,f1,f2\n:t0,t1\ -sticky\ nsew\n\nUse\ '!'\ to\ select\ alternate\ widget\ behaviour.\nCurrently\ applies\ only\ to\ containers,\nmakes\ them\ not\ containers.\ Useful\ for\ putting\ncontainers\ side-by-side\ rather\ than\ into\ each\ other.\n\nNotes:\nThe\ tag\ of\ parent\ window\ is\ '.'.\n'.'\ options\ aggregate,\ all\ others\ tend\ to\ override.\nLines\ starting\ with\ '#'\ and\ blank\ lines\ are\ ignored.\nLines\ can\ be\ joined\ with\ '\;'.\ Whitepace\ around\ '\;'\nis\ significant\ for\ layout,\ ignored\ for\ options.\n\nSome\ things\ that\ can\ be\ applied\ to\ more\ than\ one\nwidget\ don't\ make\ much\ sense\ but\ you\ can\ still\ do\ them.\n(/f\ f\ for\ example,\ scrollbar\ links,\ row/column\ configures)\n\nComplex\ GUIs\ can\ be\ built\ out\ of\ little\ gub\ gobs.\n\"\n\n\ \ \ \ \ \ \ \ focus\ \[set\ \$\{var\}(button)\]\n\ \ \ \ \ \ \ \ unset\ \$var\n\}\n###\n\n\n\n#\nproc\ openIt\ \{fn\}\ \{\ return\ \[expr\ \{(\$fn\ eq\ \{-\}\ ||\ \$fn\ eq\ \{stdin\})\ ?\ \{stdin\}\ :\ \[open\ \$fn\ r\]\}\]\ \}\nproc\ closeIt\ \{f\}\ \{\ return\ \[expr\ \{\$f\ eq\ \{stdin\}\ ?\ \{\}\ :\ \[close\ \$f\]\}\]\ \}\nproc\ inhaleIt\ \{fn\}\ \{\ return\ \[read\ \[set\ f\ \[openIt\ \$fn\]\]\]\[closeIt\ \$f\]\ \}\n#\n\n\n\n#\n#\n#\nproc\ autoload\ \{\}\ \{\n\ \ \ \ \ \ \ \ variable\ cfg\n\ \ \ \ \ \ \ \ if\ \{\$cfg(loadthis)\ ne\ \"\"\}\ \{\ Load\ \$cfg(loadthis)\ \}\n\}\n###\n\n\n\n#\n#\n#\nproc\ Load\ \{\{fn\ \{\}\}\}\ \{\n\ \ \ \ \ \ \ \ variable\ gui\n\ \ \ \ \ \ \ \ if\ \{\$fn\ eq\ \"\"\}\ \{\ set\ fn\ \[tk_getOpenFile\]\ \}\n\ \ \ \ \ \ \ \ if\ \{\$fn\ eq\ \"\"\}\ \{\ return\ \}\n\ \ \ \ \ \ \ \ \$gui(in)\ delete\ 1.0\ end\n\ \ \ \ \ \ \ \ \$gui(in)\ insert\ end\ \[inhaleIt\ \$fn\]\n\ \ \ \ \ \ \ \ gubrun\n\}\n###\n\n\n\n#\n#\n#\nproc\ Save\ \{\}\ \{\n\ \ \ \ \ \ \ \ variable\ gui\n\ \ \ \ \ \ \ \ set\ fn\ \[tk_getSaveFile\]\n\ \ \ \ \ \ \ \ if\ \{\$fn\ eq\ \"\"\}\ \{\ return\ \}\n\ \ \ \ \ \ \ \ set\ f\ \[open\ \$fn\ w\]\n\ \ \ \ \ \ \ \ puts\ -nonewline\ \$f\ \[\$gui(in)\ get\ 1.0\ end-1c\]\n\ \ \ \ \ \ \ \ close\ \$f\n\}\n###\n\n\n\n#\n#\n#\nproc\ gubrun\ \{\{auto\ \{yes\}\}\}\ \{\n\ \ \ \ \ \ \ \ variable\ gui\n\n\ \ \ \ \ \ \ \ if\ \{!\$gui(auto)\ &&\ \$auto\}\ \{\ return\ \}\n\n\ \ \ \ \ \ \ \ \$gui(run)\ delete\ 1.0\ end\n\n\ \ \ \ \ \ \ \ if\ \{\[catch\ \{\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \$gui(run)\ insert\ end\ \[gubProc\ \[gub\ \[\$gui(in)\ get\ 1.0\ end\]\]\]\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ run\n\ \ \ \ \ \ \ \ \}\ err\]\}\ \{\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \$gui(run)\ delete\ 1.0\ end\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \$gui(run)\ insert\ end\ \$::errorInfo\n\ \ \ \ \ \ \ \ \}\n\ \ \ \ \ \ \ \ after\ 20\ \[list\ focus\ \$gui(in)\]\n\}\n###\n\n\n\n#\n#\n#\nproc\ run\ \{\}\ \{\n\ \ \ \ \ \ \ \ variable\ gui\n\n\ \ \ \ \ \ \ \ catch\ \{destroy\ \[set\ w\ \$gui(w).test\]\}\n\ \ \ \ \ \ \ \ toplevel\ \$w\;\ bind\ \$w\ <Control-q>\ exit\;\ bind\ \$w\ <Control-Q>\ exit\n\n\ \ \ \ \ \ \ \ eval\ \[\$gui(run)\ get\ 1.0\ end-1c\]\n\ \ \ \ \ \ \ \ widget\ \$w\n\ \ \ \ \ \ \ \ after\ 20\ \[list\ focus\ \$gui(run)\]\n\}\n###\n\n\n\n#\n#\n#\nproc\ args\ \{\}\ \{\n\ \ \ \ \ \ \ \ if\ \{\$::argc\ ==\ 0\}\ \{\ return\ \}\n\ \ \ \ \ \ \ \ variable\ cfg\n\ \ \ \ \ \ \ \ set\ state\ opt\n\ \ \ \ \ \ \ \ foreach\ arg\ \$::argv\ \{\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ switch\ -exact\ --\ \$state\ \{\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ opt\ \{\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ switch\ -exact\ --\ \$arg\ \{\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ -z\ \{\ set\ state\ \$arg\ \}\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ default\ \{\ puts\ stderr\ \"Huh?\"\;\ exit\ 1\ \}\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \}\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \}\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ -z\ \{\ set\ state\ opt\;\ set\ cfg(loadthis)\ \$arg\ \}\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \}\n\ \ \ \ \ \ \ \ \}\n\}\n###\n\n\n\n#\n#\n#\nproc\ setup\ \{\}\ \{\n\ \ \ \ \ \ \ \ variable\ cfg\n\n\ \ \ \ \ \ \ \ set\ cfg(name)\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ TkGub\n\ \ \ \ \ \ \ \ set\ cfg(ver)\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ 0.3\n\ \ \ \ \ \ \ \ set\ cfg(author)\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \"Stuart\ Cassoff\"\n\ \ \ \ \ \ \ \ set\ cfg(when)\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \"Fall/Winter\ 2008\"\n\n\ \ \ \ \ \ \ \ set\ cfg(fullname)\ \ \ \ \ \ \ \ \$cfg(name)\\\ \$cfg(ver)\n\n\ \ \ \ \ \ \ \ set\ cfg(loadthis)\ \ \ \ \ \ \ \ \"\"\n\}\n###\n\n\n\n#\nsetup\;\ args\;\ gui\;\ autoload\n#\n\n\n\}\;\ #\ End\ of\ tkgub\ namespace\n\n#\ EOF\n======\n\n<<categories>>\ Application\ |\ GUI regexp2} CALL {my render Gub Gub\ -\ Gui\ Builder\n\nThe\ World's\ Fastest\ GUI\ Builder.\n\nDirections\ to\ find\ it\ at\ \[Stu\]\n\n\[Stu\]\ 2015-05-20\ Version\ 0.6.\n\n\[Stu\]\ 2012-06-17\ Version\ 0.5.\n\n\[Stu\]\ 2012-08-11\ Added\ tutorial\ #2\ to\ this\ page.\n----\n\[Stu\]\ 2008-11-13\n\nGub\ is\ a\ simple\ GUI\ builder\ that\ takes\ a\ simple\ spec\ and\ generates\ GUI\ code.<<br>>\nTkGub\ is\ an\ interactive\ GUI\ builder\ based\ on\ Gub.<<br>>\nInspired\ by\ cool\ web\ tools\ like\ build-html\ or\ build-regexp\ as-you-type,\ I\ (initially)\ threw\ this\ together.\n----\n\[JBR\]\ -\ Here\ is\ something\ similar\ \[Laying\ out\ widgets\ in\ a\ grid\]\n----\n\[Stu\]\ 2008-11-13\ They're\ both\ in\ a\ highly\ raw,\ experimental\ and\ possibly\ volatile\ state\ right\ now.<<br>>\nNo\ docs\ -\ the\ source\ and\ screenshot\ should\ help\ get\ you\ on\ your\ way\ -\ have\ fun!\ \;)\n----\n\[Stu\]\ 2008-12-20\ New\ version\ 0.2\ with\ full\ complement\ of\ widgets\ and\ more/improved\ functionality.<<br>>\nThe\ screenshot\ is\ a\ bit\ dated\ now\ but\ is\ still\ a\ working\ example.\n----\n\[Stu\]\ 2008-12-29\ Version\ 0.3.<<br>>\nSome\ notes\ about\ Gub:<<br>>\nGub\ generates\ code.<<br>>\nGub\ is\ a\ learning\ tool.<<br>>\nGub\ requires\ knowing\ what\ you're\ doing.<<br>>\nGub\ is\ a\ minimal\ and\ fast\ notation\ for\ describing\ (parts\ of)\ GUIs.<<br>>\n\nGub\ currently\ works\ fairly\ well.\nNested\ frames\ are\ still\ buggy\ and\ the\ row/columnconfigures\ aren't\ exactly\ right\ either.\nAs\ I\ continue\ to\ actually\ attempt\ to\ use\ Gub\ in\ other\ programs,\ it\ is\ subject\ to\ change\ based\ on\ my\ needs\ and\ whims\ (probably\ a\ good\ thing\ :).\n\nThe\ screenshot\ is\ less\ applicable\ to\ the\ current\ state\ of\ Gub\ so\ it's\ now\ a\ link\ instead\ of\ an\ inline\ image.<<br>>\nhttp://img249.imageshack.us/img249/7812/gubscrld0.png\n----\n\[Stu\]\ 2012-06-17\ Version\ 0.5.<<br>>\nAfter\ a\ period\ of\ actually\ using\ and\ developing\ Gub,\ a\ new\ version\ is\ ready\ for\ mass\ consumption.<<br>>\nNotable\ changes/additions:\n\ \ \ \ *\ Widget\ map,\ allowing\ any\ Tk-style\ widget\ to\ be\ used.\n\ \ \ \ *\ Automatic\ scrollbar\ linking.\n\ \ \ \ *\ Automatic\ handling\ of\ panedwindows\ and\ notebooks.\n\ \ \ \ *\ Powerful\ expansion\ syntax\;\ saves\ typing.\n\ \ \ \ *\ TkGub\ has\ been\ replaced\ with\ GubTool\;\ a\ command-line\ and\ gui\ tool.\n\ \ \ \ *\ More\ code\ generation\ options.\n\ \ \ \ *\ Slightly\ better\ docs\ and\ examples.\n----\nRelease\ notes\n======none\nSpring\ 2015\ -\ Version\ 0.6\n\nGub:\nSource\ code\ generation\ for:\ Tcl\n\nNew\ exported\ procs:\ngubLangs\ -\ List\ available\ languages\ngubUA\ -\ Underline\ Ampersand\nngub\ -\ newer\ interface\ to\ Gub.\ Offers\ more\ control.\ Use\ it.\n\nNew\ exported\ 'gob'\ procs:\ngubOpGob,\ gubBindGob,\ gubAddGob,\ gubWrapToggleGob,\ gubOpListGob\n\nBetter\ gubbing\nNew:\ up\ operator\ \"^\"\nNew:\ brace\ \"\{\}\"\ expansion\nMore\ better\ expansion\ in\ more\ places\nAutoscrollbars\ can\ be\ disabled\ with\ \"!%-\"\ and\ \"!%|\"\nMore/improved\ docs\ and\ examples\nNew:\ tutorials\nUpdated\ spite.conf\ for\ newer\ SPITE\nFixed\ bug\ in\ binds:\ \".\"\ being\ used\ instead\ of\ \"in\"\n\nGUB\ INCOMPATIBILITIES\nThe\ \"script\"\ key\ of\ the\ dict\ returned\ by\ \[ngub\]\nhas\ been\ replaced\ by\ \"\$lang\ src\"\nwhere\ \$lang\ is\ one\ of\ tcl\n\nHorizontal\ scrollbar\ link\ has\ changed\ from\ \"=\"\ to\ \"%-\"\nVertical\ scrollbar\ link\ has\ changed\ from\ \"^\"\ to\ \"%|\"\n\nGubtool:\nNow\ requires\ Meb\nRemoved\ notes\nAdded\ tutorials\nAdded\ source\ tab\nMore/better\ arg\ processing\n\n\nSpring\ 2012\ -\ Version\ 0.5\nSummer\ 2009\ -\ Version\ 0.4\nFall/Winter\ 2008\ -\ Version\ 0.3\n======\n\nREADME\n======none\nGub:\ The\ World's\ Fastest\ GUI\ Builder.\n\n\nGub\ is\ a\ GUI\ builder\ Tcl\ extension\ that\ntakes\ a\ simple\ spec\ and\ generates\ GUI\ code.\n\nGubTool\ is\ a\ command-line\ tool\ and\ninteractive\ GUI\ builder\ based\ on\ Gub.\n\nRequires\ Tcl/Tk\ 8.5+\n\n\nInstallation:\n\nPut\ the\ files\ gub.tcl\ and\ pkgIndex.tcl\nin\ a\ directory\ in\ the\ ::auto_path.\n\nor\n\nCopy\ gub.tcl\ to\ gub-0.6.tm\ in\ a\ directory\nin\ the\ \[::tcl::tm::path\ list\].\n\nor\n\nInstall\ with\ SPITE:\n\$\ spite\ |\ sh\ -s\ --\ --install\n\nFor\ SPITE\ install\ help:\n\$\ spite\ |\ sh\ -s\ --\ --help\n\nor\n\nWith\ SPITE'd\ Gub:\n\$\ gzcat\ gub-0.6.spite.gz\ |\ sh\ -s\ --\ --install\n======\n----\nGobs\ (a\ 'gob'\ being\ what\ you\ feed\ to\ Gub):\n\na)\n======non\nb\ e\ b\ b\nb\ b\ b\n======\n\nb)\n======none\nf\ b\ e\ b\ b\nf\ b\ b\ b\n======\n\nc)\n======none\nb\ bqb\n.b\ -text\ moo\ -bg\ red\n.b2\ -text\ cow\n.bq\ -bg\ green\n======\n\nd)\n======none\n#\ TkGub\ test\ gui\n\nf\ t\ sv\n\ \ sh\n\n.t\ -width\ 20\n.t\ -height\ 10\n.s1\ -orient\ horizontal\n\n:s0\ -sticky\ ns\n:s1\ -sticky\ ew\n:t0,f0\n\n|f0\n-f0\n|.\n-.\n\n#\ end\n======\n\[Twig\]\ for\ 'd':\n======none\n#\ Twig\ for\ TkGub\ test\ gui\n21911\ 4\ 66C6D4817EB7CC475DE76AD1DE8CEA4F\n======\nLoading\ into\ GubTool\ with\ Twig:\n======none\necho\ '21911\ 4\ 66C6D4817EB7CC475DE76AD1DE8CEA4F'\ |\ twig\ -c\ -\ |\ gubtool\ -\n======\n----\n**Gub\ Tutorial\ #1**\n======none\nA\ common\ widget\ layout\ is\ a\ frame\ containing\ a\ text\ widget\ connected\ to\ two\ scrollbar\ widgets.\nLooking\ at\ the\ default\ widget\ map,\ we\ can\ see\ that\ 'f'\ is\ \[frame\],\ 't'\ is\ \[text\]\ and\ 's'\ is\ \[scrollbar\].\nNotice\ that\ 'f'\ in\ the\ default\ widget\ map\ has\ 'container'\ in\ its\ 'properties'.\nAll\ widgets\ to\ the\ right\ of\ a\ container\ will\ be\ children\ of\ that\ container.\n\nSo\ we\ make\ this\ little\ gob:\n\nf\ t\ s\n\ \ s\n\nWhich\ will\ make\ 't'\ and\ 's'\ children\ of\ 'f'.\nThe\ 't'\ will\ be\ at\ -row\ 0,\ -column\ 0\ of\ 'f'.\nThe\ first\ 's'\ will\ be\ at\ -row\ 0,\ -column\ 1\ of\ 'f'.\nThe\ second\ 's'\ will\ be\ at\ -row\ 1,\ -column\ 0\ of\ 'f'.\n\nDigression...\n\nGub\ understands\ a\ grid-style\ layout.\nEvery\ widget\ is\ represented\ by\ one\ character\ which\ maps\ to\ a\ widget\ command.\nEvery\ widget\ in\ the\ layout\ is\ two\ columns\ wide\ by\ one\ row\ high.\nThe\ first\ position\ is\ the\ widget\ character,\ the\ second\ is\ a\ single-character\ label.\n\nThe\ wrong\ way\ to\ grid\ two\ rows\ of\ three\ buttons:\n\nbbb\nbbb\n\nThe\ right\ way\ to\ grid\ two\ rows\ of\ three\ buttons:\n\nb\ b\ b\nb\ b\ b\n\nGridding\ two\ rows\ of\ three\ buttons\ with\ single-character\ labels:\n\nbjbkbl\nbxbybz\n\nThis\ tutorial\ will\ not\ go\ into\ further\ detail\ on\ this\ subject\;\ read\ gub_referring.txt\ for\ more\ information.\n\nContinued\ ...\n\nLooking\ at\ the\ default\ widget\ map\ entry\ for\ 't',\ we\ can\ see\ that\ is\ has\ 'scrollable'\ in\ its\ 'properties'.\nLooking\ at\ the\ default\ widget\ map\ entry\ for\ 's',\ we\ can\ see\ that\ is\ has\ 'scroller'\ in\ its\ 'properties'.\nGub\ will\ automatically\ attach\ a\ 'scroller'\ to\ 'scrollable'\ if\ the\ 'scroller'\ is\ immediately\ to\ the\ right\nor\ immediately\ below\ the\ 'scrollable'.\nGub\ will\ also\ set\ the\ orientation\ and\ grid\ options\ of\ the\ 'scroller'\n\nThe\ result\ of\ running\ this\ through\ Gub:\n\ngrid\ \[frame\ .f0\]\ -row\ 0\ -column\ 0\ngrid\ \[text\ .f0.t0\ -xscrollcommand\ \[list\ .f0.s1\ set\]\ -yscrollcommand\ \[list\ .f0.s0\ set\]\]\ -row\ 0\ -column\ 0\ngrid\ \[scrollbar\ .f0.s0\ -orient\ vertical\ -command\ \[list\ .f0.t0\ yview\]\]\ -sticky\ ns\ -row\ 0\ -column\ 1\ngrid\ \[scrollbar\ .f0.s1\ -orient\ horizontal\ -command\ \[list\ .f0.t0\ xview\]\]\ -sticky\ ew\ -row\ 1\ -column\ 0\n\nThis\ is\ nice\ but\ there\ is\ still\ something\ missing:\nWe\ want\ the\ widgets\ to\ change\ size\ when\ the\ toplevel\ is\ resized.\n\nFor\ grid\ options\ we\ use\ the\ ':'\ grid\ operator,\ so\ we\ add:\n\n:t0\n\nWhich\ is\ Gub\ shorthand\ for\ 'grid\ this\ widget\ -sticky\ nsew'.\nWe\ specified\ the\ widget\ as\ 't0'\ which\ is\ the\ first\ 't'.\n\nWe\ could\ have\ written:\n\n:t0\ -sticky\ nsew\n\nWhich\ would\ accomplish\ the\ same\ thing.\nWhen\ no\ grid\ options\ are\ supplied,\ Gub\ will\ automatically\ generate\ '-sticky\ nsew'.\nGub\ tries\ to\ provide\ defaults\ for\ the\ most\ common\ usages.\n\nWe\ also\ need\ to\ row\ and\ column\ configure\ the\ frame\ ('f0').\nFor\ this\ we\ use\ the\ '|'\ columnconfigure\ and\ '-'\ rowconfigure\ operators.\n\n|f0\n-f0\n\nWe\ could\ have\ written:\n\n|f0\ 0\ -weight\ 1\n-f0\ 0\ -weight\ 1\n\nWith\ no\ options,\ these\ operators\ automatically\ generate\ '0\ -weight\ 1'.\nGub\ tries\ to\ provide\ defaults\ for\ the\ most\ common\ usages.\n\nSo\ now\ we\ have:\n\nf\ t\ s\n\ \ s\n:t0\n|f0\n-f0\n\nWhich\ is\ better\ but\ still\ not\ fully\ working.\nWe\ have\ to\ take\ care\ of\ 'f'\ inside\ its\ parent.\nWe\ need\ to\ add:\n\n:f0\n|.\n-.\n\nGub\ treats\ '.'\ as\ the\ parent\ window,\ not\ the\ root\ ('.')\ window.\nIn\ this\ case\ the\ parent\ is\ the\ root.\n\nGub\ expands\ widget\ specifications,\ so\ instead\ of\ writing:\n\n:t0\n:f0\n\nWe\ can\ write\ (order\ unimportant):\n\n:t0,f0\n\nSo\ now\ we\ have:\n\nf\ t\ s\n\ \ s\n:f0,t0\n|.,f0\n-.,f0\n\nWhich\ results\ in\ what\ we\ want:\n\ngrid\ \[frame\ .f0\]\ -sticky\ nsew\ -row\ 0\ -column\ 0\ngrid\ \[text\ .f0.t0\ -xscrollcommand\ \[list\ .f0.s1\ set\]\ -yscrollcommand\ \[list\ .f0.s0\ set\]\]\ -sticky\ nsew\ -row\ 0\ -column\ 0\ngrid\ \[scrollbar\ .f0.s0\ -orient\ vertical\ -command\ \[list\ .f0.t0\ yview\]\]\ -sticky\ ns\ -row\ 0\ -column\ 1\ngrid\ \[scrollbar\ .f0.s1\ -orient\ horizontal\ -command\ \[list\ .f0.t0\ xview\]\]\ -sticky\ ew\ -row\ 1\ -column\ 0\ngrid\ rowconfigure\ .f0\ 0\ -weight\ 1\ngrid\ rowconfigure\ .\ 0\ -weight\ 1\ngrid\ columnconfigure\ .f0\ 0\ -weight\ 1\ngrid\ columnconfigure\ .\ 0\ -weight\ 1\n\nNow\ let's\ add\ a\ few\ things:\ a\ label\ and\ a\ checkbutton\ on\ top,\ a\ button\ on\ the\ bottom\ and\ a\ button\ binding.\nWe'll\ be\ using\ the\ '.'\ property\ operator,\ a\ 'reference'\ (specified\ with\ '//')\nand\ we'll\ have\ to\ change\ some\ of\ the\ row/column\ configures.\nWell\ make\ the\ checkbutton\ change\ the\ word\ wrap\ type\ of\ the\ text\ widget\ and\ the\ button\ exit\ the\ program.\n\nFirst\ let's\ add\ the\ widgets.\nLooking\ at\ the\ default\ widget\ map,\ we\ can\ see\ that\ 'l'\ is\ \[label\],\ 'k'\ is\ \[checkbutton\]\ and\ 'b'\ is\ \[button\].\n\nf\ l\ k\n\ \ t\ s\n\ \ s\nb\n:f0,t0\n|.,f0\n-.,f0\n\nNot\ bad,\ but\ we\ need\ a\ rowconfigure\ adjustment,\ so\ change:\n\n-.,f0\n\nTo:\n\n-.\n-f0\ 1\n\nWith\ a\ single\ option,\ these\ row/column\ configure\ operators\ automatically\ generate\ '-weight\ 1'.\n\nWe\ also\ need\ to\ set\ some\ widget\ options,\ for\ example,\ the\ button\ should\ say\ and\ do\ things.\nFor\ this,\ we\ use\ the\ property\ ('.')\ operator:\n\n.b0\ -text\ Exit\ -command\ exit\n\nAnd\ the\ label\ should\ have\ some\ text:\n\n.l0\ -text\ Input\n\nWe'd\ also\ like\ the\ label\ to\ be\ on\ the\ left\n\n:l0\ -sticky\ w\n\nWe'd\ also\ like\ to\ be\ able\ to\ exit\ on\ a\ kepyress\ so\ let's\ use\ the\ '&'\ binding\ operator:\n\n&b0\ Control+q\n\nThe\ binding\ operator\ works\ differently\ depending\ on\ the\ options\ given.\nWhat\ we're\ asking\ for\ here\ is\ for\ the\ keypress\ to\ invoke\ the\ button's\ -command.\nNotice\ that\ we've\ used\ 'Control+q'\ when\ we'd\ be\ expecting\ to\ see\ 'Control-q'.\nGub\ will\ expand\ bindings\ that\ contain\ '+'\ into\ both\ upper\ and\ lower\ case.\nThe\ above\ gob\ will\ generate:\n\nbind\ .\ <Control-q>\ \".b0\ invoke\"\nbind\ .\ <Control-Q>\ \".b0\ invoke\"\n\nLastly,\ let's\ have\ the\ checkbutton\ control\ the\ word\ wrap\ mode\ of\ the\ text\ widget.\nFor\ this\ we\ need\ a\ 'reference'\ which\ is\ a\ widget\ spec\ in\ slashes.\nThe\ 'reference'\ will\ be\ replaced\ by\ the\ actual\ widget\ name.\nAlso,\ we\ don't\ want\ the\ checkbutton\ to\ take\ focus:\n\n.k0\ -takefocus\ 0\ -command\ \{/t0/\ configure\ -wrap\ \[expr\ \{\[/t0/\ cget\ -wrap\]\ eq\ \"none\"\ ?\ \"word\"\ :\ \"none\"\}\]\}\n\nLet's\ also\ add\ a\ binding:\n\n&k0\ Alt+w\n\nPutting\ it\ all\ together,\ we\ have:\n\nf\ l\ k\n\ \ t\ s\n\ \ s\nb\n.l0\ -text\ Input\n.b0\ -text\ Exit\ -command\ exit\n.k0\ -takefocus\ 0\ -command\ \{/t0/\ configure\ -wrap\ \[expr\ \{\[/t0/\ cget\ -wrap\]\ eq\ \"none\"\ ?\ \"word\"\ :\ \"none\"\}\]\}\n:l0\ -sticky\ w\n:f0,t0\n|.,f0\n-.\n-f0\ 1\n&b0\ Control+q\n&k0\ Alt+w\n\nRunning\ this\ through\ Gub\ gives:\n\ngrid\ \[frame\ .f0\]\ -sticky\ nsew\ -row\ 0\ -column\ 0\ngrid\ \[label\ .f0.l0\ -text\ Input\]\ -sticky\ w\ -row\ 0\ -column\ 0\ngrid\ \[checkbutton\ .f0.k0\ -command\ \{.f0.t0\ configure\ -wrap\ \[expr\ \{\[.f0.t0\ cget\ -wrap\]\ eq\ \"none\"\ ?\ \"word\"\ :\ \"none\"\}\]\}\ -takefocus\ 0\]\ -row\ 0\ -column\ 1\ngrid\ \[text\ .f0.t0\ -xscrollcommand\ \[list\ .f0.s1\ set\]\ -yscrollcommand\ \[list\ .f0.s0\ set\]\]\ -sticky\ nsew\ -row\ 1\ -column\ 0\ngrid\ \[scrollbar\ .f0.s0\ -orient\ vertical\ -command\ \[list\ .f0.t0\ yview\]\]\ -sticky\ ns\ -row\ 1\ -column\ 1\ngrid\ \[scrollbar\ .f0.s1\ -orient\ horizontal\ -command\ \[list\ .f0.t0\ xview\]\]\ -sticky\ ew\ -row\ 2\ -column\ 0\ngrid\ \[button\ .b0\ -command\ exit\ -text\ Exit\]\ -row\ 1\ -column\ 0\ngrid\ rowconfigure\ .f0\ 1\ -weight\ 1\ngrid\ rowconfigure\ .\ 0\ -weight\ 1\ngrid\ columnconfigure\ .f0\ 0\ -weight\ 1\ngrid\ columnconfigure\ .\ 0\ -weight\ 1\nbind\ .\ <Control-q>\ \".b0\ invoke\"\nbind\ .\ <Control-Q>\ \".b0\ invoke\"\nbind\ .\ <Alt-w>\ \".f0.k0\ invoke\"\nbind\ .\ <Alt-W>\ \".f0.k0\ invoke\"\n\n\nNotice\ that\ we\ didn't\ have\ to\ fiddle\ with\ widget\ paths\ or\ rows\ and\ columns.\nGub\ does\ a\ lot\ of\ the\ drudge\ work\ for\ us.\n======\n----\n**Gub\ Tutorial\ #2**\n======none\nLet's\ build\ something!\nA\ directory\ and\ file\ browser.\n\nWhat\ we\ need:\nA\ treeview\ widget\ for\ directory\ names.\nA\ treeview\ widget\ for\ directory\ contents.\nA\ text\ widget\ for\ file\ contents.\nPanedwindows,\ scrollbars,\ etc.\n\nLayout:\n+--------------------------+\n|\ dir\ names\ |\ dir\ contents\ |\n+--------------------------+\n|\ \ \ \ \ \ file\ contents\ \ \ \ \ \ \ |\n+--------------------------+\n\nWe'll\ use\ Ttk\ widgets.\nCheck\ the\ standard\ Tk\ widget\ map\ for\ details.\n\nLet's\ start\ with\ a\ treeview\ and\ scrollbars:\nV\ S\nS\n\nEasy-peasy.\n\nAnd\ a\ text\ widget\ with\ scrollbars:\nt\ S\nS\n\nNotice\ we're\ mixing\ Tk\ and\ Ttk.\ That's\ ok.\n\nNow\ let's\ put\ things\ into\ panedwindows.\nWe'll\ need\ two\;\ one\ horizontal\ for\ the\ntext\ and\ second\ panedwindow,\ and\ the\nsecond\ panedwindow\ for\ the\ two\ treeviews.\n\nReferencing\ the\ standard\ Tk\ widget\ map\nwe\ can\ see\ that\ a\ panedwindow\ has\ a\nproperty\ of\ 'adder'.\ An\ adder\ is\ a\ form\nof\ container\ with\ the\ difference\ that\nwidgets\ are\ added\ whereas\ with\ containers\nthey\ are\ gridded.\n\nLet's\ start\ simple,\ with\ one\ panedwindow\ncontaining\ the\ two\ treeviews.\nWe'll\ need\ to\ put\ the\ treeviews\ and\ their\ncorresponding\ scrollbars\ into\ frames\ so\nthat\ we\ can\ set\ up\ the\ grid\ parameters\nneeded\ to\ make\ things\ nice.\ Also,\ a\npanedwindow\ can\ only\ add\ one\ thing\ into\nany\ one\ pane\ (I\ think).\n\nOk,\ so\ one\ Ttk\ frame\ containing\ a\ treeview\nand\ two\ Ttk\ scrollbars:\nF\ V\ S\n\ \ S\n\nAdding\ that\ to\ a\ panedwindow:\nP\ F\ V\ S\n\ \ \ \ S\n\nAdding\ two\ sets\ of\ frame/treeview/scrollbars:\nP\ F\ V\ S\n\ \ \ \ S\n\ \ F\ V\ S\n\ \ \ \ S\n\nPutting\ that\ into\ another\ panedwindow,\ and\ adding\na\ frame/text/scrollbars\ to\ the\ other\ panedwindow:\nP\ P\ F\ V\ S\n\ \ \ \ \ \ S\n\ \ \ \ F\ V\ S\n\ \ \ \ \ \ S\n\ \ F\ t\ S\n\ \ \ \ S\n\nThat's\ our\ layout!\n\nWe\ can\ paste\ that\ into\ GubTool\ and\ see\ that\nwe\ do\ indeed\ get\ our\ widgets.\n\nNow\ we\ need\ to\ make\ some\ adjustments.\n\nThe\ inner\ panedwindow\ needs\ to\ be\ horizontal\nso\ using\ the\ '.'\ (properties)\ operator:\n.P1\ -orient\ horizontal\n\nNow\ we\ need\ to\ take\ care\ of\ gridding.\nWe\ want\ to\ grid\ -sticky\ nsew\ the\ outer\npanedwindow,\ the\ two\ treeviews\ and\ the\ntext\ widget:\n:P0,V0,1,t0\n\nAlso,\ we\ want\ to\ row\ and\ column\ configure\nthe\ main\ window\ and\ all\ Ttk\ frames.\n-.,F\n|.,F\n\nOnce\ we've\ created\ all\ these\ widgets\nwe'll\ only\ really\ need\ to\ work\ with\nthree\ of\ them:\ the\ two\ treeviews\nand\ the\ text\ widget.\n\nWe'll\ use\ the\ '/'\ (save)\ operator\nand\ give\ our\ widgets\ names:\n/V0\ dirs\n/V1\ files\n/t0\ text\n\nBy\ default,\ widgets\ are\ saved\ in\na\ dict\ named\ 'gui'.\n\nThis\ is\ all\ well\ and\ good\ but\ now\nlet's\ look\ at\ using\ Gub\ in\ a\ program.\n\nRemember:\nGub\ splits\ input\ into\ lines\ on\ semicolons\ and\ newlines.\nLeading\ tabs\ are\ stripped.\nGub\ returns\ a\ script.\n\nA\ simple\ invocation,\ creating\ a\nlabel\ and\ an\ entry:\neval\ \[gub\ \"l\ e\"\]\n\nHere's\ how\ I\ like\ to\ write\ Gub-using\ code,\nshowing\ a\ frame\ containing\ two\ buttons:\neval\ \[gub\ \"\n\ \ \ \ \ \ \ \ F\ B\n\ \ \ \ \ \ \ \ \ \ B\n\"\]\n\nI\ consider\ this\ to\ be\ a\ bit\ dangerous\nsince\ a\ change\ in\ whitespace\ can\ndisrupt\ the\ layout,\ so\ I\ use\ semicolons:\neval\ \[gub\ \"\n\ \ \ \ \ \ \ \ \;F\ B\n\ \ \ \ \ \ \ \ \;\ \ B\n\"\]\n\nThe\ above\ could\ also\ be\ written\ as:\neval\ \[gub\ \"F\ B\;\ \ B\"\]\n\nHere's\ our\ complete\ file\ browser\ gui\ in\ a\ program,\nnotice\ how\ using\ semicolons\ also\ lines\ up\ the\nlayout\ and\ the\ operators\ for\ improved\ clarity:\n\neval\ \[gub\ \"\n\ \ \ \ \ \ \ \ \;P\ P\ F\ V\ S\n\ \ \ \ \ \ \ \ \;\ \ \ \ \ \ S\n\ \ \ \ \ \ \ \ \;\ \ \ \ F\ V\ S\n\ \ \ \ \ \ \ \ \;\ \ \ \ \ \ S\n\ \ \ \ \ \ \ \ \;\ \ F\ t\ S\n\ \ \ \ \ \ \ \ \;\ \ \ \ S\n\ \ \ \ \ \ \ \ .P1\ -orient\ horizontal\n\ \ \ \ \ \ \ \ :P0,V0,1,t0\n\ \ \ \ \ \ \ \ -.,F\ \;\ |.,F\n\ \ \ \ \ \ \ \ /V0\ dirs\n\ \ \ \ \ \ \ \ /V1\ files\n\ \ \ \ \ \ \ \ /t0\ text\n\"\]\n\nNotice\ that\ the\ row\ and\ column\ configures\nare\ on\ the\ same\ line,\ separated\ by\ semicolons.\nThis\ is\ a\ matter\ of\ taste.\n\nAfter\ running\ this\ we\ now\ have\ our\ dict\ with\nthe\ saved\ widgets.\ No\ more\ setting\ up\ or\ trying\nto\ keep\ track\ of\ widget\ path\ names\ with\ Gub!\n%\ set\ gui\ndirs\ .p0.p1.f0.v0\ files\ .p0.p1.f1.v1\ text\ .p0.f2.t0\n\nAnd\ we\ can\ use\ it,\ of\ course:\n\[dict\ get\ \$gui\ text\]\ insert\ end\ Gub!\n\nOne\ last\ thing\ to\ mention\ is\ how\ the\ '&'\ binding\noperator\ can\ be\ helpful\ here:\n&V0\ <<TreeviewSelect>>\ mySelector\n\nThat's\ the\ end\ of\ this\ tutorial.\nActually\ writing\ the\ code\ for\ a\ working\ file\ browser\nprogram\ is\ left\ as\ an\ exercise\ for\ the\ reader.\ :)\n\nAddendum.\nWith\ comments:\neval\ \[gub\ \"\n\ \ \ \ \ \ \ \ \;P\ P\ F\ V\ S\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \;#\ Gui\ layout\ for\n\ \ \ \ \ \ \ \ \;\ \ \ \ \ \ S\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \;#\ file\ browser\n\ \ \ \ \ \ \ \ \;\ \ \ \ F\ V\ S\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \;#\n\ \ \ \ \ \ \ \ \;\ \ \ \ \ \ S\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \;#\ Strange\ how\ these\ comments\n\ \ \ \ \ \ \ \ \;\ \ F\ t\ S\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \;#\ make\ this\ look\ like\ assembly\ code\n\ \ \ \ \ \ \ \ \;\ \ \ \ S\n\ \ \ \ \ \ \ \ .P1\ -orient\ horizontal\ \ \ \ \;#\ Relax\n\ \ \ \ \ \ \ \ :P0,V0,1,t0\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \;#\ Grid\ 'em\ good\n\ \ \ \ \ \ \ \ -.,F\ \;\ |.,F\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \;#\ Make\ sure\ things'll\ stretch\n\ \ \ \ \ \ \ \ /V0\ dirs\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \;#\ We'll\ need\ these\ for\ later\n\ \ \ \ \ \ \ \ /V1\ files\n\ \ \ \ \ \ \ \ /t0\ text\n\"\]\n======\n----\nOld\ code:\n\n**Gub**\n======\n#!\ /bin/sh\n#\ \\\nexec\ tclsh\ \"\$0\"\ \$\{1+\"\$@\"\}\n\n#\n#\ Gub\ -\ GUiBuilder\n#\n#\ Stuart\ Cassoff\n#\ Fall/Winter\ 2008\n#\n#\ Version\ 0.3\n#\n#\n#\ \"I\ have\ a\ gub.\"\ -\ Woody\ Allen\n#\n\n\nnamespace\ eval\ gub\ \{\n\npackage\ provide\ gub\ 0.3\n\nnamespace\ export\ gub\ gubParse\ gubAssemble\ gubProc\n\n\n\n#\n#\n#\nproc\ gub\ \{gob\ \{var\ \{gui\}\}\}\ \{\n\ \ \ \ \ \ \ \ return\ \[join\ \[gubAssemble\ \{*\}\[gubParse\ \$gob\]\ \$var\]\ \\n\]\n\}\n###\n\n\n\n#\n#\n#\nproc\ gubParse\ \{gob\}\ \{\n\ \ \ \ \ \ \ \ array\ set\ W\ \[list\ b\ button\ c\ canvas\ k\ checkbutton\ e\ entry\ f\ frame\ l\ label\ \\\n\ \ \ \ \ \ \ \ m\ labelframe\ o\ listbox\ p\ panedwindow\ r\ radiobutton\ a\ scale\ s\ scrollbar\ \\\n\ \ \ \ \ \ \ \ i\ spinbox\ t\ text\ B\ ttk::button\ K\ ttk::checkbutton\ X\ ttk::combobox\ E\ ttk::entry\ \\\n\ \ \ \ \ \ \ \ F\ ttk::frame\ L\ ttk::label\ M\ ttk::labelframe\ N\ ttk::notebook\ P\ ttk::panedwindow\ \\\n\ \ \ \ \ \ \ \ R\ ttk::radiobutton\ A\ ttk::scale\ S\ ttk::scrollbar\ V\ ttk::treeview\]\n\n\ \ \ \ \ \ \ \ set\ containers\ \[list\ f\ F\ m\ M\]\n\ \ \ \ \ \ \ \ foreach\ w\ \[array\ names\ W\]\ \{\ set\ N(\[string\ tolower\ \$w\])\ -1\ \}\n\ \ \ \ \ \ \ \ foreach\ a\ \{N\ C\ R\ S\ P\ G\ V\ H\ X\}\ \{\ array\ set\ \$a\ \{\}\ \}\n\ \ \ \ \ \ \ \ array\ set\ wigs\ \{.\ \{\}\}\n\ \ \ \ \ \ \ \ set\ todo\ \{\}\n\n\ \ \ \ \ \ \ \ foreach\ l\ \[split\ \$gob\ \\n\]\ \{\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ set\ ll\ \[string\ trimleft\ \[set\ l\ \[string\ trimright\ \$l\]\]\]\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ if\ \{\$ll\ eq\ \"\"\ ||\ \[string\ index\ \$ll\ 0\]\ eq\ \"#\"\}\ \{\ continue\ \}\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ foreach\ l\ \[split\ \$l\ \\\;\]\ \{\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ set\ ll\ \[string\ trimleft\ \[set\ l\ \[string\ trimright\ \$l\]\]\]\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ if\ \{\[set\ c\ \[string\ index\ \$ll\ 0\]\]\ ni\ \{/\ =\ ^\ !\ .\ :\ -\ |\}\}\ \{\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ if\ \{\[string\ length\ \$l\]\ %\ 2\ !=\ 0\}\ \{\ append\ l\ \"\ \"\ \}\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ lappend\ todo\ \$l\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ continue\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \}\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ if\ \{\[set\ i\ \[string\ first\ \"\ \"\ \$ll\]\]\ ==\ -1\}\ \{\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ set\ n\ \[string\ range\ \$ll\ 1\ end\]\n\ \ \ \ \ \ \ \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\ \ \ \ \ \ \}\n\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ if\ \{!\[info\ exists\ W(\$c)\]\}\ \{\ continue\ \}\ \;#meh\n\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ #\ \ \ \ \ \ \ \ \ \ \ \ command\ window\ options\ element\ gridoptions\ row\ col\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ set\ dd\ \[list\ \"\"\ \ \ \ \ \ \"\"\ \ \ \ \ \"\"\ \ \ \ \ \ \"\"\ \ \ \ \ \ \"\"\ \ \ \ \ \ \ \ \ \ -1\ \ -1\]\n\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ lset\ dd\ 0\ \$W(\$c)\n\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ set\ wig\ .\$in\[set\ lc\ \[string\ tolower\ \$c\]\]\[set\ n\ \[incr\ N(\$lc)\]\]\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ lset\ dd\ 1\ \$wig\n\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ set\ wigs(\$c\$n)\ \$wig\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ if\ \{\$m\ ne\ \"\"\ &&\ \$m\ ne\ \"\ \"\}\ \{\ set\ wigs(\$c\$m)\ \$wig\ \}\n\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ set\ these\ \[list\ all\ \$c\]\;\ if\ \{\$m\ ne\ \"\"\ &&\ \$m\ ne\ \"\ \"\}\ \{\ lappend\ these\ \$c\$m\ \}\;\ lappend\ these\ \$c\$n\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ foreach\ a\ \{p\ g\}\ A\ \{P\ G\}\ i\ \{2\ 4\}\ \{\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ unset\ -nocomplain\ \$a\;\ array\ set\ \$a\ \{\}\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ foreach\ what\ \$these\ \{\ if\ \{\[info\ exists\ \$\{A\}(\$what)\]\}\ \{\ array\ set\ \$a\ \[set\ \$\{A\}(\$what)\]\ \}\ \}\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ if\ \{\[llength\ \[array\ names\ \$a\]\]\ >\ 0\}\ \{\ lset\ dd\ \$i\ \[array\ get\ \$a\]\ \}\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \}\n\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ set\ those\ \[list\ \$c\$n\]\;\ if\ \{\$m\ ne\ \"\"\ &&\ \$m\ ne\ \"\ \"\}\ \{\ lappend\ those\ \$c\$m\ \}\;\ lappend\ those\ \$c\ all\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ foreach\ what\ \$those\ \{\ if\ \{\[info\ exists\ S(\$what)\]\}\ \{\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ if\ \{\$S(\$what)\ eq\ \"\"\}\ \{\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ if\ \{\$what\ eq\ \"all\"\ ||\ \$what\ eq\ \$c\}\ \{\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ set\ name\ \$c\$n\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \}\ else\ \{\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ set\ name\ \$what\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \}\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \}\ else\ \{\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ set\ name\ \$S(\$what)\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \}\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ lset\ dd\ 3\ \$name\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ break\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \}\}\n\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ lset\ dd\ 5\ \$row\;\ lset\ dd\ 6\ \$col\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ lappend\ weegs\ \$dd\n\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ set\ container\ false\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ if\ \{\$c\ in\ \$containers\}\ \{\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ set\ container\ true\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ foreach\ what\ \$those\ \{\ if\ \{\[info\ exists\ X(\$what)\]\}\ \{\ set\ container\ false\;\ break\ \}\ \}\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \}\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ if\ \{\$container\}\ \{\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ lappend\ z\ \[list\ \$in\ \$row\ \$col\]\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ set\ in\ \$in\[string\ tolower\ \$c\]\$n.\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ set\ row\ 0\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ set\ col\ 0\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \}\ else\ \{\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ incr\ col\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \}\n\ \ \ \ \ \ \ \ \}\}\n\n\ \ \ \ \ \ \ \ foreach\ a\ \{H\ V\}\ q\ \{x\ y\}\ \{\ foreach\ \{k\ v\}\ \[array\ get\ \$a\]\ \{\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ if\ \{\[set\ ki\ \[lsearch\ -index\ 1\ \$weegs\ \$wigs(\$k)\]\]\ ==\ -1\ ||\ \[set\ vi\ \[lsearch\ -index\ 1\ \$weegs\ \$wigs(\$v)\]\]\ ==\ -1\}\ \{\ continue\ \}\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ lset\ weegs\ \$ki\ \[linsert\ \[lindex\ \$weegs\ \$ki\]\ end\ -command\ \$wigs(\$v)\ \$\{q\}view\]\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ lset\ weegs\ \$vi\ \[linsert\ \[lindex\ \$weegs\ \$vi\]\ end\ -\$\{q\}scrollcommand\ \$wigs(\$k)\ set\]\n\ \ \ \ \ \ \ \ \}\}\n\n\ \ \ \ \ \ \ \ foreach\ a\ \{R\ C\}\ q\ \{row\ column\}\ \{\ foreach\ \{k\ v\}\ \[array\ get\ \$a\]\ \{\ foreach\ o\ \$v\ \{\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ if\ \{!\[info\ exists\ wigs(\$k)\]\}\ \{\ continue\ \}\ \;#meh\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ lappend\ rccs\ \[list\ \$\{q\}configure\ \$wigs(\$k)\ \$o\]\n\ \ \ \ \ \ \ \ \}\}\}\n\n\ \ \ \ \ \ \ \ return\ \[list\ \$weegs\ \$rccs\]\n\}\n###\n\n\n\n#\n#\n#\nproc\ gubAssemble\ \{weegs\ \{rccs\ \{\}\}\ \{var\ \{gui\}\}\}\ \{\n\ \ \ \ \ \ \ \ set\ zz\ \{\}\n\ \ \ \ \ \ \ \ foreach\ weeg\ \$weegs\ \{\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ set\ links\ \[lassign\ \$weeg\ command\ window\ options\ element\ gridoptions\ row\ col\]\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ set\ z\ grid\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ if\ \{\$element\ ne\ \"\"\}\ \{\ append\ z\ \"\ \"\ \"\\\[set\ \$\{var\}(\$element)\"\ \}\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ append\ z\ \"\ \"\ \"\\\[\"\ \$command\ \"\ \"\ \\\$w\$window\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ if\ \{\$options\ ne\ \"\"\}\ \{\ append\ z\ \"\ \"\ \$options\ \}\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ foreach\ \{opt\ win\ cmd\}\ \$links\ \{\ append\ z\ \"\ \"\ \$opt\ \"\ \"\ \"\\\[list\ \\\$w\$win\ \$cmd\]\"\ \}\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ if\ \{\$element\ ne\ \"\"\}\ \{\ append\ z\ \"\]\"\ \}\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ append\ z\ \"\]\"\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ if\ \{\$gridoptions\ ne\ \"\"\}\ \{\ append\ z\ \"\ \"\ \$gridoptions\ \}\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ if\ \{\$row\ !=\ -1\}\ \{\ append\ z\ \"\ \"\ -row\ \"\ \"\ \$row\ \}\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ if\ \{\$col\ !=\ -1\}\ \{\ append\ z\ \"\ \"\ -column\ \"\ \"\ \$col\ \}\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ lappend\ zz\ \$z\n\ \ \ \ \ \ \ \ \}\n\n\ \ \ \ \ \ \ \ foreach\ rcc\ \$rccs\ \{\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ lassign\ \$rcc\ command\ window\ options\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ set\ z\ grid\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ lappend\ zz\ \[append\ z\ \"\ \"\ \$command\ \"\ \"\ \\\$W\$window\ \"\ \"\ \$options\]\n\ \ \ \ \ \ \ \ \}\n\n\ \ \ \ \ \ \ \ return\ \$zz\n\}\n###\n\n\n\n#\n#\n#\nproc\ gubProc\ \{blob\ \{name\ \{widget\}\}\ \{var\ \{gui\}\}\}\ \{\n\ \ \ \ \ \ \ \ return\ \[regsub\ -line\ -all\ \{^\\t\$\}\ \[join\ \[list\ \"proc\ \$name\ \{\{w\ \{.\}\}\}\ \\\{\"\ \{set\ W\ \$w\;\ if\ \{\$w\ eq\ \".\"\}\ \{set\ w\ \"\"\}\}\ \"variable\ \$var\"\ \"\"\ \[join\ \[split\ \$blob\ \\n\]\ \\n\\t\]\ \"\"\ \{return\ \$W\}\]\ \\n\\t\]\\n\\\}\ \{\}\]\n\}\n###\n\n\n\}\;\ #\ End\ of\ gub\ namespace\n\n#\ EOF\n======\n\n**TkGub**\n======\n#!\ /bin/sh\n#\ \\\nexec\ tclsh\ \"\$0\"\ \$\{1+\"\$@\"\}\n\n#\n#\ TkGub\ -\ GUI\ frontend\ to\ Gub\n#\n#\ Stuart\ Cassoff\n#\ Fall/Winter\ 2008\n#\n#\ Version\ 0.3\n#\n\n\nnamespace\ eval\ tkgub\ \{\n\npackage\ require\ Tk\npackage\ require\ Ttk\npackage\ require\ gub\nnamespace\ import\ ::gub::*\n\n\n\n#\n#\n#\nproc\ gui\ \{\}\ \{\n\ \ \ \ \ \ \ \ variable\ cfg\n\ \ \ \ \ \ \ \ variable\ gui\n\n\ \ \ \ \ \ \ \ set\ w\ \[set\ gui(w)\ \{\}\]\n\ \ \ \ \ \ \ \ set\ W\ \[set\ gui(W)\ \$w.\]\n\n\ \ \ \ \ \ \ \ set\ gui(auto)\ 1\n\ \ \ \ \ \ \ \ eval\ \[gub\ \"f\ k\ b\\np\;.k0\ -text\ Auto\;.b0\ -text\ Go\;.p0\ -orient\ vertical\ -showhandle\ 1\;.k0\ -variable\ \[namespace\ current\]::gui(auto)\;:\;/p0\ mainPane\;/b0\ goButton\;/k0\;|.\;-.\ 1\ -weight\ 1\"\]\n\ \ \ \ \ \ \ \ \$gui(goButton)\ configure\ -command\ \[list\ \[namespace\ current\]::gubrun\ no\]\n\ \ \ \ \ \ \ \ \$gui(k0)\ configure\ -command\ \[namespace\ current\]::gubrun\n\ \ \ \ \ \ \ \ foreach\ what\ \{in\ run\}\ \{\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \$gui(mainPane)\ add\ \[set\ f\ \[labelframe\ \$gui(mainPane).f\$what\ -text\ \[string\ totitle\ \$what\]\]\]\ -sticky\ nsew\ -stretch\ always\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \{*\}\[gubProc\ \[gub\ \"\nt\ s\ns\n\n.t\ -height\ 10\ -wrap\ none\n.s1\ -orient\ horizontal\n\n^s0\ t0\ \;\ =s1\ t0\n\n:s0\ -sticky\ ns\n:s1\ -sticky\ ew\n:t\n\n|.\;-.\n\ \n/t0\ \$what\n\"\]\]\;widget\ \$f\n\ \ \ \ \ \ \ \ \}\n\n\ \ \ \ \ \ \ \ set\ M\ \[menu\ \$w.mMain\ -tearoff\ 0\]\n\ \ \ \ \ \ \ \ set\ menu\ file\n\ \ \ \ \ \ \ \ set\ mm\ \[menu\ \$M.\$menu\ -tearoff\ 0\]\n\ \ \ \ \ \ \ \ \$mm\ add\ command\ -label\ Load\ -command\ \[namespace\ current\]::Load\n\ \ \ \ \ \ \ \ \$mm\ add\ command\ -label\ Save\ -command\ \[namespace\ current\]::Save\n\ \ \ \ \ \ \ \ \$mm\ add\ command\ -label\ Exit\ -command\ exit\n\ \ \ \ \ \ \ \ \$M\ add\ cascade\ -label\ \[string\ totitle\ \$menu\]\ -menu\ \$mm\n\ \ \ \ \ \ \ \ set\ menu\ help\n\ \ \ \ \ \ \ \ set\ mm\ \[menu\ \$M.\$menu\ -tearoff\ 0\]\n\ \ \ \ \ \ \ \ \$mm\ add\ command\ -label\ About\ -command\ \[namespace\ current\]::about\n\ \ \ \ \ \ \ \ \$mm\ add\ command\ -label\ Readme\ -command\ \[namespace\ current\]::readme\n\ \ \ \ \ \ \ \ \$M\ add\ cascade\ -label\ \[string\ totitle\ \$menu\]\ -menu\ \$mm\n\n\ \ \ \ \ \ \ \ foreach\ t\ \{in\ run\}\ \{\ bind\ \$gui(\$t)\ <Control-Return>\ \[namespace\ current\]::run\\\;break\ \}\n\n\ \ \ \ \ \ \ \ bind\ a\ <Key>\ \[namespace\ current\]::gubrun\n\ \ \ \ \ \ \ \ bind\ a\ <Control-Return>\ \[namespace\ current\]::gubrun\\\;break\n\ \ \ \ \ \ \ \ bind\ b\ <Control-Return>\ \[namespace\ current\]::run\\\;break\n\ \ \ \ \ \ \ \ bindtags\ \$gui(in)\ \ \[linsert\ \[bindtags\ \$gui(in)\]\ end\ a\]\n\ \ \ \ \ \ \ \ bindtags\ \$gui(run)\ \[linsert\ \[bindtags\ \$gui(in)\]\ end\ b\]\n\n\ \ \ \ \ \ \ \ bind\ \$W\ <Control-q>\ exit\;\ bind\ \$W\ <Control-Q>\ exit\n\n\ \ \ \ \ \ \ \ bind\ \$W\ <Button-3>\ \[list\ \[namespace\ current\]::domenu\ %W\ \[mwowm\ \$w\]\ %X\ %Y\]\n\n\ \ \ \ \ \ \ \ \$W\ configure\ -menu\ \$M\n\n\ \ \ \ \ \ \ \ wm\ title\ \$W\ \$cfg(fullname)\n\n\ \ \ \ \ \ \ \ focus\ \$gui(in)\n\}\n###\n\n\n\n#\n#\n#\nproc\ mwowm\ \{w\}\ \{\n\ \ \ \ \ \ \ \ set\ M\ \[menu\ \$w.moptions\ -tearoff\ 0\]\n\ \ \ \ \ \ \ \ foreach\ widgets\ \[list\ \\\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \[list\ button\ canvas\ checkbutton\ entry\ frame\ label\ labelframe\ \\\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ listbox\ radiobutton\ scale\ scrollbar\ spinbox\ text\]\ \\\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \[list\ ttk_button\ ttk_checkbutton\ ttk_combobox\ ttk_entry\ \\\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ ttk_frame\ ttk_label\ ttk_labelframe\ ttk_notebook\ \\\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ ttk_radiobutton\ ttk_scale\ ttk_scrollbar\ ttk_treeview\]\ \\\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \]\ tk\ \{Tk\ Ttk\}\ \{\n\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ unset\ -nocomplain\ z\;\ array\ set\ z\ \{\}\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ foreach\ wg\ \$widgets\ \{\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \[string\ map\ \{_\ ::\}\ \$wg\]\ .wg\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ foreach\ ol\ \[.wg\ configure\]\ \{\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ lappend\ z(\[lindex\ \$ol\ 0\])\ \$wg\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \}\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ destroy\ .wg\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \}\n\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ foreach\ wg\ \[linsert\ \$widgets\ 0\ common\]\ \{\ set\ \$wg\ \{\}\ \}\n\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ foreach\ o\ \[lsort\ \[array\ names\ z\]\]\ \{\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ if\ \{\[llength\ \$z(\$o)\]\ ==\ \[llength\ \$widgets\]\}\ \{\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ lappend\ common\ \$o\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \}\ else\ \{\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ foreach\ wg\ \$z(\$o)\ \{\ lappend\ \$wg\ \$o\ \}\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \}\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \}\n\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ set\ mm\ \[menu\ \$M.m\$tk\ -tearoff\ 0\]\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \$M\ add\ cascade\ -label\ \$tk\ -menu\ \$mm\n\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ foreach\ wg\ \[linsert\ \$widgets\ 0\ common\]\ \{\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ set\ m\ \[menu\ \$mm.m\$wg\ -tearoff\ 0\]\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ foreach\ i\ \[set\ \$wg\]\ \{\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \$m\ add\ command\ -label\ \[string\ totitle\ \$i\]\ -command\ \[list\ \[namespace\ current\]::insert\ \$i\]\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \}\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \$mm\ add\ cascade\ -label\ \[string\ totitle\ \$wg\]\ -menu\ \$m\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \}\n\ \ \ \ \ \ \ \ \}\n\n\ \ \ \ \ \ \ \ catch\ \{grid\ .\ -banana\ yellow\}\ cow\n\ \ \ \ \ \ \ \ foreach\ moo\ \[split\ \$cow\ ,\]\ \{\ lappend\ grid\ \[lindex\ \[regexp\ -inline\ \{^.*(-.+)\$\}\ \$moo\]\ 1\]\ \}\n\ \ \ \ \ \ \ \ set\ wg\ grid\n\ \ \ \ \ \ \ \ set\ m\ \[menu\ \$M.m\$wg\ -tearoff\ 0\]\n\ \ \ \ \ \ \ \ foreach\ i\ \[set\ \$wg\]\ \{\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \$m\ add\ command\ -label\ \[string\ totitle\ \$i\]\ -command\ \[list\ \[namespace\ current\]::insert\ \$i\]\n\ \ \ \ \ \ \ \ \}\n\ \ \ \ \ \ \ \ \$M\ add\ cascade\ -label\ \[string\ totitle\ \$wg\]\ -menu\ \$m\n\ \ \ \ \ \ \ \ catch\ \{grid\ rowconfigure\ .\ 0\ -banana\}\ cow\n\ \ \ \ \ \ \ \ foreach\ moo\ \[split\ \$cow\ ,\]\ \{\ lappend\ gridrcc\ \[lindex\ \[regexp\ -inline\ \{^.*(-.+)\$\}\ \$moo\]\ 1\]\ \}\n\ \ \ \ \ \ \ \ set\ wg\ gridrcc\n\ \ \ \ \ \ \ \ set\ mm\ \[menu\ \$m.m\$wg\ -tearoff\ 0\]\n\ \ \ \ \ \ \ \ foreach\ i\ \[set\ \$wg\]\ \{\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \$mm\ add\ command\ -label\ \[string\ totitle\ \$i\]\ -command\ \[list\ \[namespace\ current\]::insert\ \$i\]\n\ \ \ \ \ \ \ \ \}\n\ \ \ \ \ \ \ \ \$m\ add\ cascade\ -label\ RowColConf\ -menu\ \$mm\n\n\ \ \ \ \ \ \ \ return\ \$M\n\}\n###\n\n\n\n#\n#\n#\nproc\ insert\ \{what\}\ \{\n\ \ \ \ \ \ \ \ variable\ where\n\ \ \ \ \ \ \ \ \$where\ insert\ insert\ \"\$what\ \"\n\}\n###\n\n\n\n#\n#\n#\nproc\ domenu\ \{w\ m\ x\ y\}\ \{\n\ \ \ \ \ \ \ \ variable\ where\ \$w\n\ \ \ \ \ \ \ \ tk_popup\ \$m\ \$x\ \$y\n\}\n###\n\n\n\n#\n#\n#\nproc\ about\ \{\}\ \{\n\ \ \ \ \ \ \ \ variable\ cfg\n\ \ \ \ \ \ \ \ catch\ \{destroy\ .q\}\n\ \ \ \ \ \ \ \ wm\ group\ \[toplevel\ .q\]\ .\n\ \ \ \ \ \ \ \ \{*\}\[gubProc\ \[gub\ \"l\\nl\\nl\\nb\n.l0\ -text\ \{\$cfg(fullname)\}\n.l1\ -text\ \{\$cfg(author)\}\n.l2\ -text\ \{\$cfg(when)\}\n.b0\ -text\ Ok\ -command\ \{destroy\ .q\}\n/b0\ ok\n\"\ aboot\]\ widget\ aboot\]\n\ \ \ \ \ \ \ \ widget\ .q\n\ \ \ \ \ \ \ \ wm\ title\ .q\ \"\$cfg(fullname)\ -\ About\"\n\ \ \ \ \ \ \ \ ::tk::PlaceWindow\ .q\ widget\ .\n\ \ \ \ \ \ \ \ variable\ aboot\n\ \ \ \ \ \ \ \ focus\ \$aboot(ok)\n\ \ \ \ \ \ \ \ unset\ aboot\n\}\n###\n\n\n\n#\n#\n#\nproc\ readme\ \{\}\ \{\n\ \ \ \ \ \ \ \ variable\ cfg\n\ \ \ \ \ \ \ \ set\ var\ readmeGUI\n\ \ \ \ \ \ \ \ catch\ \{destroy\ .q\}\n\ \ \ \ \ \ \ \ wm\ group\ \[toplevel\ .q\]\ .\n\ \ \ \ \ \ \ \ \{*\}\[gubProc\ \[gub\ \"\nf\ t\ s\n\ \ s\nb\n.b0\ -text\ Ok\ -command\ \{destroy\ .q\}\n.t0\ -wrap\ none\n.s1\ -orient\ horizontal\n^s0\ t0\ \;\ =s1\ t0\n:s1\ -sticky\ ew\n:f0,s0\n|f0,.\ \;\ -f0,.\n/t0\ text\n/b0\ button\n\"\ \$var\]\ widget\ \$var\]\n\ \ \ \ \ \ \ \ widget\ .q\n\ \ \ \ \ \ \ \ wm\ title\ .q\ \"\$cfg(fullname)\ -\ Readme\"\n\ \ \ \ \ \ \ \ variable\ \$var\n\ \ \ \ \ \ \ \ \[set\ \$\{var\}(text)\]\ insert\ end\ \"\$cfg(fullname)\n\n\$cfg(author)\n\$cfg(when)\n\n<Button-3>\ for\ widget\ options\n\nWidgets:\n\ b\ button\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ B\ ttk::button\n\ c\ canvas\n\ k\ checkbutton\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ K\ ttk::checkbutton\n\ e\ entry\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ E\ ttk::entry\n\ f\ frame\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ F\ ttk::frame\n\ l\ label\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ L\ ttk::label\n\ z\ labelframe\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ Z\ ttk::labelframe\n\ o\ listbox\n\ r\ radiobutton\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ R\ ttk::radiobutton\n\ a\ scale\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ A\ ttk::scale\n\ s\ scrollbar\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ S\ ttk::scrollbar\n\ i\ spinbox\n\ t\ text\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ X\ ttk::combobox\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ N\ ttk::notebook\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ V\ ttk::treeview\n\nLine\ format:\nSpacing\ is\ important.\nTwo\ (2)\ positions\ per\ widget.\nGenerally:\ widget\ ?tag?\ ?widget\ ?tag?\ ...?\nwtwtwt\nTags\ can\ be\ empty:\nw\ w\ w\ w\nPut\ things\ in\ a\ frame\ (note\ the\ positioning):\nf\ t\ s\n\ \ s\n\nOptions/Controls:\nGeneral\ form:\n?\ ==\ option/control\ described\ below\nw\ ==\ one\ of\ the\ above\ widget\ types\nn\ ==\ nth\ widget\ of\ type\ w\na\ ==\ widget\ of\ type\ w\ tagged\ 'a'\nd\ ==\ option/parm/data\ (one\ or\ more)\n\n?\ \ \ \ \ \ For\ all\n?w\ d\ \ \ For\ all\ w\n?wn\ d\ \ For\ nth\ w\n?wa\ d\ \ For\ w\ tagged\ 'a'\n\nTags\ are\ one\ char,\ user\ supplied.\nIndexes\ (nth)\ are\ generated\ for\neach\ widget\ type,\ starting\ at\ 0.\n\n.\ \ Widget\ options\ \ (\ .l0\ -text\ Hello\ )\n:\ \ Grid\ options\ \ \ \ (\ :l0\ -sticky\ nsew\ )\n^\ \ Scrollbar\ Ylink\ (\ ^s0\ t0\ )\n=\ \ Scrollbar\ Xlink\ (\ =s0\ t0\ )\n|\ \ Rowconfigure\ \ \ \ (\ |f0\ 0\ -weight\ 1\ )\n-\ \ Columnconfigure\ (\ -f0\ 0\ -weight\ 1\ )\n/\ \ Save\ widget\ as\ \ (\ /t0\ inputText\ )\n!\ \ Select\ alternate\ 'gub'\ behaviour.\n\nShortcuts:\n:l0\ same\ as\ :l0\ -sticky\ nsew\n|f0\ same\ as\ |f0\ 0\ -weight\ 1\n-f0\ 1\ same\ as\ -f0\ 1\ -weight\ 1\n:f0\ same\ as\ :f0\ -sticky,\ same\ as\ :f0\ -sticky\ nsew\n/f0\ same\ as\ /f0\ f0\n\nShort-shorts:\n:\ (grid\ all\ widgets\ -sticky\ nsew)\n.\ -cursor\ trek\ (set\ all\ widgets\ to\ have\ the\ 'trek'\ cursor)\n/\ (save\ all)\n!\ (alternate\ all)\n\nUse\ ','\ to\ apply\ an\ option/control\ to\ multiple\ widgets:\n.b0,l0\ -bg\ red\n|f0,f1,f2\n:t0,t1\ -sticky\ nsew\n\nUse\ '!'\ to\ select\ alternate\ widget\ behaviour.\nCurrently\ applies\ only\ to\ containers,\nmakes\ them\ not\ containers.\ Useful\ for\ putting\ncontainers\ side-by-side\ rather\ than\ into\ each\ other.\n\nNotes:\nThe\ tag\ of\ parent\ window\ is\ '.'.\n'.'\ options\ aggregate,\ all\ others\ tend\ to\ override.\nLines\ starting\ with\ '#'\ and\ blank\ lines\ are\ ignored.\nLines\ can\ be\ joined\ with\ '\;'.\ Whitepace\ around\ '\;'\nis\ significant\ for\ layout,\ ignored\ for\ options.\n\nSome\ things\ that\ can\ be\ applied\ to\ more\ than\ one\nwidget\ don't\ make\ much\ sense\ but\ you\ can\ still\ do\ them.\n(/f\ f\ for\ example,\ scrollbar\ links,\ row/column\ configures)\n\nComplex\ GUIs\ can\ be\ built\ out\ of\ little\ gub\ gobs.\n\"\n\n\ \ \ \ \ \ \ \ focus\ \[set\ \$\{var\}(button)\]\n\ \ \ \ \ \ \ \ unset\ \$var\n\}\n###\n\n\n\n#\nproc\ openIt\ \{fn\}\ \{\ return\ \[expr\ \{(\$fn\ eq\ \{-\}\ ||\ \$fn\ eq\ \{stdin\})\ ?\ \{stdin\}\ :\ \[open\ \$fn\ r\]\}\]\ \}\nproc\ closeIt\ \{f\}\ \{\ return\ \[expr\ \{\$f\ eq\ \{stdin\}\ ?\ \{\}\ :\ \[close\ \$f\]\}\]\ \}\nproc\ inhaleIt\ \{fn\}\ \{\ return\ \[read\ \[set\ f\ \[openIt\ \$fn\]\]\]\[closeIt\ \$f\]\ \}\n#\n\n\n\n#\n#\n#\nproc\ autoload\ \{\}\ \{\n\ \ \ \ \ \ \ \ variable\ cfg\n\ \ \ \ \ \ \ \ if\ \{\$cfg(loadthis)\ ne\ \"\"\}\ \{\ Load\ \$cfg(loadthis)\ \}\n\}\n###\n\n\n\n#\n#\n#\nproc\ Load\ \{\{fn\ \{\}\}\}\ \{\n\ \ \ \ \ \ \ \ variable\ gui\n\ \ \ \ \ \ \ \ if\ \{\$fn\ eq\ \"\"\}\ \{\ set\ fn\ \[tk_getOpenFile\]\ \}\n\ \ \ \ \ \ \ \ if\ \{\$fn\ eq\ \"\"\}\ \{\ return\ \}\n\ \ \ \ \ \ \ \ \$gui(in)\ delete\ 1.0\ end\n\ \ \ \ \ \ \ \ \$gui(in)\ insert\ end\ \[inhaleIt\ \$fn\]\n\ \ \ \ \ \ \ \ gubrun\n\}\n###\n\n\n\n#\n#\n#\nproc\ Save\ \{\}\ \{\n\ \ \ \ \ \ \ \ variable\ gui\n\ \ \ \ \ \ \ \ set\ fn\ \[tk_getSaveFile\]\n\ \ \ \ \ \ \ \ if\ \{\$fn\ eq\ \"\"\}\ \{\ return\ \}\n\ \ \ \ \ \ \ \ set\ f\ \[open\ \$fn\ w\]\n\ \ \ \ \ \ \ \ puts\ -nonewline\ \$f\ \[\$gui(in)\ get\ 1.0\ end-1c\]\n\ \ \ \ \ \ \ \ close\ \$f\n\}\n###\n\n\n\n#\n#\n#\nproc\ gubrun\ \{\{auto\ \{yes\}\}\}\ \{\n\ \ \ \ \ \ \ \ variable\ gui\n\n\ \ \ \ \ \ \ \ if\ \{!\$gui(auto)\ &&\ \$auto\}\ \{\ return\ \}\n\n\ \ \ \ \ \ \ \ \$gui(run)\ delete\ 1.0\ end\n\n\ \ \ \ \ \ \ \ if\ \{\[catch\ \{\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \$gui(run)\ insert\ end\ \[gubProc\ \[gub\ \[\$gui(in)\ get\ 1.0\ end\]\]\]\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ run\n\ \ \ \ \ \ \ \ \}\ err\]\}\ \{\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \$gui(run)\ delete\ 1.0\ end\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \$gui(run)\ insert\ end\ \$::errorInfo\n\ \ \ \ \ \ \ \ \}\n\ \ \ \ \ \ \ \ after\ 20\ \[list\ focus\ \$gui(in)\]\n\}\n###\n\n\n\n#\n#\n#\nproc\ run\ \{\}\ \{\n\ \ \ \ \ \ \ \ variable\ gui\n\n\ \ \ \ \ \ \ \ catch\ \{destroy\ \[set\ w\ \$gui(w).test\]\}\n\ \ \ \ \ \ \ \ toplevel\ \$w\;\ bind\ \$w\ <Control-q>\ exit\;\ bind\ \$w\ <Control-Q>\ exit\n\n\ \ \ \ \ \ \ \ eval\ \[\$gui(run)\ get\ 1.0\ end-1c\]\n\ \ \ \ \ \ \ \ widget\ \$w\n\ \ \ \ \ \ \ \ after\ 20\ \[list\ focus\ \$gui(run)\]\n\}\n###\n\n\n\n#\n#\n#\nproc\ args\ \{\}\ \{\n\ \ \ \ \ \ \ \ if\ \{\$::argc\ ==\ 0\}\ \{\ return\ \}\n\ \ \ \ \ \ \ \ variable\ cfg\n\ \ \ \ \ \ \ \ set\ state\ opt\n\ \ \ \ \ \ \ \ foreach\ arg\ \$::argv\ \{\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ switch\ -exact\ --\ \$state\ \{\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ opt\ \{\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ switch\ -exact\ --\ \$arg\ \{\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ -z\ \{\ set\ state\ \$arg\ \}\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ default\ \{\ puts\ stderr\ \"Huh?\"\;\ exit\ 1\ \}\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \}\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \}\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ -z\ \{\ set\ state\ opt\;\ set\ cfg(loadthis)\ \$arg\ \}\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \}\n\ \ \ \ \ \ \ \ \}\n\}\n###\n\n\n\n#\n#\n#\nproc\ setup\ \{\}\ \{\n\ \ \ \ \ \ \ \ variable\ cfg\n\n\ \ \ \ \ \ \ \ set\ cfg(name)\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ TkGub\n\ \ \ \ \ \ \ \ set\ cfg(ver)\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ 0.3\n\ \ \ \ \ \ \ \ set\ cfg(author)\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \"Stuart\ Cassoff\"\n\ \ \ \ \ \ \ \ set\ cfg(when)\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \"Fall/Winter\ 2008\"\n\n\ \ \ \ \ \ \ \ set\ cfg(fullname)\ \ \ \ \ \ \ \ \$cfg(name)\\\ \$cfg(ver)\n\n\ \ \ \ \ \ \ \ set\ cfg(loadthis)\ \ \ \ \ \ \ \ \"\"\n\}\n###\n\n\n\n#\nsetup\;\ args\;\ gui\;\ autoload\n#\n\n\n\}\;\ #\ End\ of\ tkgub\ namespace\n\n#\ EOF\n======\n\n<<categories>>\ Application\ |\ GUI} CALL {my revision Gub} CALL {::oo::Obj7395737 process revision/Gub} CALL {::oo::Obj7395735 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