Error processing request

Parameters

CONTENT_LENGTH0
REQUEST_METHODGET
REQUEST_URI/revision/horoscope+pie+plotter?V=104
QUERY_STRINGV=104
CONTENT_TYPE
DOCUMENT_URI/revision/horoscope+pie+plotter
DOCUMENT_ROOT/var/www/nikit/nikit/nginx/../docroot
SCGI1
SERVER_PROTOCOLHTTP/1.1
HTTPSon
REMOTE_ADDR172.69.58.5
REMOTE_PORT65022
SERVER_PORT4443
SERVER_NAMEwiki.tcl-lang.org
HTTP_HOSTwiki.tcl-lang.org
HTTP_CONNECTIONKeep-Alive
HTTP_ACCEPT_ENCODINGgzip, br
HTTP_X_FORWARDED_FOR18.191.84.32
HTTP_CF_RAY87a9e8148c2da23f-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_IP18.191.84.32
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 {horoscope pie plotter} Horoscope\ or\ Pie\ plotter\n\nA\ pie\ chart\ is\ a\ way\ to\ show\ the\ relative\ portions\ of\ the\ whole.\ Pie\ plots\ have\ been\ used\ to\ map\ the\ planets\ and\ constellations\ for\ at\ least\ 3500\ years,\ although\ the\ latest\ extant\ horoscope\ is\ about\ 400\ AD.\ Here\ is\ a\ stater\ on\ a\ horoscope\ chart\ in\ TCL.\[gold\]\n\n----\n\n\n\n#\ pretty\ print\ from\ autoindent\ and\ ased\ editor\n#\ horoscope\ pie\ plotter\n#\ loaded\ on\ tcl\ wiki\n#\ used\ version\ tcl8\n#\ 22may2006,\ goldshell7\n#\ start\ of\ deck\n#\ canvas_horoscope_pie_chart.tcl\ --\n#\ goldshell7,\ tcl\ wiki\ script\ on\ 20060601\n#\ modified\ to\ demonstration\ script\ in\ Expect\ 5.2\n#\ TCL8\ distribution,\ for\ Win95\ use\n#\ canvas_horoscope_pie_chart.tcl\ --\n#\n#\ modified\ to\ demonstration\ script\ in\ TCL8\ distribution\n#\ canvas\ item\ types.\n#\n#\ SCCS:\ @(#)\ items.tcl\ 1.16\ 97/03/02\ 16:25:05\n\npackage\ require\ Tk\n\nset\ w\ .items\ncatch\ \{destroy\ \$w\}\ntoplevel\ \$w\nwm\ title\ \$w\ \"Canvas\ Horoscope\ Pie\ Plot\"\nwm\ iconname\ \$w\ \"Items\"\n#positionWindow\ \$w\nset\ c\ \$w.frame.c\n\nframe\ \$w.buttons\npack\ \$w.buttons\ -side\ bottom\ -fill\ x\ -pady\ 2m\nbutton\ \$w.buttons.dismiss\ -text\ Dismiss\ -command\ \"destroy\ \$w\"\nbutton\ \$w.buttons.code\ -text\ \"See\ Code\"\ -command\ \"showCode\ \$w\"\npack\ \$w.buttons.dismiss\ \$w.buttons.code\ -side\ left\ -expand\ 1\n\nframe\ \$w.frame\npack\ \$w.frame\ -side\ top\ -fill\ both\ -expand\ yes\n\ncanvas\ \$c\ -scrollregion\ \{0c\ 0c\ 30c\ 24c\}\ -width\ 15c\ -height\ 10c\ \ -borderwidth\ 2\ \ -xscrollcommand\ \"\$w.frame.hscroll\ set\"\ -yscrollcommand\ \"\$w.frame.vscroll\ set\"\nscrollbar\ \$w.frame.vscroll\ -command\ \"\$c\ yview\"\nscrollbar\ \$w.frame.hscroll\ -orient\ horiz\ -command\ \"\$c\ xview\"\n\ngrid\ \$c\ -in\ \$w.frame\ \ -row\ 0\ -column\ 0\ -rowspan\ 1\ -columnspan\ 1\ -sticky\ news\ngrid\ \$w.frame.vscroll\ \ -row\ 0\ -column\ 1\ -rowspan\ 1\ -columnspan\ 1\ -sticky\ news\ngrid\ \$w.frame.hscroll\ \ -row\ 1\ -column\ 0\ -rowspan\ 1\ -columnspan\ 1\ -sticky\ news\ngrid\ rowconfig\ \ \ \ \$w.frame\ 0\ -weight\ 1\ -minsize\ 0\ngrid\ columnconfig\ \$w.frame\ 0\ -weight\ 1\ -minsize\ 0\nproc\ lpick\ L\ \{lindex\ \$L\ \[expr\ int(rand()*\[llength\ \$L\])\]\}\n\nset\ c3\ \[lpick\ \{black\ brown\ white\n\ \ \ \ brown3\ brown4\ red\ \}\]\nset\ c1\ \[lpick\ \{red\ yellow\ blue\ purple\n\ \ \ \ pink\ green\ brown\ black\ white\ gray\}\]\nset\ c2\ \[lpick\ \{red\ yellow\ blue\ purple\n\ \ \ \ pink\ green\ brown\ black\ white\ gray\}\]\n\nset\ color\ black\nset\ dx\ 50\nset\ dy\ 50\nset\ radiusradius\ 220\nset\ sectors\ \ \[list\ ARIES\ TAURUS\ CANCER\ GEMINI\ LEO\ VIRGO\ LIBRA\ SCORPIO\ SAGITTARIUS\ \ CAPRICORN\ \"AQUARIUS\"\ PISCES\ \]\nset\ percentages\ \[list\ 8.3\ 8.3\ 8.3\ 8.3\ 8.3\ 8.3\ 8.3\ 8.3\ 8.3\ 8.3\ 8.3\ 8.9\ \]\narray\ set\ colors\ \ \[list\ white\ white\ yellow\ white\ white\ yellow\ white\ white\ yellow\ white\ white\ yellow\]\nproc\ lpick\ L\ \{lindex\ \$L\ \[expr\ int(rand()*\[llength\ \$L\])\]\}\n\nset\ next\ 0\nset\ x0\ \ \ \[expr\ \$radiusradius\ *\ 1.1\]\nset\ y0\ \ \ \[expr\ \$radiusradius\ *\ 1.1\]\n\nset\ dim\ \[list\ \[expr\ \{\$x0\ -\ \$radiusradius\}\]\ \[expr\ \{\$y0\ -\ \$radiusradius\}\]\[expr\ \{\$x0\ +\ \$radiusradius\}\]\ \[expr\ \{\$y0\ +\ \$radiusradius\}\]\]\n\nforeach\ segment\ \$sectors\ percentage\ \$percentages\ colour\ \$color\ \{\n\ \ \ \ set\ degrees\ \[expr\ \$percentage\ *\ 3.6\]\n\ \ \ \ eval\ \$c\ create\ arc\ \$dim\ -start\ \$next\ -extent\ \$degrees\ -fill\ yellow\;\n\ \ \ \ #sticking\ here\n\ \ \ \ set\ sectors_mid\ \[expr\ (\$next\ +\ \$degrees\ /\ 2)\ *\ acos\ (0)\ /\ 90\]\n\ \ \ \ \$c\ create\ text\n\ \ \ \ \[expr\ \$x0\ +\ \$radiusradius\ *\ cos\ (\$sectors_mid)*6\ /\ 8\]\n\ \ \ \ \[expr\ \$y0\ -\ \$radiusradius\ *\ sin\ (\$sectors_mid)*6\ /\ 8\]\n\ \ \ \ -text\ \$segment\n\ \ \ \ \n\ \ \ \ set\ next\ \[expr\ \$next\ +\ \$degrees\]\n\}\n\nset\ font1\ \{Helvetica\ 12\}\nset\ font2\ \{Helvetica\ 24\ bold\}\nif\ \{\[winfo\ depth\ \$c\]\ >\ 1\}\ \{\n\ \ \ \ set\ blue\ DeepSkyBlue3\n\ \ \ \ set\ red\ red\n\ \ \ \ set\ bisque\ bisque3\n\ \ \ \ set\ green\ SeaGreen3\n\}\ else\ \{\n\ \ \ \ set\ blue\ black\n\ \ \ \ set\ red\ black\n\ \ \ \ set\ bisque\ black\n\ \ \ \ set\ green\ black\n\}\n\n#\ Set\ up\n\n\$c\ create\ text\ 2c\ .2c\ -text\ HOROSCOPE\ -anchor\ n\n\$c\ create\ line\ 21c\ 21c\ 23c\ 21c\ 21c\ 24c\ 23c\ 24c\ -width\ 2m\ -fill\ \$blue\ \ -cap\ butt\ -join\ miter\ -tags\ item\n\$c\ create\ line\ 24.67c\ 21c\ 24.67c\ 24c\ -arrow\ last\ -tags\ item\n\$c\ create\ line\ 26.33c\ 21c\ 26.33c\ 24c\ -arrow\ both\ -tags\ item\n\$c\ create\ line\ 31c\ 24c\ 31.5c\ 21c\ 33.5c\ 21c\ 34c\ 24c\ -smooth\ on\ \ -fill\ \$blue\ -tags\ item\n\n\$c\ create\ line\ 21c\ 5c\ 21.5c\ 7c\ 21.5c\ 5c\ 22c\ 4c\ -arrow\ last\ -smooth\ on\ \ -fill\ brown\ -width\ 3\ -tags\ item\n\n\$c\ create\ line\ 15.5c\ 11c\ 19.5c\ 11.5c\ 15.5c\ 14.5c\ 19.5c\ 14c\ -smooth\ on\ \ -arrow\ both\ -width\ 3\ -tags\ item\ncatch\ \{\$c\ create\ line\ 32c\ 26c\ 33.5c\ 24.5c\ 36.5c\ 27.5c\ 38c\ 26c\ \ 36.5c\ 24.5c\ 33.5c\ 27.5c\ 32c\ 26c\ -smooth\ on\ -width\ 3m\ -cap\ round\ \ -stipple\ @\[file\ join\ \$tk_library\ demos\ images\ gray25.bmp\]\ \ -fill\ \$red\ -tags\ item\ \}\n\n\$c\ create\ line\ 21c\ 27c\ 21.75c\ 25.8c\ 22.5c\ 27c\ 23.25c\ 25.8c\ 24c\ 27c\ -width\ .5c\ \ -cap\ round\ -join\ round\ -tags\ item\n\n\$c\ create\ text\ 25c\ .2c\ -text\ Symbol_Stack\ -anchor\ n\n\$c\ create\ polygon\ 21c\ 1.0c\ 22.5c\ 1.75c\ 24c\ 1.0c\ 23.25c\ 2.5c\ \ 24c\ 4.0c\ 22.5c\ 3.25c\ 21c\ 4.0c\ 21.75c\ 2.5c\ -fill\ \$green\ \ -outline\ black\ -width\ 4\ -tags\ item\n\n\$c\ create\ oval\ 21c\ 9.0c\ 22c\ 10.0c\ \ -fill\ \$c2\ -outline\ black\ -width\ 1m\ -tags\ item\ \;\n\$c\ create\ oval\ 21c\ 19.5c\ 24c\ 22.5c\ \ -fill\ \$c2\ -outline\ \$red\ -width\ 3m\ -tags\ item\ \;\n\$c\ create\ oval\ 21c\ 19.5c\ 24c\ 22.5c\ \ -fill\ \$c2\ -outline\ \$red\ -width\ 3m\ -tags\ item\ \;\n\$c\ create\ oval\ 21c\ 19.5c\ 24c\ 22.5c\ \ -fill\ \$c2\ -outline\ \$red\ -width\ 3m\ -tags\ item\ \;\n\$c\ create\ oval\ 21c\ 19.5c\ 24c\ 22.5c\ \ -fill\ \$c2\ -outline\ \$red\ -width\ 3m\ -tags\ item\ \;\n\nbutton\ \$c.button\ -text\ \"exit\"\ -command\ \"exit\"\n\$c\ create\ window\ 15c\ 1c\ -window\ \$c.button\ -anchor\ n\ -tags\ item\nentry\ \$c.entry\ -width\ 20\n\$c.entry\ insert\ end\ \"Date\ TBA\"\n\$c\ create\ window\ 15c\ 3c\ -window\ \$c.entry\ -anchor\ n\ -tags\ item\n\n\$c\ create\ text\ 15c\ 1c\ -text\ Button:\ -anchor\ s\n\$c\ create\ text\ 15c\ 3c\ -text\ Entry:\ -anchor\ s\n\n#\ Set\ up\ event\ bindings\ for\ canvas:\n\n\$c\ bind\ item\ <Any-Enter>\ \"itemEnter\ \$c\"\n\$c\ bind\ item\ <Any-Leave>\ \"itemLeave\ \$c\"\nbind\ \$c\ <2>\ \"\$c\ scan\ mark\ %x\ %y\"\nbind\ \$c\ <B2-Motion>\ \"\$c\ scan\ dragto\ %x\ %y\"\nbind\ \$c\ <3>\ \"itemMark\ \$c\ %x\ %y\"\nbind\ \$c\ <B3-Motion>\ \"itemStroke\ \$c\ %x\ %y\"\nbind\ \$c\ <Control-f>\ \"itemsUnderArea\ \$c\"\nbind\ \$c\ <1>\ \"itemStartDrag\ \$c\ %x\ %y\"\nbind\ \$c\ <B1-Motion>\ \"itemDrag\ \$c\ %x\ %y\"\n\n#\ Utility\ procedures\ for\ highlighting\ the\ item\ under\ the\ pointer:\n\nproc\ itemEnter\ \{c\}\ \{\n\ \ \ \ global\ restoreCmd\n\ \ \ \ \n\ \ \ \ if\ \{\[winfo\ depth\ \$c\]\ ==\ 1\}\ \{\n\ \ \ \ \ \ \ \ set\ restoreCmd\ \{\}\n\ \ \ \ \ \ \ \ return\n\ \ \ \ \}\n\ \ \ \ set\ type\ \[\$c\ type\ current\]\n\ \ \ \ if\ \{\$type\ ==\ \"window\"\}\ \{\n\ \ \ \ \ \ \ \ set\ restoreCmd\ \{\}\n\ \ \ \ \ \ \ \ return\n\ \ \ \ \}\n\ \ \ \ if\ \{\$type\ ==\ \"bitmap\"\}\ \{\n\ \ \ \ \ \ \ \ set\ bg\ \[lindex\ \[\$c\ itemconf\ current\ -background\]\ 4\]\n\ \ \ \ \ \ \ \ set\ restoreCmd\ \[list\ \$c\ itemconfig\ current\ -background\ \$bg\]\n\ \ \ \ \ \ \ \ \$c\ itemconfig\ current\ -background\ SteelBlue2\n\ \ \ \ \ \ \ \ return\n\ \ \ \ \}\n\ \ \ \ set\ fill\ \[lindex\ \[\$c\ itemconfig\ current\ -fill\]\ 4\]\n\ \ \ \ if\ \{((\$type\ ==\ \"rectangle\")\ ||\ (\$type\ ==\ \"oval\")\ ||\ (\$type\ ==\ \"arc\"))\n\ \ \ \ \ \ \ \ &&\ (\$fill\ ==\ \"\")\}\ \{\n\ \ \ \ \ \ \ \ set\ outline\ \[lindex\ \[\$c\ itemconfig\ current\ -outline\]\ 4\]\n\ \ \ \ \ \ \ \ set\ restoreCmd\ \"\$c\ itemconfig\ current\ -outline\ \$outline\"\n\ \ \ \ \ \ \ \ \$c\ itemconfig\ current\ -outline\ SteelBlue2\n\ \ \ \ \}\ else\ \{\n\ \ \ \ \ \ \ \ set\ restoreCmd\ \"\$c\ itemconfig\ current\ -fill\ \$fill\"\n\ \ \ \ \ \ \ \ \$c\ itemconfig\ current\ -fill\ SteelBlue2\n\ \ \ \ \}\n\}\n\nproc\ itemLeave\ \{c\}\ \{\n\ \ \ \ global\ restoreCmd\n\ \ \ \ \n\ \ \ \ eval\ \$restoreCmd\n\}\n\n#\ Utility\ procedures\ for\ stroking\ out\ a\ rectangle\ and\ printing\ what's\n#\ underneath\ the\ rectangle's\ area.\n\nproc\ itemMark\ \{c\ x\ y\}\ \{\n\ \ \ \ global\ areaX1\ areaY1\n\ \ \ \ set\ areaX1\ \[\$c\ canvasx\ \$x\]\n\ \ \ \ set\ areaY1\ \[\$c\ canvasy\ \$y\]\n\ \ \ \ \$c\ delete\ area\n\}\n\nproc\ itemStroke\ \{c\ x\ y\}\ \{\n\ \ \ \ global\ areaX1\ areaY1\ areaX2\ areaY2\n\ \ \ \ set\ x\ \[\$c\ canvasx\ \$x\]\n\ \ \ \ set\ y\ \[\$c\ canvasy\ \$y\]\n\ \ \ \ if\ \{(\$areaX1\ !=\ \$x)\ &&\ (\$areaY1\ !=\ \$y)\}\ \{\n\ \ \ \ \ \ \ \ \$c\ delete\ area\n\ \ \ \ \ \ \ \ \$c\ addtag\ area\ withtag\ \[\$c\ create\ rect\ \$areaX1\ \$areaY1\ \$x\ \$y\n\ \ \ \ \ \ \ \ -outline\ black\]\n\ \ \ \ \ \ \ \ set\ areaX2\ \$x\n\ \ \ \ \ \ \ \ set\ areaY2\ \$y\n\ \ \ \ \}\n\}\n\nproc\ itemsUnderArea\ \{c\}\ \{\n\ \ \ \ global\ areaX1\ areaY1\ areaX2\ areaY2\n\ \ \ \ set\ area\ \[\$c\ find\ withtag\ area\]\n\ \ \ \ set\ items\ \"\"\n\ \ \ \ foreach\ i\ \[\$c\ find\ enclosed\ \$areaX1\ \$areaY1\ \$areaX2\ \$areaY2\]\ \{\n\ \ \ \ \ \ \ \ if\ \{\[lsearch\ \[\$c\ gettags\ \$i\]\ item\]\ !=\ -1\}\ \{\n\ \ \ \ \ \ \ \ \ \ \ \ lappend\ items\ \$i\n\ \ \ \ \ \ \ \ \}\n\ \ \ \ \}\n\ \ \ \ puts\ stdout\ \"Items\ enclosed\ by\ area:\ \$items\"\n\ \ \ \ set\ items\ \"\"\n\ \ \ \ foreach\ i\ \[\$c\ find\ overlapping\ \$areaX1\ \$areaY1\ \$areaX2\ \$areaY2\]\ \{\n\ \ \ \ \ \ \ \ if\ \{\[lsearch\ \[\$c\ gettags\ \$i\]\ item\]\ !=\ -1\}\ \{\n\ \ \ \ \ \ \ \ \ \ \ \ lappend\ items\ \$i\n\ \ \ \ \ \ \ \ \}\n\ \ \ \ \}\n\ \ \ \ puts\ stdout\ \"Items\ overlapping\ area:\ \$items\"\n\}\n\nset\ areaX1\ 0\nset\ areaY1\ 0\nset\ areaX2\ 0\nset\ areaY2\ 0\n\n#\ Utility\ procedures\ to\ support\ dragging\ of\ items.\n\nproc\ itemStartDrag\ \{c\ x\ y\}\ \{\n\ \ \ \ global\ lastX\ lastY\n\ \ \ \ set\ lastX\ \[\$c\ canvasx\ \$x\]\n\ \ \ \ set\ lastY\ \[\$c\ canvasy\ \$y\]\n\}\n\nproc\ itemDrag\ \{c\ x\ y\}\ \{\n\ \ \ \ global\ lastX\ lastY\n\ \ \ \ set\ x\ \[\$c\ canvasx\ \$x\]\n\ \ \ \ set\ y\ \[\$c\ canvasy\ \$y\]\n\ \ \ \ \$c\ move\ current\ \[expr\ \$x-\$lastX\]\ \[expr\ \$y-\$lastY\]\n\ \ \ \ set\ lastX\ \$x\n\ \ \ \ set\ lastY\ \$y\n\}\n\n#\ Procedure\ that's\ invoked\ when\ the\ button\ embedded\ in\ the\ canvas\n#\ is\ invoked.\n\nproc\ butPress\ \{w\ color\}\ \{\n\ \ \ \ set\ i\ \[\$w\ create\ text\ 25c\ 18.1c\ -text\ \"Ouch!!\"\ -fill\ \$color\ -anchor\ n\]\n\ \ \ \ after\ 500\ \"\$w\ delete\ \$i\"\n\}\n#end\ of\ deck\n\n#horoscope\ pie\ chart!\n\nFrom\ Graffiti:\ \[goldshell7\]\nif\ 0\ \{#test\}\nif\ 0\ \{#test\}\n#\n#\ horoscope\ pie\ plotter\n#\ tcl8\nset\ color\ 0\n\nproc\ star\ \{x\ y\ color\ args\ \}\ \{\n\ \ \ \ global\ dx\ dy\n\ \ \ \ set\ c5\ \[lpick\ \{black\ brown\ white\ gray\ brown3\ brown4\}\]\n\ \ \ \ set\ c1\ \[lpick\ \{red\ yellow\ blue\ purple\ pink\ green\}\]\n\ \ \ \ set\ c2\ \[lpick\ \{red\ yellow\ blue\ purple\ pink\ green\}\]\n\ \ \ \ .p\ create\ rectangle\ 60\ 60\ 10\ 10\ \ \\\n\ \ \ \ \ \ \ \ \ \ \ \ -fill\ \$c1\ -tags\ \[concat\ \$args\ mv\]\n\ \ \ \ \n\}\nproc\ makeplanet\ \{x\ y\ color\ args\}\ \{\n\ \ \ \ global\ dx\ dy\n\ \ \ \ set\ color\ \[lpick\ \{black\ brown\ white\ gray\n\ \ \ \ \ \ \ \ brown3\ brown4\ red\ yellow\ blue\ purple\}\]\n\ \ \ \ set\ c1\ \[lpick\ \{red\ yellow\ blue\ purple\n\ \ \ \ \ \ \ \ pink\ green\ brown\ black\ white\ gray\}\]\n\ \ \ \ set\ c2\ \[lpick\ \{red\ yellow\ blue\ purple\n\ \ \ \ \ \ \ \ pink\ green\ brown\ black\ white\ gray\}\]\n\ \ \ \ \n\ \ \ \ .p\ create\ oval\ \[expr\ \{\$x+2\}\]\ \[expr\ \{\$y+2\}\]\ \[expr\ \{\$x+\$dx-3\}\]\ \[expr\ \{\$y+\$dy-3\}\]\n\ \ \ \ -fill\ \$color\ -tags\ \[concat\ \$args\ mv\]\n\}\nproc\ lpick\ L\ \{lindex\ \$L\ \[expr\ int(rand()*\[llength\ \$L\])\]\}\n\nproc\ horoscope\ \{win\ radiusradius\ sectors\ percentages\ color\}\ \{\n\ \ \ \ canvas\ \$win\ -width\ \[expr\ \$radiusradius\ *\ 2.2\]\ -height\ \[expr\ \$radiusradius\ *\ 2.2\]\n\ \ \ \ \n\ \ \ \ set\ next\ 0\n\ \ \ \ set\ x0\ \ \ \[expr\ \$radiusradius\ *\ 1.1\]\n\ \ \ \ set\ y0\ \ \ \[expr\ \$radiusradius\ *\ 1.1\]\n\ \ \ \ \n\ \ \ \ set\ dim\ \[list\ \[expr\ \$x0\ -\ \$radiusradius\]\ \[expr\ \$y0\ -\ \$radiusradius\]\n\ \ \ \ \[expr\ \$x0\ +\ \$radiusradius\]\ \[expr\ \$y0\ +\ \$radiusradius\]\]\n\ \ \ \ \n\ \ \ \ foreach\ segment\ \$sectors\ percentage\ \$percentages\ color\ \$color\ \{\n\ \ \ \ \ \ \ \ set\ degrees\ \[expr\ \$percentage\ *\ 3.6\]\n\ \ \ \ \ \ \ \ eval\ \$win\ create\ arc\ \$dim\ -start\ \$next\ -extent\ \$degrees\n\ \ \ \ \ \ \ \ -fill\ \$color\n\ \ \ \ \ \ \ \ \n\ \ \ \ \ \ \ \ set\ sectors_mid\ \[expr\ (\$next\ +\ \$degrees\ /\ 2)\ *\ acos\ (0)\ /\ 90\]\n\ \ \ \ \ \ \ \ \$win\ create\ text\n\ \ \ \ \ \ \ \ \[expr\ \$x0\ +\ \$radiusradius\ *\ cos\ (\$sectors_mid)*6\ /\ 8\]\n\ \ \ \ \ \ \ \ \[expr\ \$y0\ -\ \$radiusradius\ *\ sin\ (\$sectors_mid)*6\ /\ 8\]\n\ \ \ \ \ \ \ \ -text\ \$segment\n\ \ \ \ \ \ \ \ \n\ \ \ \ \ \ \ \ set\ next\ \[expr\ \$next\ +\ \$degrees\]\n\ \ \ \ \}\n\ \ \ \ \n\ \ \ \ return\ \$win\n\ \ \ \ \n\}\n\n#\npack\ \[horoscope\ .p\ 220\ \{ARIES\ TAURUS\ CANCER\ GEMINI\ LEO\ VIRGO\ LIBRA\ SCORPIO\ SAGITTARIUS\ CAPRICORN\ \"AQUARIUS\"\ PISCES\ \}\ \ \{8.3\ 8.3\ 8.3\ 8.3\ 8.3\ 8.3\ 8.3\ 8.3\ 8.3\ 8.3\ 8.3\ 8.9\ \}\{white\ yellow\ white\ yellow\ white\ yellow\ white\ yellow\ white\ yellow\ white\ yellow\}\]\n\nset\ dx\ 50\nset\ dy\ 50\n\n.p\ bind\ all\ <1>\ \{set\ p(X)\ \[.p\ canvasx\ %x\]\;\ set\ p(Y)\ \[.p\ canvasy\ %y\]\}\n.p\ bind\ mv\ <B1-Motion>\ \{mv\ %x\ %y\}\n\nproc\ mv\ \{x\ y\}\ \{\n\ \ \ \ global\ p\n\ \ \ \ set\ x\ \ \[.p\ canvasx\ \$x\]\n\ \ \ \ set\ y\ \ \[.p\ canvasy\ \$y\]\n\ \ \ \ set\ id\ \[.p\ find\ withtag\ current\]\n\ \ \ \ .p\ move\ \$id\ \[expr\ \{\$x-\$p(X)\}\]\ \[expr\ \{\$y-\$p(Y)\}\]\n\ \ \ \ .p\ raise\ \$id\n\ \ \ \ set\ p(X)\ \$x\;\ set\ p(Y)\ \$y\n\}\n\nstar\ 20\ 20\ 20\ args\nmakeplanet\ 2\ 2\ red\nmakeplanet\ 2\ 2\ brown\nmakeplanet\ 2\ 2\ blue\nmakeplanet\ 2\ 2\ green\nmakeplanet\ 2\ 2\ black\nmakeplanet\ 2\ 2\ blue\nmakeplanet\ 2\ 2\ red\nmakeplanet\ 2\ 2\ brown\nmakeplanet\ 2\ 2\ blue\nmakeplanet\ 2\ 2\ green\nmakeplanet\ 2\ 2\ black\n\n\n\n\n\n\n======\n======\n\n----\n****Screenshot\ Section****\n\n\[http://img144.imageshack.us/img144/2320/piechartchartxxxxed0.jpg\]\n\[http://img144.imageshack.us/img144/2320/piechartchartxxxxed0.th.jpg\]\n\n----\n****Comments\ Section****\nPlease\ put\ useful\ comments\ in\ this\ section,\ thank\ you.\n----\n\[CLN\]\ -\ What,\ pray\ tell,\ is\ \"horoscope\ pie\"?\ \ I've\ heard\ of\ apple\ pie,\ blueberry\ pie,\ and\ even\ funeral\ pie\ but\ horoscope?\ \ (Less\ snidely\ put,\ pages\ full\ of\ code\ with\ no\ exposition\ at\ all\ (even\ in\ the\ comments)\ are\ a\ bit\ less\ than\ useful.)\n----\ \ \n\n\[goldshell7\]\ This\ was\ my\ first\ effort\ for\ the\ TCL\ wiki.\ The\ horoscope_pie_plotter.tcl\ has\ seized\ the\ niche\ of\ under-appreciation.\ All\ is\ certain\ that\ the\ petitioner\ of\ wisdom\ will\ catch\ up\ with\ the\ Ancient\ Egyptians\ and\ Babylonians,\ circa\ 1500\ BCE.\ See\ Senmut's\ tomb\ for\ funeral\ pie\ (or\ horoscope\ pie\ plot).\n----\ \ \n\n****References****\nProgramming\ References\ (\ TCL\ \ )\n----\n\ \ \ *\ \[Simple\ Canvas\ Demo\]\n\ \ \ *\ \[canvas\]\n\ \ \ *\ \[Widgets\ on\ a\ canvas\]\n\ \ \ *\ See\ also\ \[A\ little\ pie\ chart\]\n----\ \ \ \n****Web\ References\ ****\n\n\ \ \ *\ http://en.wikipedia.org/wiki/Pie_chart\n\ \ \ *\ http://www.stariq.com/\n\ \ \ *\ google\ >>\ Astrology\ and\ Horoscope\ Homepage\ -\ Astrodienst\n\ \ \ *\ http://www.astro.com/horoscopes/ahor.asp\n\ \ \ *\ google\ >>\ Babylon\ -\ Wikipedia,\ the\ free\ encyclopedia\n\ \ \ *\ http://en.wikipedia.org/wiki/Babylon\n\ \ \ *\ http://www.geocities.com/astrologyconstellations/nonzodiac.htm\n\ \ \ *\ http://www.nickcampion.com/nc/history/eygptian.html\n\ \ \ *\ http://touregypt.net/featurestories/dendera.htm\n\ \ \ *\ http://en.wikipedia.org/wiki/Dendera\n\ \ \ *\ google\ >>\ urania\ horoscope\ russia\n\ \ \ *\ http://www.urania.ru/english/Chart/index.html\n\ \ \ *\ http://www.urania.ru/english/Chart/fullscreen.html\n\ \ \ *\ For\ total\ eclipse\ on\ 3Mar2007,\n\ \ \ *\ try\ plotting\ London,03:03:2007,GMT\ 2244\ on\ Urania.\ \n\ \ \ *\ http://news.bbc.co.uk/1/hi/sci/tech/6411991.stm\n\ \ \ *\ http://analyzer.depaul.edu/paperplate/Egyptian%20calendar.htm\ \ \n\ \ \ *\ http://www.historylab.org/../calendars/calendars.htm\n\ \ \ *\ google\ >>\ Astronomical\ Ceiling-Decoration\ in\ Tomb\ of\ Senmut\ \n\ \ \ *\ google\ >>\ Senemut\ -\ Wikipedia,\ the\ free\ encyclopedia\n\ \ \ *\ http://en.wikipedia.org/wiki/Senemut\n\ \ \ *\ http://www.geocities.com/astrologyages/images/senmutnorth.jpg\n----\n======\n\ \n\n<<categories>>Toys regexp2} CALL {my render {horoscope pie plotter} Horoscope\ or\ Pie\ plotter\n\nA\ pie\ chart\ is\ a\ way\ to\ show\ the\ relative\ portions\ of\ the\ whole.\ Pie\ plots\ have\ been\ used\ to\ map\ the\ planets\ and\ constellations\ for\ at\ least\ 3500\ years,\ although\ the\ latest\ extant\ horoscope\ is\ about\ 400\ AD.\ Here\ is\ a\ stater\ on\ a\ horoscope\ chart\ in\ TCL.\[gold\]\n\n----\n\n\n\n#\ pretty\ print\ from\ autoindent\ and\ ased\ editor\n#\ horoscope\ pie\ plotter\n#\ loaded\ on\ tcl\ wiki\n#\ used\ version\ tcl8\n#\ 22may2006,\ goldshell7\n#\ start\ of\ deck\n#\ canvas_horoscope_pie_chart.tcl\ --\n#\ goldshell7,\ tcl\ wiki\ script\ on\ 20060601\n#\ modified\ to\ demonstration\ script\ in\ Expect\ 5.2\n#\ TCL8\ distribution,\ for\ Win95\ use\n#\ canvas_horoscope_pie_chart.tcl\ --\n#\n#\ modified\ to\ demonstration\ script\ in\ TCL8\ distribution\n#\ canvas\ item\ types.\n#\n#\ SCCS:\ @(#)\ items.tcl\ 1.16\ 97/03/02\ 16:25:05\n\npackage\ require\ Tk\n\nset\ w\ .items\ncatch\ \{destroy\ \$w\}\ntoplevel\ \$w\nwm\ title\ \$w\ \"Canvas\ Horoscope\ Pie\ Plot\"\nwm\ iconname\ \$w\ \"Items\"\n#positionWindow\ \$w\nset\ c\ \$w.frame.c\n\nframe\ \$w.buttons\npack\ \$w.buttons\ -side\ bottom\ -fill\ x\ -pady\ 2m\nbutton\ \$w.buttons.dismiss\ -text\ Dismiss\ -command\ \"destroy\ \$w\"\nbutton\ \$w.buttons.code\ -text\ \"See\ Code\"\ -command\ \"showCode\ \$w\"\npack\ \$w.buttons.dismiss\ \$w.buttons.code\ -side\ left\ -expand\ 1\n\nframe\ \$w.frame\npack\ \$w.frame\ -side\ top\ -fill\ both\ -expand\ yes\n\ncanvas\ \$c\ -scrollregion\ \{0c\ 0c\ 30c\ 24c\}\ -width\ 15c\ -height\ 10c\ \ -borderwidth\ 2\ \ -xscrollcommand\ \"\$w.frame.hscroll\ set\"\ -yscrollcommand\ \"\$w.frame.vscroll\ set\"\nscrollbar\ \$w.frame.vscroll\ -command\ \"\$c\ yview\"\nscrollbar\ \$w.frame.hscroll\ -orient\ horiz\ -command\ \"\$c\ xview\"\n\ngrid\ \$c\ -in\ \$w.frame\ \ -row\ 0\ -column\ 0\ -rowspan\ 1\ -columnspan\ 1\ -sticky\ news\ngrid\ \$w.frame.vscroll\ \ -row\ 0\ -column\ 1\ -rowspan\ 1\ -columnspan\ 1\ -sticky\ news\ngrid\ \$w.frame.hscroll\ \ -row\ 1\ -column\ 0\ -rowspan\ 1\ -columnspan\ 1\ -sticky\ news\ngrid\ rowconfig\ \ \ \ \$w.frame\ 0\ -weight\ 1\ -minsize\ 0\ngrid\ columnconfig\ \$w.frame\ 0\ -weight\ 1\ -minsize\ 0\nproc\ lpick\ L\ \{lindex\ \$L\ \[expr\ int(rand()*\[llength\ \$L\])\]\}\n\nset\ c3\ \[lpick\ \{black\ brown\ white\n\ \ \ \ brown3\ brown4\ red\ \}\]\nset\ c1\ \[lpick\ \{red\ yellow\ blue\ purple\n\ \ \ \ pink\ green\ brown\ black\ white\ gray\}\]\nset\ c2\ \[lpick\ \{red\ yellow\ blue\ purple\n\ \ \ \ pink\ green\ brown\ black\ white\ gray\}\]\n\nset\ color\ black\nset\ dx\ 50\nset\ dy\ 50\nset\ radiusradius\ 220\nset\ sectors\ \ \[list\ ARIES\ TAURUS\ CANCER\ GEMINI\ LEO\ VIRGO\ LIBRA\ SCORPIO\ SAGITTARIUS\ \ CAPRICORN\ \"AQUARIUS\"\ PISCES\ \]\nset\ percentages\ \[list\ 8.3\ 8.3\ 8.3\ 8.3\ 8.3\ 8.3\ 8.3\ 8.3\ 8.3\ 8.3\ 8.3\ 8.9\ \]\narray\ set\ colors\ \ \[list\ white\ white\ yellow\ white\ white\ yellow\ white\ white\ yellow\ white\ white\ yellow\]\nproc\ lpick\ L\ \{lindex\ \$L\ \[expr\ int(rand()*\[llength\ \$L\])\]\}\n\nset\ next\ 0\nset\ x0\ \ \ \[expr\ \$radiusradius\ *\ 1.1\]\nset\ y0\ \ \ \[expr\ \$radiusradius\ *\ 1.1\]\n\nset\ dim\ \[list\ \[expr\ \{\$x0\ -\ \$radiusradius\}\]\ \[expr\ \{\$y0\ -\ \$radiusradius\}\]\[expr\ \{\$x0\ +\ \$radiusradius\}\]\ \[expr\ \{\$y0\ +\ \$radiusradius\}\]\]\n\nforeach\ segment\ \$sectors\ percentage\ \$percentages\ colour\ \$color\ \{\n\ \ \ \ set\ degrees\ \[expr\ \$percentage\ *\ 3.6\]\n\ \ \ \ eval\ \$c\ create\ arc\ \$dim\ -start\ \$next\ -extent\ \$degrees\ -fill\ yellow\;\n\ \ \ \ #sticking\ here\n\ \ \ \ set\ sectors_mid\ \[expr\ (\$next\ +\ \$degrees\ /\ 2)\ *\ acos\ (0)\ /\ 90\]\n\ \ \ \ \$c\ create\ text\n\ \ \ \ \[expr\ \$x0\ +\ \$radiusradius\ *\ cos\ (\$sectors_mid)*6\ /\ 8\]\n\ \ \ \ \[expr\ \$y0\ -\ \$radiusradius\ *\ sin\ (\$sectors_mid)*6\ /\ 8\]\n\ \ \ \ -text\ \$segment\n\ \ \ \ \n\ \ \ \ set\ next\ \[expr\ \$next\ +\ \$degrees\]\n\}\n\nset\ font1\ \{Helvetica\ 12\}\nset\ font2\ \{Helvetica\ 24\ bold\}\nif\ \{\[winfo\ depth\ \$c\]\ >\ 1\}\ \{\n\ \ \ \ set\ blue\ DeepSkyBlue3\n\ \ \ \ set\ red\ red\n\ \ \ \ set\ bisque\ bisque3\n\ \ \ \ set\ green\ SeaGreen3\n\}\ else\ \{\n\ \ \ \ set\ blue\ black\n\ \ \ \ set\ red\ black\n\ \ \ \ set\ bisque\ black\n\ \ \ \ set\ green\ black\n\}\n\n#\ Set\ up\n\n\$c\ create\ text\ 2c\ .2c\ -text\ HOROSCOPE\ -anchor\ n\n\$c\ create\ line\ 21c\ 21c\ 23c\ 21c\ 21c\ 24c\ 23c\ 24c\ -width\ 2m\ -fill\ \$blue\ \ -cap\ butt\ -join\ miter\ -tags\ item\n\$c\ create\ line\ 24.67c\ 21c\ 24.67c\ 24c\ -arrow\ last\ -tags\ item\n\$c\ create\ line\ 26.33c\ 21c\ 26.33c\ 24c\ -arrow\ both\ -tags\ item\n\$c\ create\ line\ 31c\ 24c\ 31.5c\ 21c\ 33.5c\ 21c\ 34c\ 24c\ -smooth\ on\ \ -fill\ \$blue\ -tags\ item\n\n\$c\ create\ line\ 21c\ 5c\ 21.5c\ 7c\ 21.5c\ 5c\ 22c\ 4c\ -arrow\ last\ -smooth\ on\ \ -fill\ brown\ -width\ 3\ -tags\ item\n\n\$c\ create\ line\ 15.5c\ 11c\ 19.5c\ 11.5c\ 15.5c\ 14.5c\ 19.5c\ 14c\ -smooth\ on\ \ -arrow\ both\ -width\ 3\ -tags\ item\ncatch\ \{\$c\ create\ line\ 32c\ 26c\ 33.5c\ 24.5c\ 36.5c\ 27.5c\ 38c\ 26c\ \ 36.5c\ 24.5c\ 33.5c\ 27.5c\ 32c\ 26c\ -smooth\ on\ -width\ 3m\ -cap\ round\ \ -stipple\ @\[file\ join\ \$tk_library\ demos\ images\ gray25.bmp\]\ \ -fill\ \$red\ -tags\ item\ \}\n\n\$c\ create\ line\ 21c\ 27c\ 21.75c\ 25.8c\ 22.5c\ 27c\ 23.25c\ 25.8c\ 24c\ 27c\ -width\ .5c\ \ -cap\ round\ -join\ round\ -tags\ item\n\n\$c\ create\ text\ 25c\ .2c\ -text\ Symbol_Stack\ -anchor\ n\n\$c\ create\ polygon\ 21c\ 1.0c\ 22.5c\ 1.75c\ 24c\ 1.0c\ 23.25c\ 2.5c\ \ 24c\ 4.0c\ 22.5c\ 3.25c\ 21c\ 4.0c\ 21.75c\ 2.5c\ -fill\ \$green\ \ -outline\ black\ -width\ 4\ -tags\ item\n\n\$c\ create\ oval\ 21c\ 9.0c\ 22c\ 10.0c\ \ -fill\ \$c2\ -outline\ black\ -width\ 1m\ -tags\ item\ \;\n\$c\ create\ oval\ 21c\ 19.5c\ 24c\ 22.5c\ \ -fill\ \$c2\ -outline\ \$red\ -width\ 3m\ -tags\ item\ \;\n\$c\ create\ oval\ 21c\ 19.5c\ 24c\ 22.5c\ \ -fill\ \$c2\ -outline\ \$red\ -width\ 3m\ -tags\ item\ \;\n\$c\ create\ oval\ 21c\ 19.5c\ 24c\ 22.5c\ \ -fill\ \$c2\ -outline\ \$red\ -width\ 3m\ -tags\ item\ \;\n\$c\ create\ oval\ 21c\ 19.5c\ 24c\ 22.5c\ \ -fill\ \$c2\ -outline\ \$red\ -width\ 3m\ -tags\ item\ \;\n\nbutton\ \$c.button\ -text\ \"exit\"\ -command\ \"exit\"\n\$c\ create\ window\ 15c\ 1c\ -window\ \$c.button\ -anchor\ n\ -tags\ item\nentry\ \$c.entry\ -width\ 20\n\$c.entry\ insert\ end\ \"Date\ TBA\"\n\$c\ create\ window\ 15c\ 3c\ -window\ \$c.entry\ -anchor\ n\ -tags\ item\n\n\$c\ create\ text\ 15c\ 1c\ -text\ Button:\ -anchor\ s\n\$c\ create\ text\ 15c\ 3c\ -text\ Entry:\ -anchor\ s\n\n#\ Set\ up\ event\ bindings\ for\ canvas:\n\n\$c\ bind\ item\ <Any-Enter>\ \"itemEnter\ \$c\"\n\$c\ bind\ item\ <Any-Leave>\ \"itemLeave\ \$c\"\nbind\ \$c\ <2>\ \"\$c\ scan\ mark\ %x\ %y\"\nbind\ \$c\ <B2-Motion>\ \"\$c\ scan\ dragto\ %x\ %y\"\nbind\ \$c\ <3>\ \"itemMark\ \$c\ %x\ %y\"\nbind\ \$c\ <B3-Motion>\ \"itemStroke\ \$c\ %x\ %y\"\nbind\ \$c\ <Control-f>\ \"itemsUnderArea\ \$c\"\nbind\ \$c\ <1>\ \"itemStartDrag\ \$c\ %x\ %y\"\nbind\ \$c\ <B1-Motion>\ \"itemDrag\ \$c\ %x\ %y\"\n\n#\ Utility\ procedures\ for\ highlighting\ the\ item\ under\ the\ pointer:\n\nproc\ itemEnter\ \{c\}\ \{\n\ \ \ \ global\ restoreCmd\n\ \ \ \ \n\ \ \ \ if\ \{\[winfo\ depth\ \$c\]\ ==\ 1\}\ \{\n\ \ \ \ \ \ \ \ set\ restoreCmd\ \{\}\n\ \ \ \ \ \ \ \ return\n\ \ \ \ \}\n\ \ \ \ set\ type\ \[\$c\ type\ current\]\n\ \ \ \ if\ \{\$type\ ==\ \"window\"\}\ \{\n\ \ \ \ \ \ \ \ set\ restoreCmd\ \{\}\n\ \ \ \ \ \ \ \ return\n\ \ \ \ \}\n\ \ \ \ if\ \{\$type\ ==\ \"bitmap\"\}\ \{\n\ \ \ \ \ \ \ \ set\ bg\ \[lindex\ \[\$c\ itemconf\ current\ -background\]\ 4\]\n\ \ \ \ \ \ \ \ set\ restoreCmd\ \[list\ \$c\ itemconfig\ current\ -background\ \$bg\]\n\ \ \ \ \ \ \ \ \$c\ itemconfig\ current\ -background\ SteelBlue2\n\ \ \ \ \ \ \ \ return\n\ \ \ \ \}\n\ \ \ \ set\ fill\ \[lindex\ \[\$c\ itemconfig\ current\ -fill\]\ 4\]\n\ \ \ \ if\ \{((\$type\ ==\ \"rectangle\")\ ||\ (\$type\ ==\ \"oval\")\ ||\ (\$type\ ==\ \"arc\"))\n\ \ \ \ \ \ \ \ &&\ (\$fill\ ==\ \"\")\}\ \{\n\ \ \ \ \ \ \ \ set\ outline\ \[lindex\ \[\$c\ itemconfig\ current\ -outline\]\ 4\]\n\ \ \ \ \ \ \ \ set\ restoreCmd\ \"\$c\ itemconfig\ current\ -outline\ \$outline\"\n\ \ \ \ \ \ \ \ \$c\ itemconfig\ current\ -outline\ SteelBlue2\n\ \ \ \ \}\ else\ \{\n\ \ \ \ \ \ \ \ set\ restoreCmd\ \"\$c\ itemconfig\ current\ -fill\ \$fill\"\n\ \ \ \ \ \ \ \ \$c\ itemconfig\ current\ -fill\ SteelBlue2\n\ \ \ \ \}\n\}\n\nproc\ itemLeave\ \{c\}\ \{\n\ \ \ \ global\ restoreCmd\n\ \ \ \ \n\ \ \ \ eval\ \$restoreCmd\n\}\n\n#\ Utility\ procedures\ for\ stroking\ out\ a\ rectangle\ and\ printing\ what's\n#\ underneath\ the\ rectangle's\ area.\n\nproc\ itemMark\ \{c\ x\ y\}\ \{\n\ \ \ \ global\ areaX1\ areaY1\n\ \ \ \ set\ areaX1\ \[\$c\ canvasx\ \$x\]\n\ \ \ \ set\ areaY1\ \[\$c\ canvasy\ \$y\]\n\ \ \ \ \$c\ delete\ area\n\}\n\nproc\ itemStroke\ \{c\ x\ y\}\ \{\n\ \ \ \ global\ areaX1\ areaY1\ areaX2\ areaY2\n\ \ \ \ set\ x\ \[\$c\ canvasx\ \$x\]\n\ \ \ \ set\ y\ \[\$c\ canvasy\ \$y\]\n\ \ \ \ if\ \{(\$areaX1\ !=\ \$x)\ &&\ (\$areaY1\ !=\ \$y)\}\ \{\n\ \ \ \ \ \ \ \ \$c\ delete\ area\n\ \ \ \ \ \ \ \ \$c\ addtag\ area\ withtag\ \[\$c\ create\ rect\ \$areaX1\ \$areaY1\ \$x\ \$y\n\ \ \ \ \ \ \ \ -outline\ black\]\n\ \ \ \ \ \ \ \ set\ areaX2\ \$x\n\ \ \ \ \ \ \ \ set\ areaY2\ \$y\n\ \ \ \ \}\n\}\n\nproc\ itemsUnderArea\ \{c\}\ \{\n\ \ \ \ global\ areaX1\ areaY1\ areaX2\ areaY2\n\ \ \ \ set\ area\ \[\$c\ find\ withtag\ area\]\n\ \ \ \ set\ items\ \"\"\n\ \ \ \ foreach\ i\ \[\$c\ find\ enclosed\ \$areaX1\ \$areaY1\ \$areaX2\ \$areaY2\]\ \{\n\ \ \ \ \ \ \ \ if\ \{\[lsearch\ \[\$c\ gettags\ \$i\]\ item\]\ !=\ -1\}\ \{\n\ \ \ \ \ \ \ \ \ \ \ \ lappend\ items\ \$i\n\ \ \ \ \ \ \ \ \}\n\ \ \ \ \}\n\ \ \ \ puts\ stdout\ \"Items\ enclosed\ by\ area:\ \$items\"\n\ \ \ \ set\ items\ \"\"\n\ \ \ \ foreach\ i\ \[\$c\ find\ overlapping\ \$areaX1\ \$areaY1\ \$areaX2\ \$areaY2\]\ \{\n\ \ \ \ \ \ \ \ if\ \{\[lsearch\ \[\$c\ gettags\ \$i\]\ item\]\ !=\ -1\}\ \{\n\ \ \ \ \ \ \ \ \ \ \ \ lappend\ items\ \$i\n\ \ \ \ \ \ \ \ \}\n\ \ \ \ \}\n\ \ \ \ puts\ stdout\ \"Items\ overlapping\ area:\ \$items\"\n\}\n\nset\ areaX1\ 0\nset\ areaY1\ 0\nset\ areaX2\ 0\nset\ areaY2\ 0\n\n#\ Utility\ procedures\ to\ support\ dragging\ of\ items.\n\nproc\ itemStartDrag\ \{c\ x\ y\}\ \{\n\ \ \ \ global\ lastX\ lastY\n\ \ \ \ set\ lastX\ \[\$c\ canvasx\ \$x\]\n\ \ \ \ set\ lastY\ \[\$c\ canvasy\ \$y\]\n\}\n\nproc\ itemDrag\ \{c\ x\ y\}\ \{\n\ \ \ \ global\ lastX\ lastY\n\ \ \ \ set\ x\ \[\$c\ canvasx\ \$x\]\n\ \ \ \ set\ y\ \[\$c\ canvasy\ \$y\]\n\ \ \ \ \$c\ move\ current\ \[expr\ \$x-\$lastX\]\ \[expr\ \$y-\$lastY\]\n\ \ \ \ set\ lastX\ \$x\n\ \ \ \ set\ lastY\ \$y\n\}\n\n#\ Procedure\ that's\ invoked\ when\ the\ button\ embedded\ in\ the\ canvas\n#\ is\ invoked.\n\nproc\ butPress\ \{w\ color\}\ \{\n\ \ \ \ set\ i\ \[\$w\ create\ text\ 25c\ 18.1c\ -text\ \"Ouch!!\"\ -fill\ \$color\ -anchor\ n\]\n\ \ \ \ after\ 500\ \"\$w\ delete\ \$i\"\n\}\n#end\ of\ deck\n\n#horoscope\ pie\ chart!\n\nFrom\ Graffiti:\ \[goldshell7\]\nif\ 0\ \{#test\}\nif\ 0\ \{#test\}\n#\n#\ horoscope\ pie\ plotter\n#\ tcl8\nset\ color\ 0\n\nproc\ star\ \{x\ y\ color\ args\ \}\ \{\n\ \ \ \ global\ dx\ dy\n\ \ \ \ set\ c5\ \[lpick\ \{black\ brown\ white\ gray\ brown3\ brown4\}\]\n\ \ \ \ set\ c1\ \[lpick\ \{red\ yellow\ blue\ purple\ pink\ green\}\]\n\ \ \ \ set\ c2\ \[lpick\ \{red\ yellow\ blue\ purple\ pink\ green\}\]\n\ \ \ \ .p\ create\ rectangle\ 60\ 60\ 10\ 10\ \ \\\n\ \ \ \ \ \ \ \ \ \ \ \ -fill\ \$c1\ -tags\ \[concat\ \$args\ mv\]\n\ \ \ \ \n\}\nproc\ makeplanet\ \{x\ y\ color\ args\}\ \{\n\ \ \ \ global\ dx\ dy\n\ \ \ \ set\ color\ \[lpick\ \{black\ brown\ white\ gray\n\ \ \ \ \ \ \ \ brown3\ brown4\ red\ yellow\ blue\ purple\}\]\n\ \ \ \ set\ c1\ \[lpick\ \{red\ yellow\ blue\ purple\n\ \ \ \ \ \ \ \ pink\ green\ brown\ black\ white\ gray\}\]\n\ \ \ \ set\ c2\ \[lpick\ \{red\ yellow\ blue\ purple\n\ \ \ \ \ \ \ \ pink\ green\ brown\ black\ white\ gray\}\]\n\ \ \ \ \n\ \ \ \ .p\ create\ oval\ \[expr\ \{\$x+2\}\]\ \[expr\ \{\$y+2\}\]\ \[expr\ \{\$x+\$dx-3\}\]\ \[expr\ \{\$y+\$dy-3\}\]\n\ \ \ \ -fill\ \$color\ -tags\ \[concat\ \$args\ mv\]\n\}\nproc\ lpick\ L\ \{lindex\ \$L\ \[expr\ int(rand()*\[llength\ \$L\])\]\}\n\nproc\ horoscope\ \{win\ radiusradius\ sectors\ percentages\ color\}\ \{\n\ \ \ \ canvas\ \$win\ -width\ \[expr\ \$radiusradius\ *\ 2.2\]\ -height\ \[expr\ \$radiusradius\ *\ 2.2\]\n\ \ \ \ \n\ \ \ \ set\ next\ 0\n\ \ \ \ set\ x0\ \ \ \[expr\ \$radiusradius\ *\ 1.1\]\n\ \ \ \ set\ y0\ \ \ \[expr\ \$radiusradius\ *\ 1.1\]\n\ \ \ \ \n\ \ \ \ set\ dim\ \[list\ \[expr\ \$x0\ -\ \$radiusradius\]\ \[expr\ \$y0\ -\ \$radiusradius\]\n\ \ \ \ \[expr\ \$x0\ +\ \$radiusradius\]\ \[expr\ \$y0\ +\ \$radiusradius\]\]\n\ \ \ \ \n\ \ \ \ foreach\ segment\ \$sectors\ percentage\ \$percentages\ color\ \$color\ \{\n\ \ \ \ \ \ \ \ set\ degrees\ \[expr\ \$percentage\ *\ 3.6\]\n\ \ \ \ \ \ \ \ eval\ \$win\ create\ arc\ \$dim\ -start\ \$next\ -extent\ \$degrees\n\ \ \ \ \ \ \ \ -fill\ \$color\n\ \ \ \ \ \ \ \ \n\ \ \ \ \ \ \ \ set\ sectors_mid\ \[expr\ (\$next\ +\ \$degrees\ /\ 2)\ *\ acos\ (0)\ /\ 90\]\n\ \ \ \ \ \ \ \ \$win\ create\ text\n\ \ \ \ \ \ \ \ \[expr\ \$x0\ +\ \$radiusradius\ *\ cos\ (\$sectors_mid)*6\ /\ 8\]\n\ \ \ \ \ \ \ \ \[expr\ \$y0\ -\ \$radiusradius\ *\ sin\ (\$sectors_mid)*6\ /\ 8\]\n\ \ \ \ \ \ \ \ -text\ \$segment\n\ \ \ \ \ \ \ \ \n\ \ \ \ \ \ \ \ set\ next\ \[expr\ \$next\ +\ \$degrees\]\n\ \ \ \ \}\n\ \ \ \ \n\ \ \ \ return\ \$win\n\ \ \ \ \n\}\n\n#\npack\ \[horoscope\ .p\ 220\ \{ARIES\ TAURUS\ CANCER\ GEMINI\ LEO\ VIRGO\ LIBRA\ SCORPIO\ SAGITTARIUS\ CAPRICORN\ \"AQUARIUS\"\ PISCES\ \}\ \ \{8.3\ 8.3\ 8.3\ 8.3\ 8.3\ 8.3\ 8.3\ 8.3\ 8.3\ 8.3\ 8.3\ 8.9\ \}\{white\ yellow\ white\ yellow\ white\ yellow\ white\ yellow\ white\ yellow\ white\ yellow\}\]\n\nset\ dx\ 50\nset\ dy\ 50\n\n.p\ bind\ all\ <1>\ \{set\ p(X)\ \[.p\ canvasx\ %x\]\;\ set\ p(Y)\ \[.p\ canvasy\ %y\]\}\n.p\ bind\ mv\ <B1-Motion>\ \{mv\ %x\ %y\}\n\nproc\ mv\ \{x\ y\}\ \{\n\ \ \ \ global\ p\n\ \ \ \ set\ x\ \ \[.p\ canvasx\ \$x\]\n\ \ \ \ set\ y\ \ \[.p\ canvasy\ \$y\]\n\ \ \ \ set\ id\ \[.p\ find\ withtag\ current\]\n\ \ \ \ .p\ move\ \$id\ \[expr\ \{\$x-\$p(X)\}\]\ \[expr\ \{\$y-\$p(Y)\}\]\n\ \ \ \ .p\ raise\ \$id\n\ \ \ \ set\ p(X)\ \$x\;\ set\ p(Y)\ \$y\n\}\n\nstar\ 20\ 20\ 20\ args\nmakeplanet\ 2\ 2\ red\nmakeplanet\ 2\ 2\ brown\nmakeplanet\ 2\ 2\ blue\nmakeplanet\ 2\ 2\ green\nmakeplanet\ 2\ 2\ black\nmakeplanet\ 2\ 2\ blue\nmakeplanet\ 2\ 2\ red\nmakeplanet\ 2\ 2\ brown\nmakeplanet\ 2\ 2\ blue\nmakeplanet\ 2\ 2\ green\nmakeplanet\ 2\ 2\ black\n\n\n\n\n\n\n======\n======\n\n----\n****Screenshot\ Section****\n\n\[http://img144.imageshack.us/img144/2320/piechartchartxxxxed0.jpg\]\n\[http://img144.imageshack.us/img144/2320/piechartchartxxxxed0.th.jpg\]\n\n----\n****Comments\ Section****\nPlease\ put\ useful\ comments\ in\ this\ section,\ thank\ you.\n----\n\[CLN\]\ -\ What,\ pray\ tell,\ is\ \"horoscope\ pie\"?\ \ I've\ heard\ of\ apple\ pie,\ blueberry\ pie,\ and\ even\ funeral\ pie\ but\ horoscope?\ \ (Less\ snidely\ put,\ pages\ full\ of\ code\ with\ no\ exposition\ at\ all\ (even\ in\ the\ comments)\ are\ a\ bit\ less\ than\ useful.)\n----\ \ \n\n\[goldshell7\]\ This\ was\ my\ first\ effort\ for\ the\ TCL\ wiki.\ The\ horoscope_pie_plotter.tcl\ has\ seized\ the\ niche\ of\ under-appreciation.\ All\ is\ certain\ that\ the\ petitioner\ of\ wisdom\ will\ catch\ up\ with\ the\ Ancient\ Egyptians\ and\ Babylonians,\ circa\ 1500\ BCE.\ See\ Senmut's\ tomb\ for\ funeral\ pie\ (or\ horoscope\ pie\ plot).\n----\ \ \n\n****References****\nProgramming\ References\ (\ TCL\ \ )\n----\n\ \ \ *\ \[Simple\ Canvas\ Demo\]\n\ \ \ *\ \[canvas\]\n\ \ \ *\ \[Widgets\ on\ a\ canvas\]\n\ \ \ *\ See\ also\ \[A\ little\ pie\ chart\]\n----\ \ \ \n****Web\ References\ ****\n\n\ \ \ *\ http://en.wikipedia.org/wiki/Pie_chart\n\ \ \ *\ http://www.stariq.com/\n\ \ \ *\ google\ >>\ Astrology\ and\ Horoscope\ Homepage\ -\ Astrodienst\n\ \ \ *\ http://www.astro.com/horoscopes/ahor.asp\n\ \ \ *\ google\ >>\ Babylon\ -\ Wikipedia,\ the\ free\ encyclopedia\n\ \ \ *\ http://en.wikipedia.org/wiki/Babylon\n\ \ \ *\ http://www.geocities.com/astrologyconstellations/nonzodiac.htm\n\ \ \ *\ http://www.nickcampion.com/nc/history/eygptian.html\n\ \ \ *\ http://touregypt.net/featurestories/dendera.htm\n\ \ \ *\ http://en.wikipedia.org/wiki/Dendera\n\ \ \ *\ google\ >>\ urania\ horoscope\ russia\n\ \ \ *\ http://www.urania.ru/english/Chart/index.html\n\ \ \ *\ http://www.urania.ru/english/Chart/fullscreen.html\n\ \ \ *\ For\ total\ eclipse\ on\ 3Mar2007,\n\ \ \ *\ try\ plotting\ London,03:03:2007,GMT\ 2244\ on\ Urania.\ \n\ \ \ *\ http://news.bbc.co.uk/1/hi/sci/tech/6411991.stm\n\ \ \ *\ http://analyzer.depaul.edu/paperplate/Egyptian%20calendar.htm\ \ \n\ \ \ *\ http://www.historylab.org/../calendars/calendars.htm\n\ \ \ *\ google\ >>\ Astronomical\ Ceiling-Decoration\ in\ Tomb\ of\ Senmut\ \n\ \ \ *\ google\ >>\ Senemut\ -\ Wikipedia,\ the\ free\ encyclopedia\n\ \ \ *\ http://en.wikipedia.org/wiki/Senemut\n\ \ \ *\ http://www.geocities.com/astrologyages/images/senmutnorth.jpg\n----\n======\n\ \n\n<<categories>>Toys} CALL {my revision {horoscope pie plotter}} CALL {::oo::Obj1870513 process revision/horoscope+pie+plotter} CALL {::oo::Obj1870511 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