home *** CD-ROM | disk | FTP | other *** search
- jprompts.tcl\n\nIntroduction\nThe\ jprompts.tcl\ library\ is\ distributed\ as\ part\ of\ the\ jstools\ package.\ \ It\ provides\ procedures\ for\ asking\ the\ user\ for\ information\ of\ various\ kinds.\ \ (Two\ of\ the\ procedures,\ j:prompt_tcl\ and\ j:prompt_unix,\ actually\ do\ something\ with\ the\ information\;\ the\ others\ just\ return\ it.)\n\nThis\ document\ describes\ jprompts.tcl\ version\ 3.6/3.0.\n\nUsage\nAccessing\ the\ Library\nIn\ order\ to\ use\ the\ jprompts.tcl\ library,\ it\ (and\ any\ other\ libraries\ it\ depends\ on)\ must\ be\ in\ your\ Tcl\ auto_path,\ described\ in\ tclvars(n).\ \ Information\ about\ how\ to\ arrange\ that,\ and\ other\ conventions\ common\ to\ the\ jstools\ libraries,\ is\ in\ the\ Usage\ section\ of\ The\ jstools\ Libraries.\n\nCredits\ and\ Copyright\nAuthor\nJay\ Sekora\ \njs@bu.edu\nhttp://shore.net/~js/\n\nThanks\nj:prompt_colour_rgb\ is\ an\ eviscerated\ version\ of\ selcol.tcl\ by\ Sam\ Shen\ <sls@aero.org>,\ which\ also\ lets\ you\ choose\ HSV\ values.\n\nCopyright\nThe\ library\ is\ copyright\ ⌐\ 1992-1994\ by\ Jay\ Sekora,\ but\ may\ be\ freely\ copied\ and\ modified\ for\ non¡commercial\ purposes.\ \ (Please\ contact\ me\ if\ you\ want\ to\ use\ it\ for\ a\ commercial\ purpose,\ this\ may\ be\ OK\ under\ some\ circumstances.)\n\nOverview\nProcedures\nj:prompt\ -\ prompt\ the\ user\ for\ information\nj:prompt_tcl\ -\ prompt\ for\ a\ Tcl\ command\ and\ execute\ it\nj:prompt_unix\ -\ prompt\ for\ a\ Unix\ command\ and\ execute\ it\nj:prompt_colour_name\ -\ prompt\ for\ a\ colour\ name\nj:prompt_colour_rgb\ -\ prompt\ for\ a\ colour\ RGB\ value\nj:prompt_font\ -\ prompt\ for\ a\ font\ (via\ xfontsel(1))\n\nj:prompt\nUsage\n\tj:prompt\ \[options\]\nOptions\n\t-text\ text\ \ (default\ Enter\ a\ value:)\n\t-default\ default\ \ (default\ {})\n\t-cancelvalue\ cancel\ \ (default\ {})\n\t-file\ bool\ \ (default\ 0)\n\t-title\ title\ \ (default\ Prompt)\nExample\n\tset\ new_name\ \[j:prompt\ \\\n\t\ \ -text\ \"Enter\ a\ new\ name\ for\ \$file.\"\ -file\ 1\]\n\tif\ {\$new_name\ !=\ \"\"}\ {\n\t\ \ exec\ mv\ \$file\ \$new_name\n\t}\n\nDescription\nThis\ procedure\ creates\ a\ panel\ that\ asks\ the\ user\ to\ type\ in\ some\ information.\ \ The\ panel\ will\ have\ a\ message\ widget\ displaying\ text,\ an\ entry\ whose\ initial\ contents\ are\ default,\ and\ two\ buttons\ labelled\ OK\ and\ Cancel.\ \ Clicking\ OK\ (or\ pressing\ Return)\ will\ return\ the\ current\ contents\ of\ the\ entry\;\ clicking\ Cancel\ will\ return\ the\ value\ of\ cancel\ (the\ null\ string\ by\ default).\n\nIf\ -file\ 1\ is\ specified,\ then\ pressing\ the\ Tab\ key\ in\ the\ entry\ widget\ will\ do\ filename\ completion\ using\ j:expand_filename\ in\ jprefixmatch.tcl.\ \ Note\ that\ j:fs\ in\ jfs.tcl\ may\ often\ be\ a\ better\ choice\ when\ you\ want\ to\ ask\ the\ user\ for\ a\ filename.\n\nIf\ title\ is\ specified,\ it\ will\ be\ the\ title\ of\ the\ panel,\ for\ use\ by\ the\ window\ manager.\n\nj:prompt_colour_name\nUsage\n\tj:prompt_colour_name\ \[options\]\nOptions\n\t-prompt\ prompt\ \ (default\ Choose\ a\ colour:)\n\t-title\ title\ \ (default\ Colour\ Name\ Selector)\n\nDescription\nThis\ procedure\ creates\ a\ panel\ that\ asks\ the\ user\ to\ choose\ a\ colour\ by\ name\ from\ a\ listbox.\ \ At\ the\ top\ of\ the\ panel\ is\ a\ label\ displaying\ prompt\;\ to\ the\ left\ is\ a\ listbox\ with\ colour\ names\ taken\ from\ the\ file\ /usr/lib/X11/rgb.txt\ (and\ a\ scrollbar),\ in\ the\ lower\ right\ is\ an\ OK\ button,\ and\ on\ the\ right\ is\ a\ large\ patch\ of\ the\ current\ colour.\n\nSingle¡clicking\ on\ a\ colour\ in\ the\ listbox\ changes\ the\ colour\ of\ the\ patch,\ and\ double¡clicking\ on\ a\ colour\ name\ or\ clicking\ OK\ dismisses\ the\ panel\ and\ causes\ j:prompt_colour_name\ to\ return\ the\ selected\ colour.\ \ If\ the\ user\ clicks\ OK\ before\ selecting\ a\ colour,\ bisque\ will\ be\ returned.\n\nIf\ title\ is\ specified,\ it\ will\ be\ the\ title\ of\ the\ panel,\ for\ use\ by\ the\ window\ manager.\n\nIf\ /usr/lib/X11/rgb.txt\ doesn't\ exist,\ the\ listbox\ will\ contain\ a\ short\ (and\ arbitrary)\ hard¡wired\ list\ of\ colours.\n\nThis\ procedure\ also\ works\ if\ you\ call\ it\ j:prompt_color_name.\n\nj:prompt_colour_rgb\nUsage\n\tj:prompt_colour_name\ \[options\]\nOptions\n\t-prompt\ prompt\ \ (default\ Choose\ a\ colour:)\n\t-title\ title\ \ (default\ RGB\ Colour\ Selector)\n\nDescription\nThis\ procedure\ creates\ a\ panel\ that\ asks\ the\ user\ to\ choose\ a\ colour\ by\ adjusting\ component\ red,\ green,\ and\ blue\ values\ with\ three\ sliders.\ \ At\ the\ top\ of\ the\ panel\ is\ a\ label\ displaying\ prompt\;\ to\ the\ left\ are\ the\ three\ sliders,\ to\ the\ right\ is\ a\ patch\ of\ the\ current\ colour\ and\ a\ small\ label\ displaying\ the\ current\ colour\ in\ X\ Windows'\ hexadecimal\ notation,\ and\ in\ the\ bottom\ right\ is\ an\ OK\ button.\ \ Adjusting\ the\ sliders\ changes\ the\ current\ colour\ (reflected\ in\ the\ patch\ on\ the\ right),\ and\ clicking\ OK\ dismisses\ the\ panel\ and\ causes\ j:prompt_colour_name\ to\ return\ the\ current\ colour.\n\nIf\ title\ is\ specified,\ it\ will\ be\ the\ title\ of\ the\ panel,\ for\ use\ by\ the\ window\ manager.\n\nThis\ is\ an\ eviscerated\ version\ of\ Sam\ Shen's\ <sls@aero.org>\ selcol.tcl\ routine,\ which\ supports\ choosing\ a\ colour\ by\ HSV\ as\ well\ as\ RGB\ values.\n\nThis\ procedure\ also\ works\ if\ you\ call\ it\ j:prompt_color_rgb.\n\nj:prompt_font\nUsage\n\tj:prompt_font\ \[options\]\nOptions\n\t-prompt\ prompt\ \ (default\ Font:,\ but\ currently\ ignored)\n\t-pattern\ pattern\ \ (default\ *)\n\nDescription\nThis\ procedure\ uses\ the\ xfontsel(1X11)\ application\ to\ allow\ the\ user\ to\ choose\ a\ font.\ \ It\ simply\ invokes\ `xfontsel\ -pattern\ pattern\ -print',\ and\ returns\ the\ output\ of\ xfontsel.\ \ The\ prompt\ option\ is\ currently\ ignored.\n\nj:prompt_tcl\nUsage\n\tj:prompt_tcl\n\nDescription\nThis\ procedure\ pops\ up\ a\ j:prompt\ panel\ asking\ the\ user\ for\ a\ Tcl\ command,\ and\ evaluates\ it\ (in\ the\ current\ context).\n\nj:prompt_unix\nUsage\n\tj:prompt_unix\n\nDescription\nThis\ procedure\ pops\ up\ a\ j:prompt\ panel\ asking\ the\ user\ for\ a\ Unix\ command,\ and\ executes\ it.\ \ If\ the\ command\ produces\ any\ output,\ that\ is\ displayed\ in\ a\ separate\ panel,\ otherwise\ an\ alert\ box\ informs\ the\ user\ that\ there\ was\ no\ output.\n\nAny\ output\ to\ standard\ error\ while\ executing\ the\ command\ will\ cause\ the\ tkerror(n)\ procedure\ to\ be\ invoked\;\ the\ default\ tkerror\ procedure\ puts\ up\ a\ dialogue\ box\ displaying\ the\ error\ message.\n\nEvolution\nBugs\ and\ Limitations\nIt\ would\ be\ nice\ to\ be\ able\ to\ use\ HSV\ mode\ to\ select\ colours.\ \ I\ don't\ include\ that\ part\ of\ Sam's\ code\ because\ I\ had\ trouble\ making\ it\ work\ reliably.\n\nUsing\ xfontsel(1X11)\ means\ that\ the\ user\ might\ not\ have\ enough\ information\ in\ front\ of\ hir\ on\ the\ screen\ to\ figure\ out\ what\ sie's\ being\ asked\ to\ do.\n\nFuture\ Directions\nj:prompt_tcl\ (and\ possibly\ j:prompt_unix)\ should\ set\ up\ some\ variables\ to\ refer\ to\ things\ like\ the\ current\ window\ and\ the\ current\ application\ name.\ \ It's\ hard\ to\ do\ this\ in\ a\ sufficiently\ general\ fashion,\ though.\n\nI\ want\ to\ write\ a\ complete\ font¡selection\ panel\ in\ Tk,\ to\ replace\ the\ use\ of\ xfontsel(1X11).\ \ That\ should\ make\ font\ selection\ a\ lot\ more\ intuitive.\n\nChanges\nThese\ procedures\ used\ to\ be\ in\ a\ file\ called\ jlibrary.tcl.\ \ Starting\ with\ version\ 3.6/2.0,\ they're\ in\ their\ own\ independent\ library.\n {{{jdoc:xref:link {4.55 4.62 4.175 4.187 4.192 4.205 10.213 10.234 10.242 10.259 10.263 10.284 19.0 19.19 26.0 26.8 27.0 27.12 28.0 28.13 29.0 29.20 30.0 30.19 31.0 31.13 52.105 52.122 52.126 52.142 52.155 52.159 52.163 52.170 105.25 105.33 112.25 112.33 123.0 123.12 123.27 123.40}} {jdoc:xref:manpage {10.129 10.136 31.39 31.47 98.24 98.32 114.72 114.79 120.6 120.14 125.77 125.85}} {jdoc:anchor:anchorname {3.0 4.0 8.0 9.0 12.0 13.0 24.0 25.0 33.0 34.0 56.0 57.0 74.0 75.0 90.0 91.0 100.0 101.0 107.0 108.0 116.0 117.0}} {richtext:font:roman {2.0 3.0 4.0 4.4 4.16 4.55 4.62 4.174 4.187 4.192 4.205 6.24 6.36 8.0 10.0 10.20 10.32 10.105 10.114 10.129 10.136 10.217 10.224 10.246 10.251 10.263 10.284 12.0 14.0 15.0 15.9 16.0 16.21 17.0 19.19 19.49 19.59 19.72 19.86 21.0 22.0 24.0 26.8 27.0 27.12 28.0 28.13 29.0 29.20 30.0 30.19 31.0 31.13 31.39 31.47 33.0 35.10 35.11 35.18 36.0 37.13 37.22 37.36 38.0 38.19 38.28 38.30 39.0 39.22 39.31 39.33 40.0 40.13 40.22 40.23 41.0 41.15 41.24 41.30 42.0 48.0 49.0 49.11 50.128 50.132 50.170 50.177 50.245 50.251 50.341 50.347 52.3 52.10 52.43 52.46 52.105 52.122 52.126 52.142 52.155 52.159 52.163 52.170 54.3 54.8 56.0 57.5 58.0 58.22 58.23 58.30 59.0 59.7 60.0 60.17 60.26 60.42 61.0 61.15 61.24 61.44 63.0 63.11 64.211 64.231 66.159 66.179 66.261 66.267 68.3 68.8 70.3 70.23 72.41 72.60 74.0 75.5 76.0 76.22 76.23 76.30 77.0 77.7 78.0 78.17 78.26 78.42 79.0 79.15 79.24 79.43 81.0 81.11 82.187 82.193 82.537 82.557 84.3 84.8 86.45 86.59 86.60 86.70 88.41 88.59 90.0 91.5 92.0 92.15 92.16 92.23 93.0 93.7 94.0 94.17 94.26 94.31 95.0 95.19 95.28 95.29 97.0 97.11 98.24 98.32 98.107 98.139 98.168 98.176 100.0 101.5 102.0 102.13 104.0 104.11 105.25 105.33 107.0 108.5 109.0 109.14 111.0 111.11 112.25 112.33 114.72 114.79 114.120 114.127 116.0 117.20 120.6 120.14 122.0 122.17 123.0 123.12 123.27 123.40 125.77 125.85 127.0 127.7 128.45 128.57 129.0}} {richtext:font:italic {35.11 35.18 37.7 37.11 38.10 38.17 39.14 39.20 40.7 40.11 41.8 41.13 50.128 50.132 50.170 50.177 50.341 50.347 54.3 54.8 58.23 58.30 60.9 60.15 61.8 61.13 68.3 68.8 76.23 76.30 78.9 78.15 79.8 79.13 82.187 82.193 84.3 84.8 92.16 92.23 94.9 94.15 95.10 95.17 98.125 98.132}} {richtext:font:bold {4.4 4.16 4.55 4.62 6.24 6.36 10.20 10.32 10.217 10.224 19.49 19.59 50.245 50.251 52.43 52.46 52.105 52.122 52.126 52.142 52.163 52.170 64.211 64.231 70.3 70.23 86.60 86.70 128.45 128.57}} {richtext:font:bolditalic {10.246 10.251 10.263 10.284}} {richtext:font:typewriter {4.174 4.187 4.192 4.205 10.105 10.114 10.129 10.136 15.0 15.9 16.0 16.21 19.0 19.19 19.72 19.86 26.0 26.8 27.0 27.12 28.0 28.13 29.0 29.20 30.0 30.19 31.0 31.13 31.39 31.47 35.0 35.10 37.0 37.7 37.11 37.13 37.22 37.36 38.0 38.10 38.17 38.19 38.28 38.30 39.0 39.14 39.20 39.22 39.31 39.33 40.0 40.7 40.11 40.13 40.22 40.23 41.0 41.8 41.13 41.15 41.24 41.30 43.0 48.0 52.3 52.10 52.155 52.159 58.0 58.22 60.0 60.9 60.15 60.17 60.26 60.42 61.0 61.8 61.13 61.15 61.24 61.44 66.159 66.179 66.261 66.267 72.41 72.60 76.0 76.22 78.0 78.9 78.15 78.17 78.26 78.42 79.0 79.8 79.13 79.15 79.24 79.43 82.537 82.557 86.45 86.59 88.41 88.59 92.0 92.15 94.0 94.9 94.15 94.17 94.26 94.31 95.0 95.10 95.17 95.19 95.28 95.29 98.24 98.32 98.107 98.125 98.132 98.139 98.168 98.176 102.0 102.13 105.25 105.33 109.0 109.14 112.25 112.33 114.72 114.79 114.120 114.127 120.6 120.14 123.0 123.12 123.27 123.40 125.77 125.85}} {richtext:font:heading0 {1.0 2.0}} {richtext:font:heading1 {3.0 4.0 8.0 9.0 12.0 13.0 24.0 25.0 33.0 34.0 56.0 57.0 74.0 75.0 90.0 91.0 100.0 101.0 107.0 108.0 116.0 117.0}} {richtext:font:heading2 {9.0 10.0 13.0 14.0 17.0 19.0 21.0 22.0 25.0 26.0 34.0 35.0 36.0 37.0 42.0 43.0 49.0 49.11 57.0 57.5 59.0 59.7 63.0 63.11 75.0 75.5 77.0 77.7 81.0 81.11 91.0 91.5 93.0 93.7 97.0 97.11 101.0 101.5 104.0 104.11 108.0 108.5 111.0 111.11 117.0 117.20 122.0 122.17 127.0 127.7}} {{} {11.0 19.0 20.0 24.0 25.0 26.0 121.0 122.0}} {jdoc:link:jstools.jdoc {4.55 4.62}} {jdoc:manpage:tclvars {10.129 10.136}} {jdoc:link:jslibraries.jdoc#Usage {10.242 10.259}} {jdoc:link:jslibraries.jdoc {10.213 10.234 10.263 10.284}} {jdoc:anchorname:Evolution {116.0 117.0}} {jdoc:anchorname:Credits_and_Copyright {12.0 13.0}} {jdoc:anchorname:Introduction {3.0 4.0}} {jdoc:anchorname:Usage {8.0 9.0}} {jdoc:anchorname:Overview {24.0 25.0}} {jdoc:manpage:tkerror {114.72 114.79}} {jdoc:section:j:prompt_tcl {4.175 4.187}} {jdoc:section:j:prompt_unix {4.192 4.205}} {jdoc:section:j:prompt_colour_rgb {19.0 19.19}} {jdoc:link:#j:prompt_tcl {4.175 4.187 27.0 27.12 123.0 123.12}} {jdoc:link:#j:prompt_unix {4.192 4.205 28.0 28.13 123.27 123.40}} {jdoc:link:#j:prompt_colour_rgb {19.0 19.19 30.0 30.19}} {jdoc:link:#j:prompt {26.0 26.8 105.25 105.33 112.25 112.33}} {jdoc:link:#j:prompt_colour_name {29.0 29.20}} {jdoc:link:#j:prompt_font {31.0 31.13}} {jdoc:anchorname:j:prompt {33.0 34.0}} {jdoc:anchorname:j:prompt_colour_name {56.0 57.0}} {jdoc:anchorname:j:prompt_colour_rgb {74.0 75.0}} {jdoc:anchorname:j:prompt_font {90.0 91.0}} {jdoc:anchorname:j:prompt_tcl {100.0 101.0}} {jdoc:anchorname:j:prompt_unix {107.0 108.0}} {jdoc:manpage:xfontsel {31.39 31.47 98.24 98.32 120.6 120.14 125.77 125.85}} {jdoc:link:jfs.tcl.jdoc {52.163 52.170}} {jdoc:link:jfs.tcl.jdoc#j:fs {52.155 52.159}} {jdoc:link:jprefixmatch.tcl.jdoc {52.126 52.142}} {jdoc:link:jprefixmatch.tcl.jdoc#j:expand_filename {52.105 52.122}}} {{del_from 129.0} {matchend 97.11} {abbrevstart 31.48} {abbrevend 31.50} {insert 6.52} {del_to 129.0} {matchstart 97.0} {anchor 6.52} {emacs_mark 129.0} {current 1.0}}}