Error processing request

Parameters

CONTENT_LENGTH0
REQUEST_METHODGET
REQUEST_URI/revision/AndroWish%3A+Tips+and+Tricks?V=50
QUERY_STRINGV=50
CONTENT_TYPE
DOCUMENT_URI/revision/AndroWish:+Tips+and+Tricks
DOCUMENT_ROOT/var/www/nikit/nikit/nginx/../docroot
SCGI1
SERVER_PROTOCOLHTTP/1.1
HTTPSon
REMOTE_ADDR172.70.38.115
REMOTE_PORT49734
SERVER_PORT4443
SERVER_NAMEwiki.tcl-lang.org
HTTP_HOSTwiki.tcl-lang.org
HTTP_CONNECTIONKeep-Alive
HTTP_ACCEPT_ENCODINGgzip, br
HTTP_X_FORWARDED_FOR44.205.2.188
HTTP_CF_RAY86bf3cf568060854-IAD
HTTP_X_FORWARDED_PROTOhttps
HTTP_CF_VISITOR{"scheme":"https"}
HTTP_ACCEPT*/*
HTTP_USER_AGENTclaudebot
HTTP_CF_CONNECTING_IP44.205.2.188
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 {AndroWish: Tips and Tricks} **DESCRIPTION**\nThis\ page\ is\ made\ to\ share\ your\ tips\ and\ tricks\ on\ this\ page\ that\ can\ help\ in\ making\ Android\ applications\ using\ \[AndroWish\].\nPlease\ try\ to\ be\ as\ specific\ as\ you\ can\ about\ AndroWish\ specific\ commands\ e.g.\ \[borg\]\ and\ \[sdltk\]\ .\ and\ touch\ screen\ events\nPlease\ give\ as\ many\ relevant\ examples\ as\ you\ can.\n\n\[Superlinux\]:\ An\ example\ on\ using\ `<<PinchToZoom>>`\ .\n\nA\ simple\ way\ to\ zoom\ the\ size\ of\ your\ app\ by\ changing\ the\ default\ font\ of\ the\ whole\ GUI\ made\ by\ Tk\ :\n\n======\nset\ font_size\ 3\ \;#\ default\ starting\ font\ size\ is\ set\ to\ 3\ .\n\nset\ old_fingers_pinch_to_zoom_distance\ 0\ \;#\ keeps\ track\ of\ the\ distance\ between\ the\ pinching\ fingers\ before\ moving\ the\ fingers\ to\ do\ the\ pinch\ move\n\nproc\ pinch_to_zoom\ \{\ fingers_distance\ \}\ \{\n\ \ \ \ global\ old_fingers_pinch_to_zoom_distance\n\ \ \ \ global\ font_size\n\ \ \ \ if\ \{\ \$fingers_distance\ >\ \$old_fingers_pinch_to_zoom_distance\ \}\ \{\n\ \ \ \ \ \ \ \ \ incr\ font_size\n\ \ \ \ \ \ \ \ \ font\ configure\ TkDefaultFont\ -size\ \$font_size\n\ \ \ \ \ \ \ \ \ set\ old_fingers_pinch_to_zoom_distance\ \$fingers_distance\n\ \ \ \ \ \ \ \ \ return\n\ \ \ \ \ \ \ \}\ \n\ \ \ \ \ \ \ \n\ \ \ \ if\ \{\ \$fingers_distance\ <\ \$old_fingers_pinch_to_zoom_distance\ \}\ \{\n\ \ \ \ \ \ \ \ \ \ \ \ if\ \{\ \$font_size\ <=3\ \}\ \{\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ set\ font_size\ 3\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ return\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \}\n\ \ \ \ \ \ \ \ \ \ \ \ \n\ \ \ \ \ \ \ \ \ \ \ \ incr\ font_size\ -1\n\ \ \ \ \ \ \ \ \ \ \ \ font\ configure\ TkDefaultFont\ -size\ \$font_size\n\ \ \ \ \ \ \ \ \ \ \ \ set\ old_fingers_pinch_to_zoom_distance\ \$fingers_distance\n\ \ \ \ \ \ \ \ \ \ \ \ return\n\ \ \ \ \ \ \}\ \ \ \ \ \ \n\}\n\n\nfont\ configure\ TkDefaultFont\ -size\ \$font_size\n\nbind\ .\ <<PinchToZoom>>\ \{\ pinch_to_zoom\ %x\ \}\ \;#\ remember\ that\ %x\ is\ the\ distance\ between\ pinching\ fingers\n\n#\ Activate\ <<PinchToZoom>>\ virtual\ event\ and\ disable\ auto\ zooming\nsdltk\ touchtranslate\ 3\n======\n\n\[HaO\]\ 2015-03-16:\ Thanks\ for\ the\ example.\nThe\ following\ example\ takes\ the\ font\ size\ at\ the\ pinch\ start\ as\ reference\ for\ the\ pinch\ distance.\nIn\ addition,\ it\ scales\ the\ distance\ by\ the\ screen\ size,\ as\ screen\ resolution\ is\ highly\ variant\ on\ smart\ phones.\n\n======tcl\nsdltk\ touchtranslate\ 3\nset\ PinchStartFontSize\ 3\nset\ PinchStartValue\ 0\nbind\ .\ <<PinchToZoom>>\ \{+PinchToZoomDo\ %x\ %s\}\n\nproc\ PinchToZoomDo\ \{X\ State\}\ \{\n\ \ \ \ global\ PinchStartFontSize\n\ \ \ \ global\ PinchStartValue\n\ \ \ \ #\ State\ values:\ 0:Motion,\ 1:Start,\ 2:End\ 1st\ Finger,\ 2:End\ Both\ Fingers\n\ \ \ \ switch\ -exact\ ..\ \$State\ \{\n\ \ \ \ \ \ \ \ 1\ \{\ #\ Start\n\ \ \ \ \ \ \ \ \ \ \ \ set\ PinchStartValue\ \$X\n\ \ \ \ \ \ \ \ \ \ \ \ set\ PinchStartFontSize\ \[font\ actual\ TkDefaultFont\ -size\]\n\ \ \ \ \ \ \ \ \}\n\ \ \ \ \ \ \ \ 0\ -\ 2\ \{\ #\ Motion,\ End\n\ \ \ \ \ \ \ \ \ \ \ \ set\ FontSize\ \[expr\ \{\ \$PinchStartFontSize\ +\ (\$X\ -\ \$PinchStartValue)\ *\ 10\ /\ \[winfo\ screenwidth\ .\]\ \}\]\n\ \ \ \ \ \ \ \ \ \ \ \ if\ \{\$FontSize\ <\ 3\}\ \{set\ FontSize\ 3\}\n\ \ \ \ \ \ \ \ \ \ \ \ font\ configure\ TkDefaultFont\ -size\ \$FontSize\n\ \ \ \ \ \ \ \ \}\n\ \ \ \ \}\n\}\n======\n\n----\n\[JM\]\ 3/21/2014,\ If\ you\ use\ Windows\ PC\ to\ edit\ your\ scripts,\ having\ SSHDroid\ on\ your\ Android\ device\ works\ very\ well\ with\ http://www.chiark.greenend.org.uk/~sgtatham/putty/download.html%|%pscp%|%\ launched\ like\ this\ from\ the\ DOS\ command\ line:\n\ pscp\ -P\ 2222\ C:\\Tcl\\code\\logo2.tcl\ [email protected]:/sdcard/\nIn\ the\ example\ I\ am\ copying\ my\ logo2.tcl\ script\ to\ /sdcard/\ on\ the\ Android\ device\ which\ IP\ address\ is\ 192.168.1.64\ in\ this\ case.\n\"admin\"\ is\ the\ default\ password.\n----\n\[JM\]\ 8/9/2014,\ my\ set\ of\ rc\ files...<<br>>\n.wishrc\n\ set\ env(HOME)\ /sdcard\n\ cd\ ~\n\ source\ wishrc.tcl\n\n\"copywrc.tcl\",\ which\ I\ only\ use\ when\ I\ install\ a\ new\ \[Androwish\]\ version:\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \n\ file\ delete\ /data/data/tk.tcl.wish/files/.wishrc\n\ file\ copy\ .wishrc\ /data/data/tk.tcl.wish/files\n\n\"wishrc.tcl\",\ this\ is\ used\ to\ immediately\ get\ a\ file\ browser\ dialog\ to\ select\ the\ script\ I\ want\ to\ run:\n\ sdltk\ textinput\ on\n\ set\ script\ \[tk_getOpenFile\]\n\ if\ \{\$script\ !=\ \"\"\}\ \{\n\ \ \ source\ \$script\n\ \ \ console\ hide\ \n\ \}\ else\ \{\n\ \ \ puts\ \"hello!\"\n\ \}\n----\n\[JM\]\ 8/9/2014,\ Connecting\ to\ an\ Andriod\ device\ when\ it\ is\ running\ SSHDroid:<<br>>\nI\ am\ using\ Ubuntu:\n\ ssh\ -p\ 2222\ [email protected]\nSee\ you\ specific\ port\ and\ ip\ address\ on\ the\ SSHDroid\ screen\ running\ on\ your\ Android.<<br>>\ndefault\ password\ is\ \"admin\"\n----\n'''\[Superlinux\]\ -\ 2014-03-27\ 10:35:07'''\n\nThis\ is\ an\ example\ on\ how\ to\ send\ your\ text\ or\ HTML\ file\ to\ printing\ on\ paper\ using\ PrintBot.\n\nYou\ can\ find\ PrintBot\ in\ this\ link\ http://play.google.com/store/apps/details?id=net.jsecurity.printbot%|%here%|%\n\nPrinterBot\ is\ a\ network\ printer\ driver\ for\ Android.\ It\ can\ run\ Internet\ Printing\ Protocol\ (IPP).\ \n\nOn\ Linux,\ as\ a\ test,\ install\ CUPS-PDF\ and\ CUPS\ printer\ server\ and\ make\ it\ shared\ on\ the\ local\ network.\n\n\n======\n\ borg\ activity\ net.jsecurity.printbot.action.PRINT\ \"file:///mnt/sdcard/test-page.txt\"\ \"text/html\"\ \{\}\ \{\}\ \{\n\ \ \ borg\ toast\ \"Printing\ completed\"\n\ \}\n======\n\n-----\n\[ET\]\n\nWell,\ AW\ made\ my\ first\ android\ tablet\ purchase\ worth\ every\ penny.\ \n\nSo,\ here's\ my\ .wishrc,\ with\ some\ console\ fun.\ Also\ handy\ for\ fat\ fingers.\ It\ adds\ buttons\ to\ the\ console\ window.\n\nWarning,\ '''careful\ here'''\ if\ you\ mangle\ this,\ you\ might\ not\ have\ a\ console\ to\ use\ to\ correct\ your\ .wishrc\ file\ in\ the\ protected\ zone.\n\nI\ have\ followed\ the\ lead\ here\ of\ having\ files\ in\ /sdcard/home\ which\ I\ can\ modify,\ and\ then\ copy\ as\ needed\ to\ the\ protected\ AW\ zone.\ So,\ it\ goes\ there\ first,\ and\ if\ wishrc.tcl\ is\ found,\ sources\ it\ after\ it\ modifies\ the\ console\ window.\ \n\nThe\ copyit\ button\ on\ the\ console\ window\ will\ do\ that\ for\ you\ if\ you\ use\ these\ folder\ conventions.\ It\ does\ want\ a\ confirmation.\ Same\ with\ exit.\ The\ +x/-x\ resize\ the\ x\ size\ of\ the\ console\ window.\ Bottom\ scrolls\ you\ to\ the\ bottom,\ and\ you\ can\ disable\ scrolling\ with\ the\ checkbox.\ I\ also\ increase\ the\ number\ of\ lines\ to\ 1000.\n\nupdate:\ Fixed\ problem\ with\ width\ adjustments,\ seems\ wm\ geom\ .\ is\ different\ here\ than\ on\ my\ winxp\ system\n\n======\n\ \ \ \ if\ \{\ \$tcl_platform(os)\ !=\ \"Windows\ NT\"\ \}\ \{\ #\ to\ test\ on\ winxp\ before\ going\ live\ on\ android\n\ \ \ \ \ \ \ \ set\ env(HOME)\ /sdcard/home\n\ \ \ \ \ \ \ \ cd\ ~\n\ \ \ \ \}\ else\ \{\ \ \ \ \ \ \ \ \n\ \ \ \ \ \ \ \ console\ show\n\ \ \ \ \}\n\ \ \ \ \n\ \ \ \ package\ require\ Tk\n\ \ \ \ #\ a\ menu\ item\ runs\ this,\ it's\ defined\ here,\ not\ inside\ the\ console\ eval\n\ \ \ \ proc\ menudo\ \{\}\ \{\n\ \ \ \ \ \ \ \ puts\ \"pressed-menu\"\n\ \ \ \ \}\n\ \ \ \ if\ \[catch\ \{\n\ \ \ \ \ \ \ \ console\ eval\ \{\n\ \ \ \ \ \ \ \ \ \ \ \ if\ \{\ !\[info\ exist\ ::tk::do_scroll\]\ \}\ \{\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ set\ menuincr\ 0\ \;#\ some\ consoles\ have\ an\ extra\ item\ in\ the\ edit\ menu\ (a\ font...)\ AW\ doesn't,\ so\ leave\ at\ 0\ for\ now\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ set\ fontsz\ \{times\ 9\}\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ pack\ forget\ .console\ .sb\ .consoleframe\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ pack\ \[frame\ \ .frame\ -bg\ black\]\ -side\ left\ -fill\ y\ -ipady\ 2\ -pady\ 2\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ pack\ \[button\ .frame.clear\ -bg\ blue\ -fg\ white\ -text\ Clear\ -command\ \{.menubar.file\ invoke\ 2\}\ -font\ \$fontsz\]\ -side\ top\ -fill\ x\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ pack\ \[button\ .frame.smaller\ \ \ -bg\ white\ -text\ \{font\ -\}\ -font\ \$fontsz\ -command\ \{.menubar.edit\ invoke\ \[expr\ (\ \$menuincr+6\ )\]\;after\ 100\ \{.frame.repos\ invoke\}\}\]\ -side\ top\ -fill\ x\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ pack\ \[button\ .frame.bigger\ \ \ \ -bg\ white\ -text\ \{font\ +\}\ \ -font\ \$fontsz\ -command\ \{.menubar.edit\ invoke\ \[expr\ (\ \$menuincr+5\ )\]\;after\ 100\ \{.frame.repos\ invoke\}\}\]\ -side\ top\ -fill\ x\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ pack\ \[button\ .frame.exit\ \ \ \ \ -bg\ red\ -fg\ white\ -text\ Exit\ \ -font\ \$fontsz\ -command\ \{exiter\}\]\ -side\ top\ -fill\ x\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ pack\ \[button\ .frame.repos\ -bg\ white\ -text\ Bottom\ -font\ \$fontsz\ -command\ \{.console\ see\ end\;\ .console\ mark\ set\ insert\ end\}\]\ -side\ top\ -fill\ x\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ pack\ \[frame\ \ .frame.frame\ -bg\ black\]\ -side\ top\ \ -fill\ x\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ pack\ \[button\ .frame.frame.m10\ -bg\ gray\ \ -fg\ white\ \ -font\ \$fontsz\ \ \ -text\ -x\ -command\ \{\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ if\ \{\ \[.console\ cget\ -width\]\ >\ 30\ \}\ \{\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ .console\ config\ -width\ \[expr\ (\ \[.console\ cget\ -width\]-10\ )\]\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \}\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \}\]\ -side\ top\ -fill\ x\ -expand\ 1\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ pack\ \[button\ .frame.frame.p10\ -bg\ gray\ \ -fg\ white\ \ -font\ \$fontsz\ \ \ -text\ +x\ -command\ \{\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ if\ \{\ \[.console\ cget\ -width\]\ <\ 120\ \}\ \{\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ .console\ config\ -width\ \[expr\ (\[.console\ cget\ -width\]+10)\]\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \}\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \}\]\ -side\ top\ -fill\ x\ -expand\ 1\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ pack\ \[checkbutton\ .frame.scroll\ -bg\ white\ -fg\ black\ \ -text\ scroll\ \ -font\ \$fontsz\ -variable\ ::tk::do_scroll\]\ -side\ top\ -fill\ x\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ pack\ \[button\ .frame.frame.mit\ -bg\ green\ \ -fg\ white\ \ -font\ \$fontsz\ \ \ -text\ copyit\ -command\ copyit\]\ -side\ top\ -fill\ x\ -expand\ 1\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ pack\ .consoleframe\ -in\ .\ -anchor\ center\ -expand\ 1\ -fill\ both\ -ipadx\ 0\ -ipady\ 0\ -padx\ 0\ -pady\ 0\ -side\ left\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ pack\ .console\ -in\ .consoleframe\ -anchor\ center\ -expand\ 1\ -fill\ both\ -ipadx\ 0\ -ipady\ 0\ -padx\ 1\ -pady\ 1\ -side\ left\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ pack\ .sb\ -in\ .consoleframe\ -anchor\ center\ -expand\ 1\ -fill\ both\ -ipadx\ 0\ -ipady\ 0\ -padx\ 1\ -pady\ 1\ -side\ right\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ #puts\ \"console\ width\ now\ \[.console\ config\ -width\]\ \ \ \[wm\ geom\ .\]\"\ \;#\ hmmm,\ seems\ wm\ geom\ different\ across\ platforms\ here\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ proc\ copyit\ \{\}\ \{\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ set\ answer\ \[tk_messageBox\ -message\ \"Please\ confirm\\nto\ copy\ .wishrc\"\ \ -icon\ question\ -type\ yesno\]\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ if\ \{\ \$answer\ ==\ \"yes\"\ \}\ \{\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ file\ copy\ -force\ .wishrc\ /data/data/tk.tcl.wish/files/\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ puts\ copied\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \}\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \}\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ proc\ exiter\ \{\}\ \{\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ set\ answer\ \[tk_messageBox\ -message\ \"Please\ confirm\ to\ Exit.\"\ \ -icon\ question\ -type\ yesno\]\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ if\ \{\ \$answer\ ==\ \"yes\"\ \}\ \{\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ exit\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \}\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \}\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ set\ ::tk::console::maxLines\ 1000\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ .menubar\ add\ casc\ -label\ Extra\ -menu\ \[menu\ .menubar.extra\ -tearoff\ 0\]\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ proc\ menu+\ \{head\ label\ cmd\}\ \{\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ set\ cmd2\ \[list\ consoleinterp\ eval\ \$cmd\]\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ .menubar.\$head\ add\ command\ -label\ \$label\ -command\ \$cmd2\ \;#\ note\ this\ is\ defined\ outside\ the\ console\ eval...\ its\ in\ the\ normal\ namespace\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \}\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ menu+\ extra\ menu\ menudo\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ proc\ ::tk::ConsoleOutput\ \{dest\ string\}\ \{\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ set\ w\ .console\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \$w\ insert\ output\ \$string\ \$dest\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ ::tk::console::ConstrainBuffer\ \$w\ \$::tk::console::maxLines\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ if\ \{\$::tk::do_scroll\}\ \{\$w\ see\ insert\}\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \}\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ set\ ::tk::do_scroll\ 1\n\ \ \ \ \ \ \ \ \ \ \ \ \}\n\ \ \ \ \ \ \ \ \}\n\ \ \ \ \ \ \ \ \n\ \ \ \ \}\ err_code\]\ \{\n\ \ \ \ \ \ \ \ puts\ \$err_code\n\ \ \ \ \}\n\ \ \ \ if\ \{\ \$tcl_platform(os)\ !=\ \"Windows\ NT\"\ \}\ \{\n\ \ \ \ \ \ \ \ if\ \{\ \[file\ exist\ wishrc.tcl\]\ \}\ \{\n\ \ \ \ \ \ \ \ \ \ \ \ puts\ \"sourcing\ wishrc.tcl\"\n\ \ \ \ \ \ \ \ \ \ \ \ source\ wishrc.tcl\n\ \ \ \ \ \ \ \ \}\ else\ \{\n\ \ \ \ \ \ \ \ \ \ \ \ puts\ stderr\ \"wishrc.tcl\ not\ found\"\n\ \ \ \ \ \ \ \ \}\n\ \ \ \ \}\n\n\n======\n\nHere's\ some\ more\ fun\ with\ the\ console\ and\ a\ little\ test\ of\ flashing\ a\ button.\ It\ should\ run\ on\ any\ 8.6\ setup.\ I\ call\ it\ wishrc.tcl\ to\ test\ it\ on\ my\ tablet.\n\n======\nbutton\ \ .b\ \ \ \ -text\ \"push\ me\\nafter\ I\ stop\"\ -command\ \{wm\ wi\ .\}\ -bg\ black\ -fg\ white\npack\ \ \ \ .b\ \ \ \ -fill\ both\ -expand\ true\ \n\nproc\ uniqkey\ \{\ \}\ \{\n\ \ \ \ set\ key\ \ \ \[\ expr\ \{\ pow(2,31)\ +\ \[\ clock\ clicks\ \]\ \}\ \]\n\ \ \ \ set\ key\ \ \ \[\ string\ range\ \$key\ end-8\ end-3\ \]\n\ \ \ \ set\ key\ \ \ \[\ clock\ seconds\ \]\$key\n\ \ \ \ return\ \$key\n\}\n\nproc\ sleep\ \{\ ms\ \}\ \{\n\ \ \ \ set\ uniq\ \[\ uniqkey\ \]\n\ \ \ \ set\ ::__sleep__tmp__\$uniq\ 0\n\ \ \ \ after\ \$ms\ set\ ::__sleep__tmp__\$uniq\ 1\n\ \ \ \ vwait\ ::__sleep__tmp__\$uniq\n\ \ \ \ unset\ ::__sleep__tmp__\$uniq\n\}\n\nproc\ cputs\ \{dest\ string\}\ \{\n\ \ \ \ if\ \{\ !\ \[info\ exist\ ::tk::my_color_set\]\ \}\ \{\n\ \ \ \ \ \ \ \ set\ ::tk::my_color_set\ 1\n\ \ \ \ \ \ \ \ console\ eval\ \{\n\ \ \ \ \ \ \ \ \ \ \ \ .console\ tag\ configure\ green\ \ \ \ \ \ \ \ \ \ \ \ \ -foreground\ \\#00ff00\ -background\ black\n\ \ \ \ \ \ \ \ \ \ \ \ .console\ tag\ configure\ yellowonblack\ \ \ \ \ -foreground\ yellow\ -background\ black\ -font\ \{courier\ 14\ bold\}\n\ \ \ \ \ \ \ \ \ \ \ \ .console\ tag\ configure\ yellow\ \ \ \ \ \ \ \ \ \ \ \ -foreground\ yellow\n\ \ \ \ \ \ \ \ \ \ \ \ .console\ tag\ configure\ whiteonred\ \ \ \ \ \ \ \ -foreground\ white\ -background\ red\n\ \ \ \ \ \ \ \ \ \ \ \ .console\ tag\ configure\ red\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ -foreground\ red\n\ \ \ \ \ \ \ \ \}\n\ \ \ \ \}\n\ \ \ \ console\ eval\ \[list\ ::tk::ConsoleOutput\ \$dest\ \$string\]\n\}\n\nsleep\ 1000\nwm\ geom\ .\ 200x200+100+100\nsleep\ 2000\nfor\ \{set\ m\ 0\}\ \{\$m\ <\ 5\}\ \{incr\ m\}\ \{\n\ \ \ \ .b\ config\ -bg\ red\ -fg\ white\n\ \ \ \ sleep\ 50\n\ \ \ \ .b\ config\ -bg\ white\ \ -fg\ red\n\ \ \ \ sleep\ 50\n\}\nparray\ env\nconsole\ show\ncputs\ whiteonred\ \"white\ on\ red\ \"\ncputs\ yellowonblack\ \"\ And\ yellow\ on\ black\ and\ big\\n\"\n\n======\n\n----\n'''\[Superlinux\]\ -\ 2014-05-05\ 12:29:55'''\n\nI\ want\ to\ highlight\ a\ little\ thing\ which\ comes\ handy,\ and\ I\ know\ to\ any\ programmer\ this\ would\ look\ silly\ after\ you\ read\ it.\n\nNow\ how\ about\ hearing\ the\ message\ of\ \[\[\ tk_messageBox\ \]\]\ ?\ Yes!\ I\ know\ there's\ \[\[\ borg\ speak\ \$message\ \]\]\ \;\ but\ this\ is\ how\ you\ should\ utilize\ it:\n\n\n\ \ \ *\ If\ you\ want\ to\ hear\ the\ \$message\ ''while''\ the\ \[\[tk_messageBox\]\]\ is\ still\ on\ the\ screen\ first\ you\ start\ \[\[borg\ speak\ \$message\]\]\ then\ run\ \[\[tk_messageBox\]\]\ .\ Example:\n\n\n======\nset\ message\ \"Warning!\ You\ are\ trespassing\ Java\ in\ Android\ using\ Tcl/Tk\ and\ AndroWish!\"\nborg\ speak\ \$message\ntk_messageBox\ -message\ \$message\ -icon\ warning\n======\n\n\ \ \ *\ If\ you\ want\ to\ hear\ the\ \$message\ ''after''\ the\ \[\[tk_messageBox\]\]\ vanishes\ from\ the\ screen\ first\ you\ start\ \[\[tk_messageBox\]\]\ then\ run\ \[\[borg\ speak\ \$message\]\]\ .\ Example:\n======\nset\ message\ \"Warning!\ You\ are\ trespassing\ Java\ in\ Android\ using\ Tcl/Tk\ and\ AndroWish!\"\ntk_messageBox\ -message\ \$message\ -icon\ warning\nborg\ speak\ \$message\n======\n\nThis\ should\ show\ and\ prove\ you\ that\ \[\[borg\ speak\]\]\ works\ in\ a\ separate\ thread.\ --\ \[RS\]\ 2014-05-08:\ As\ I\ just\ tested\ in\ an\ interactive\ \[wish\]\ on\ Windows\ 7,\ \[tk_messageBox\]\ just\ blocks\ until\ dismissed\ with\ the\ OK\ button.\n\n----\n\[HE\]\ 2014-08-17\ I\ played\ today\ with\ menu\ and\ found\ it\ difficult\ to\ use\ them\ with\ the\ default\ font.\ I\ could\ read\ them\ but\ using\ them\ was\ quit\ difficult.\ The\ same\ with\ text\ inside\ entries\ and\ buttons.\nComparing\ with\ windows\ I\ saw\ also\ that\ we\ can't\ be\ sure\ that\ we\ have\ STANDARD\ FONTS\ defined\ as\ a\ default\ value.\ And\ I\ saw\ that\ the\ font\ size\ results\ nearly\ to\ the\ same\ size\ regardless\ of\ the\ screen\ (at\ least\ on\ the\ both\ android\ devices,\ one\ 4\"\ and\ one\ 8\",\ and\ the\ win7\ device).\ \nThe\ following\ code\ changes\ the\ default\ value\ when\ used\ at\ the\ beginning\ of\ the\ code\n======\noption\ add\ *Menu.Font\ \ \ TkMenuFont\ widgetDefault\noption\ add\ *Button.Font\ TkTextFont\ widgetDefault\noption\ add\ *Entry.Font\ \ TkTextFont\ widgetDefault\noption\ add\ *Label.Font\ \ TkTextFont\ widgetDefault\nfont\ configure\ TkMenuFont\ -size\ 12\nfont\ configure\ TkTextFont\ -size\ 12\n======\nI\ have\ to\ use\ 'font\ configure'\ because\ I\ couldn't\ find\ out\ how\ to\ change\ the\ named\ standard\ fonts\ with\ the\ option\ command.\n\nThe\ other\ value\ which\ is\ to\ small\ for\ me\ is\ the\ default\ width\ of\ the\ scrollbars.\ Looking\ for\ a\ device\ independent\ way\ I\ come\ to\ the\ following\ solution\ as\ a\ first\ draft:\n======\nset\ stdPixProMm\ 4\noption\ add\ *Scrollbar.width\ \[expr\ \{16\ *\ \[winfo\ screenwidth\ .\]\ *\ 1.0\ /\ (\[winfo\ screenmmwidth\ .\]\ *\ \$stdPixProMm)\}\]\ widgetDefault\n======\nThe\ stdPixProMm\ defines\ the\ amount\ of\ pixels\ per\ mm\ on\ a\ standard\ screen.\ I'm\ not\ sure\ if\ this\ is\ the\ best\ value\ for\ it\ because\ I\ also\ found\ out\ that\ 'winfo\ screenmmwidth'\ and\ 'screenmmheight'\ on\ the\ win7\ doesn't\ return\ the\ correct\ values.\ But\ the\ result\ provides\ on\ all\ three\ devices\ scrollbars\ with\ a\ width\ which\ is\ usable\ with\ fingers.\n\n\n----\n'''\[kc\]\ -\ 2014-09-30\ 03:17:15'''\n\nCan\ anyone\ tell\ how\ to\ adjust\ screen\ brightness\ in\ androwish?\ I\ tried\ \"borg\ content\ update\"\ but\ it\ won't\ work.May\ be\ done\ with\ wrong\ parameter.Please\ help!\n\n----\n'''\[JDA\]\ -\ 2015-01-16\ 17:15'''\n\nIs\ there\ a\ means\ in\ androwish\ to\ access\ openGL\ libraries?\n\nAndrowish\ rocks!\ \ I\ just\ discovered\ Androwish.\ \ I\ was\ able\ to\ download,\ install,\ and\ build\ the\ sample\ helloTclTk\ example\ and\ run\ it\ on\ my\ Motorola\ cell\ phone\ in\ addition\ to\ porting\ a\ small\ Tcl\ script.\ \ This\ all\ in\ less\ than\ a\ few\ hours\ (did\ not\ know\ how\ to\ build\ an\ android\ app).\ \ Androwish\ is\ simply\ awesome.\ \ Thank-you!!\n\n----\n\[HaO\]\ 2015-02-27:\ Scroll\ canvas\ with\ finger.\n\nHere\ is\ a\ solution\ skeleton\ to\ scroll\ a\ canvas\ so\ it\ follows\ the\ finger.\n\n======tcl\nset\ canvas\ \[canvas\ \$base.canvas\ -xscrollincrement\ 1\ -yscrollincrement\ 1\]\nbind\ \$canvas\ <<FingerDown>>\ \[list\ +motion\ start\ \$canvas\ %W\ %x\ %y\ %s\]\nbind\ \$canvas\ <<FingerMotion>>\ \[list\ +motion\ motion\ \$canvas\ %W\ %x\ %y\ %s\]\n\nproc\ motion\ \{mode\ path\ W\ X\ Y\ finger\}\ \{\n\ \ \ \ \ \ \ \ global\ movex\n\ \ \ \ \ \ \ \ global\ movey\n\ \ \ \ \ \ \ \ if\ \{\$finger\ !=\ 1\}\ \{return\}\n\ \ \ \ \ \ \ \ if\ \{\$mode\ eq\ \"motion\"\ &&\ \[winfo\ exists\ \$path\]\ \ &&\ \ \[string\ match\ \$path*\ \$W\]\ \}\ \{\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \$path\ xview\ scroll\ \[expr\ \{\ (\$movex\ -\ \$X)\ *\ \[winfo\ screenwidth\ .\]\ /\ 10000\ \}\ \]\ units\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \$path\ yview\ scroll\ \[expr\ \{\ (\$movey\ -\ \$Y)\ *\ \[winfo\ screenheight\ .\]\ /\ 10000\ \}\ \]\ units\n\ \ \ \ \ \ \ \ \}\n\ \ \ \ \ \ \ \ set\ movex\ \$X\n\ \ \ \ \ \ \ \ set\ movey\ \$Y\n\ \ \ \ \ \ \ \ return\n\}\n======\n\n\[chw\]\ 2015-02-27:\ there's\ even\ a\ shorter\ solution\ which\ works\ OOTB\ due\ to\ the\ default\ setting\ of\ \"sdltk\ touchtranslate\ ...\".\nIt\ uses\ the\ middle\ mouse\ button\ emulation\ for\ panning\ the\ entire\ canvas\ with\ fast\ wipes.\ Slow\ wipes\ deliver\ still\ left\nmouse\ button\ events\ e.g.\ for\ moving\ the\ currently\ active\ canvas\ item.\n\n======tcl\nset\ canvas\ \[canvas\ \$base.canvas\ -xscrollincrement\ 1\ -yscrollincrement\ 1\]\n#\ following\ lines\ borrowed\ from\ /assets/sdl2tk8.6/demos/items.tcl:\nbind\ \$canvas\ <2>\ \"\$canvas\ scan\ mark\ %x\ %y\"\nbind\ \$canvas\ <B2-Motion>\ \"\$canvas\ scan\ dragto\ %x\ %y\ 1\"\n======\n\n----\n\[chw\]\ 2015-09-11:\ Minimalist\ webcam\ using\ \[AndroWish\]'s\ borg\ camera\ command\n\n\n======tcl\n#\ http://<ip-of-device>:8080/....\ takes\ a\ JPEG\ picture\nproc\ init\ \{\}\ \{\n\ \ \ \ destroy\ .label\n\ \ \ \ borg\ camera\ close\n\ \ \ \ catch\ \{image\ delete\ img\}\n\ \ \ \ image\ create\ photo\ img\ -width\ 640\ -height\ 480\n\ \ \ \ borg\ camera\ open\n\ \ \ \ borg\ camera\ parameters\ picture-size\ 640x480\ jpeg-quality\ 80\n\ \ \ \ bind\ .\ <<ImageCapture>>\ \{borg\ camera\ image\ img\}\n\ \ \ \ borg\ camera\ start\n\ \ \ \ pack\ \[label\ .label\ -image\ img\]\n\ \ \ \ socket\ -server\ request\ 8080\n\}\nproc\ request\ \{sock\ args\}\ \{\n\ \ \ \ chan\ configure\ \$sock\ -translation\ binary\ -blocking\ 0\ -buffering\ none\n\ \ \ \ after\ 100\n\ \ \ \ catch\ \{chan\ read\ \$sock\ 1000\}\ err\n\ \ \ \ chan\ configure\ \$sock\ -blocking\ 1\n\ \ \ \ if\ \{!\[borg\ camera\ takejpeg\]\}\ \{\n\ \ \ \ \ \ \ \ chan\ close\ \$sock\n\ \ \ \ \ \ \ \ return\n\ \ \ \ \}\n\ \ \ \ bind\ .\ <<PictureTaken>>\ \[list\ send_jpeg\ \$sock\]\n\ \ \ \ chan\ puts\ -nonewline\ \$sock\ \\\n\ \ \ \ \ \ \ \ \"HTTP/1.0\ 200\ OK\\rConnection:\ close\\r\\nContent-Type:\ image/jpeg\\r\\n\\r\\n\"\n\}\nproc\ send_jpeg\ \{sock\}\ \{\n\ \ \ \ bind\ .\ <<PictureTaken>>\ \{\}\n\ \ \ \ catch\ \{chan\ puts\ -nonewline\ \$sock\ \[borg\ camera\ jpeg\]\}\n\ \ \ \ catch\ \{chan\ close\ \$sock\}\n\ \ \ \ borg\ camera\ start\n\}\ninit\n\n======\n\[JM\]\ 9/5/2017,\ when\ using\ the\ webcam\ example\ from\ the\ VFS\ mounted\ assets\ folder,\ something\ does\ not\ work\ on\ my\ phone\ to\ get\ the\ IP\ address\ and\ appears\ OFFLINE,\ but\ it\ is\ actually\ ONLINE.<<br>>\nOther\ than\ that,\ knowing\ the\ IP\ address\ by\ means\ of\ SSHDroid,\ the\ sample\ works\ great.\n======\n\n****How\ to\ get\ a\ device's\ dhcp\ data,\ ip\ address,\ e.t.c****\nProvided\ wifi\ hardware\ exists,\ and\ the\ device\ is\ connected\ by\ dhcp:\n\n\ \ \ \ borg\ systemproperties\ \ \ wifi.interface\ \ \ \ \ \ \ \ \;#\ find\ wifi\ interface,\ here\ 'wlan0'\n\ \ \ \ borg\ systemproperties\ \ \ dhcp.wlan0.ipaddress\ \ \;#\ find\ device\ ip\ address\ for\ the\ given\ interface,\ i.e.\ 'wlan0'\n\ \ \ \ borg\ systemproperties\ \ \ dhcp.wlan0.server\ \ \ \ \ \;#\ find\ access\ point\ address\n\n\[dzach\]\ 2015-11-18:\ \[chw\]'s\ creative\ frenzy\ continuously\ sprouts\ new\ functionality\ and\ tips.\ Here\ is\ his\ reply\ to\ a\ request\ for\ turning\ ''on|off''\ the\ camera's\ LED:\n\n\ \ \ \ \[Camera's\ LED\ c\]an\ be\ controlled\ with\ \"borg\ camera\"\ command\ but\ is\ device\ dependent.\n\n\ \ \ \ On\ my\ smartphone\ (HTC\ One\ V)\ this\ sequence\ works:\n\n\ \ \ \ borg\ camera\ open\n\ \ \ \ #\ LED\ on\n\ \ \ \ borg\ camera\ parameter\ flash-mode\ torch\n\ \ \ \ #\ LED\ off\n\ \ \ \ borg\ camera\ parameter\ flash-mode\ off\n\n****How\ to\ get\ contact\ info****\n\[dzach\]\ 2015-12-26:\ \[chw\]\ mentions\ the\ source\ code\ of\ Android\ as\ a\ place\ to\ find\ more\ uses\ for\ ''content://...''.\ Indeed,\ using\ the\ source\ code\ is\ the\ fastest\ way\ to\ get\ some\ guidance\ in\ the\ class\ hell\ of\ Android.\ Here\ is\ how\ to\ gain\ access\ to\ the\ contacts\ content,\ found\ in\ ''.../android-sdk-linux/sources/android-23/android/provider/ContactsContract.java'':\n\n\ \ \ \ set\ cursor\ \[borg\ content\ query\ content://com.android.contacts/contacts\]\n\ \ \ \ while\ \{\[\$cursor\ move\ 1\]\}\ \{\n\ \ \ \ \ \ \ \ puts\ \[\$cursor\ getrow\]\n\ \ \ \ \}\n\ \ \ \ \$cursor\ close\n\nor\n\n\ \ \ \ content://com.android.contacts/data/phones\n\nto\ get\ the\ contacts\ phones\ listed,\ or\ use\n\n\ \ \ \ content://com.android.contacts/contacts/filter/<put\ filter\ data\ here>\n\ \ \ \ content://com.android.contacts/data/phones/filter/<put\ filter\ data\ here>\n\nto\ get\ filtered\ contact\ results.\n\nIf,\ instead,\ you\ want\ to\ bring\ up\ the\ contact\ picker\ to\ select\ a\ contact\ from\ there,\ and\ return\ it\ to\ your\ app,\ then\ you\ can\ use\ the\ following:\n\n\ \ \ \ borg\ activity\ android.intent.action.PICK\ \{\}\ \"vnd.android.cursor.dir/contact\"\ \{\}\ \{\}\ \{\}\ callback\nor\n\ \ \ \ borg\ activity\ android.intent.action.PICK\ content://contacts/people\ \{\}\ \{\}\ \{\}\ \{\}\ callback\nand\ then,\ after\ having\ picked\ a\ contact,\ use\ the\ result\ returned\ by\ the\ ''callback''\ in\ a\ ''borg\ content\ query\ content://...''\ call\ to\ get\ the\ contact\ info\ needed.\n\n<<categories>>Android regexp2} CALL {my render {AndroWish: Tips and Tricks} **DESCRIPTION**\nThis\ page\ is\ made\ to\ share\ your\ tips\ and\ tricks\ on\ this\ page\ that\ can\ help\ in\ making\ Android\ applications\ using\ \[AndroWish\].\nPlease\ try\ to\ be\ as\ specific\ as\ you\ can\ about\ AndroWish\ specific\ commands\ e.g.\ \[borg\]\ and\ \[sdltk\]\ .\ and\ touch\ screen\ events\nPlease\ give\ as\ many\ relevant\ examples\ as\ you\ can.\n\n\[Superlinux\]:\ An\ example\ on\ using\ `<<PinchToZoom>>`\ .\n\nA\ simple\ way\ to\ zoom\ the\ size\ of\ your\ app\ by\ changing\ the\ default\ font\ of\ the\ whole\ GUI\ made\ by\ Tk\ :\n\n======\nset\ font_size\ 3\ \;#\ default\ starting\ font\ size\ is\ set\ to\ 3\ .\n\nset\ old_fingers_pinch_to_zoom_distance\ 0\ \;#\ keeps\ track\ of\ the\ distance\ between\ the\ pinching\ fingers\ before\ moving\ the\ fingers\ to\ do\ the\ pinch\ move\n\nproc\ pinch_to_zoom\ \{\ fingers_distance\ \}\ \{\n\ \ \ \ global\ old_fingers_pinch_to_zoom_distance\n\ \ \ \ global\ font_size\n\ \ \ \ if\ \{\ \$fingers_distance\ >\ \$old_fingers_pinch_to_zoom_distance\ \}\ \{\n\ \ \ \ \ \ \ \ \ incr\ font_size\n\ \ \ \ \ \ \ \ \ font\ configure\ TkDefaultFont\ -size\ \$font_size\n\ \ \ \ \ \ \ \ \ set\ old_fingers_pinch_to_zoom_distance\ \$fingers_distance\n\ \ \ \ \ \ \ \ \ return\n\ \ \ \ \ \ \ \}\ \n\ \ \ \ \ \ \ \n\ \ \ \ if\ \{\ \$fingers_distance\ <\ \$old_fingers_pinch_to_zoom_distance\ \}\ \{\n\ \ \ \ \ \ \ \ \ \ \ \ if\ \{\ \$font_size\ <=3\ \}\ \{\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ set\ font_size\ 3\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ return\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \}\n\ \ \ \ \ \ \ \ \ \ \ \ \n\ \ \ \ \ \ \ \ \ \ \ \ incr\ font_size\ -1\n\ \ \ \ \ \ \ \ \ \ \ \ font\ configure\ TkDefaultFont\ -size\ \$font_size\n\ \ \ \ \ \ \ \ \ \ \ \ set\ old_fingers_pinch_to_zoom_distance\ \$fingers_distance\n\ \ \ \ \ \ \ \ \ \ \ \ return\n\ \ \ \ \ \ \}\ \ \ \ \ \ \n\}\n\n\nfont\ configure\ TkDefaultFont\ -size\ \$font_size\n\nbind\ .\ <<PinchToZoom>>\ \{\ pinch_to_zoom\ %x\ \}\ \;#\ remember\ that\ %x\ is\ the\ distance\ between\ pinching\ fingers\n\n#\ Activate\ <<PinchToZoom>>\ virtual\ event\ and\ disable\ auto\ zooming\nsdltk\ touchtranslate\ 3\n======\n\n\[HaO\]\ 2015-03-16:\ Thanks\ for\ the\ example.\nThe\ following\ example\ takes\ the\ font\ size\ at\ the\ pinch\ start\ as\ reference\ for\ the\ pinch\ distance.\nIn\ addition,\ it\ scales\ the\ distance\ by\ the\ screen\ size,\ as\ screen\ resolution\ is\ highly\ variant\ on\ smart\ phones.\n\n======tcl\nsdltk\ touchtranslate\ 3\nset\ PinchStartFontSize\ 3\nset\ PinchStartValue\ 0\nbind\ .\ <<PinchToZoom>>\ \{+PinchToZoomDo\ %x\ %s\}\n\nproc\ PinchToZoomDo\ \{X\ State\}\ \{\n\ \ \ \ global\ PinchStartFontSize\n\ \ \ \ global\ PinchStartValue\n\ \ \ \ #\ State\ values:\ 0:Motion,\ 1:Start,\ 2:End\ 1st\ Finger,\ 2:End\ Both\ Fingers\n\ \ \ \ switch\ -exact\ ..\ \$State\ \{\n\ \ \ \ \ \ \ \ 1\ \{\ #\ Start\n\ \ \ \ \ \ \ \ \ \ \ \ set\ PinchStartValue\ \$X\n\ \ \ \ \ \ \ \ \ \ \ \ set\ PinchStartFontSize\ \[font\ actual\ TkDefaultFont\ -size\]\n\ \ \ \ \ \ \ \ \}\n\ \ \ \ \ \ \ \ 0\ -\ 2\ \{\ #\ Motion,\ End\n\ \ \ \ \ \ \ \ \ \ \ \ set\ FontSize\ \[expr\ \{\ \$PinchStartFontSize\ +\ (\$X\ -\ \$PinchStartValue)\ *\ 10\ /\ \[winfo\ screenwidth\ .\]\ \}\]\n\ \ \ \ \ \ \ \ \ \ \ \ if\ \{\$FontSize\ <\ 3\}\ \{set\ FontSize\ 3\}\n\ \ \ \ \ \ \ \ \ \ \ \ font\ configure\ TkDefaultFont\ -size\ \$FontSize\n\ \ \ \ \ \ \ \ \}\n\ \ \ \ \}\n\}\n======\n\n----\n\[JM\]\ 3/21/2014,\ If\ you\ use\ Windows\ PC\ to\ edit\ your\ scripts,\ having\ SSHDroid\ on\ your\ Android\ device\ works\ very\ well\ with\ http://www.chiark.greenend.org.uk/~sgtatham/putty/download.html%|%pscp%|%\ launched\ like\ this\ from\ the\ DOS\ command\ line:\n\ pscp\ -P\ 2222\ C:\\Tcl\\code\\logo2.tcl\ [email protected]:/sdcard/\nIn\ the\ example\ I\ am\ copying\ my\ logo2.tcl\ script\ to\ /sdcard/\ on\ the\ Android\ device\ which\ IP\ address\ is\ 192.168.1.64\ in\ this\ case.\n\"admin\"\ is\ the\ default\ password.\n----\n\[JM\]\ 8/9/2014,\ my\ set\ of\ rc\ files...<<br>>\n.wishrc\n\ set\ env(HOME)\ /sdcard\n\ cd\ ~\n\ source\ wishrc.tcl\n\n\"copywrc.tcl\",\ which\ I\ only\ use\ when\ I\ install\ a\ new\ \[Androwish\]\ version:\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \n\ file\ delete\ /data/data/tk.tcl.wish/files/.wishrc\n\ file\ copy\ .wishrc\ /data/data/tk.tcl.wish/files\n\n\"wishrc.tcl\",\ this\ is\ used\ to\ immediately\ get\ a\ file\ browser\ dialog\ to\ select\ the\ script\ I\ want\ to\ run:\n\ sdltk\ textinput\ on\n\ set\ script\ \[tk_getOpenFile\]\n\ if\ \{\$script\ !=\ \"\"\}\ \{\n\ \ \ source\ \$script\n\ \ \ console\ hide\ \n\ \}\ else\ \{\n\ \ \ puts\ \"hello!\"\n\ \}\n----\n\[JM\]\ 8/9/2014,\ Connecting\ to\ an\ Andriod\ device\ when\ it\ is\ running\ SSHDroid:<<br>>\nI\ am\ using\ Ubuntu:\n\ ssh\ -p\ 2222\ [email protected]\nSee\ you\ specific\ port\ and\ ip\ address\ on\ the\ SSHDroid\ screen\ running\ on\ your\ Android.<<br>>\ndefault\ password\ is\ \"admin\"\n----\n'''\[Superlinux\]\ -\ 2014-03-27\ 10:35:07'''\n\nThis\ is\ an\ example\ on\ how\ to\ send\ your\ text\ or\ HTML\ file\ to\ printing\ on\ paper\ using\ PrintBot.\n\nYou\ can\ find\ PrintBot\ in\ this\ link\ http://play.google.com/store/apps/details?id=net.jsecurity.printbot%|%here%|%\n\nPrinterBot\ is\ a\ network\ printer\ driver\ for\ Android.\ It\ can\ run\ Internet\ Printing\ Protocol\ (IPP).\ \n\nOn\ Linux,\ as\ a\ test,\ install\ CUPS-PDF\ and\ CUPS\ printer\ server\ and\ make\ it\ shared\ on\ the\ local\ network.\n\n\n======\n\ borg\ activity\ net.jsecurity.printbot.action.PRINT\ \"file:///mnt/sdcard/test-page.txt\"\ \"text/html\"\ \{\}\ \{\}\ \{\n\ \ \ borg\ toast\ \"Printing\ completed\"\n\ \}\n======\n\n-----\n\[ET\]\n\nWell,\ AW\ made\ my\ first\ android\ tablet\ purchase\ worth\ every\ penny.\ \n\nSo,\ here's\ my\ .wishrc,\ with\ some\ console\ fun.\ Also\ handy\ for\ fat\ fingers.\ It\ adds\ buttons\ to\ the\ console\ window.\n\nWarning,\ '''careful\ here'''\ if\ you\ mangle\ this,\ you\ might\ not\ have\ a\ console\ to\ use\ to\ correct\ your\ .wishrc\ file\ in\ the\ protected\ zone.\n\nI\ have\ followed\ the\ lead\ here\ of\ having\ files\ in\ /sdcard/home\ which\ I\ can\ modify,\ and\ then\ copy\ as\ needed\ to\ the\ protected\ AW\ zone.\ So,\ it\ goes\ there\ first,\ and\ if\ wishrc.tcl\ is\ found,\ sources\ it\ after\ it\ modifies\ the\ console\ window.\ \n\nThe\ copyit\ button\ on\ the\ console\ window\ will\ do\ that\ for\ you\ if\ you\ use\ these\ folder\ conventions.\ It\ does\ want\ a\ confirmation.\ Same\ with\ exit.\ The\ +x/-x\ resize\ the\ x\ size\ of\ the\ console\ window.\ Bottom\ scrolls\ you\ to\ the\ bottom,\ and\ you\ can\ disable\ scrolling\ with\ the\ checkbox.\ I\ also\ increase\ the\ number\ of\ lines\ to\ 1000.\n\nupdate:\ Fixed\ problem\ with\ width\ adjustments,\ seems\ wm\ geom\ .\ is\ different\ here\ than\ on\ my\ winxp\ system\n\n======\n\ \ \ \ if\ \{\ \$tcl_platform(os)\ !=\ \"Windows\ NT\"\ \}\ \{\ #\ to\ test\ on\ winxp\ before\ going\ live\ on\ android\n\ \ \ \ \ \ \ \ set\ env(HOME)\ /sdcard/home\n\ \ \ \ \ \ \ \ cd\ ~\n\ \ \ \ \}\ else\ \{\ \ \ \ \ \ \ \ \n\ \ \ \ \ \ \ \ console\ show\n\ \ \ \ \}\n\ \ \ \ \n\ \ \ \ package\ require\ Tk\n\ \ \ \ #\ a\ menu\ item\ runs\ this,\ it's\ defined\ here,\ not\ inside\ the\ console\ eval\n\ \ \ \ proc\ menudo\ \{\}\ \{\n\ \ \ \ \ \ \ \ puts\ \"pressed-menu\"\n\ \ \ \ \}\n\ \ \ \ if\ \[catch\ \{\n\ \ \ \ \ \ \ \ console\ eval\ \{\n\ \ \ \ \ \ \ \ \ \ \ \ if\ \{\ !\[info\ exist\ ::tk::do_scroll\]\ \}\ \{\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ set\ menuincr\ 0\ \;#\ some\ consoles\ have\ an\ extra\ item\ in\ the\ edit\ menu\ (a\ font...)\ AW\ doesn't,\ so\ leave\ at\ 0\ for\ now\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ set\ fontsz\ \{times\ 9\}\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ pack\ forget\ .console\ .sb\ .consoleframe\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ pack\ \[frame\ \ .frame\ -bg\ black\]\ -side\ left\ -fill\ y\ -ipady\ 2\ -pady\ 2\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ pack\ \[button\ .frame.clear\ -bg\ blue\ -fg\ white\ -text\ Clear\ -command\ \{.menubar.file\ invoke\ 2\}\ -font\ \$fontsz\]\ -side\ top\ -fill\ x\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ pack\ \[button\ .frame.smaller\ \ \ -bg\ white\ -text\ \{font\ -\}\ -font\ \$fontsz\ -command\ \{.menubar.edit\ invoke\ \[expr\ (\ \$menuincr+6\ )\]\;after\ 100\ \{.frame.repos\ invoke\}\}\]\ -side\ top\ -fill\ x\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ pack\ \[button\ .frame.bigger\ \ \ \ -bg\ white\ -text\ \{font\ +\}\ \ -font\ \$fontsz\ -command\ \{.menubar.edit\ invoke\ \[expr\ (\ \$menuincr+5\ )\]\;after\ 100\ \{.frame.repos\ invoke\}\}\]\ -side\ top\ -fill\ x\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ pack\ \[button\ .frame.exit\ \ \ \ \ -bg\ red\ -fg\ white\ -text\ Exit\ \ -font\ \$fontsz\ -command\ \{exiter\}\]\ -side\ top\ -fill\ x\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ pack\ \[button\ .frame.repos\ -bg\ white\ -text\ Bottom\ -font\ \$fontsz\ -command\ \{.console\ see\ end\;\ .console\ mark\ set\ insert\ end\}\]\ -side\ top\ -fill\ x\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ pack\ \[frame\ \ .frame.frame\ -bg\ black\]\ -side\ top\ \ -fill\ x\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ pack\ \[button\ .frame.frame.m10\ -bg\ gray\ \ -fg\ white\ \ -font\ \$fontsz\ \ \ -text\ -x\ -command\ \{\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ if\ \{\ \[.console\ cget\ -width\]\ >\ 30\ \}\ \{\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ .console\ config\ -width\ \[expr\ (\ \[.console\ cget\ -width\]-10\ )\]\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \}\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \}\]\ -side\ top\ -fill\ x\ -expand\ 1\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ pack\ \[button\ .frame.frame.p10\ -bg\ gray\ \ -fg\ white\ \ -font\ \$fontsz\ \ \ -text\ +x\ -command\ \{\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ if\ \{\ \[.console\ cget\ -width\]\ <\ 120\ \}\ \{\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ .console\ config\ -width\ \[expr\ (\[.console\ cget\ -width\]+10)\]\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \}\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \}\]\ -side\ top\ -fill\ x\ -expand\ 1\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ pack\ \[checkbutton\ .frame.scroll\ -bg\ white\ -fg\ black\ \ -text\ scroll\ \ -font\ \$fontsz\ -variable\ ::tk::do_scroll\]\ -side\ top\ -fill\ x\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ pack\ \[button\ .frame.frame.mit\ -bg\ green\ \ -fg\ white\ \ -font\ \$fontsz\ \ \ -text\ copyit\ -command\ copyit\]\ -side\ top\ -fill\ x\ -expand\ 1\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ pack\ .consoleframe\ -in\ .\ -anchor\ center\ -expand\ 1\ -fill\ both\ -ipadx\ 0\ -ipady\ 0\ -padx\ 0\ -pady\ 0\ -side\ left\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ pack\ .console\ -in\ .consoleframe\ -anchor\ center\ -expand\ 1\ -fill\ both\ -ipadx\ 0\ -ipady\ 0\ -padx\ 1\ -pady\ 1\ -side\ left\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ pack\ .sb\ -in\ .consoleframe\ -anchor\ center\ -expand\ 1\ -fill\ both\ -ipadx\ 0\ -ipady\ 0\ -padx\ 1\ -pady\ 1\ -side\ right\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ #puts\ \"console\ width\ now\ \[.console\ config\ -width\]\ \ \ \[wm\ geom\ .\]\"\ \;#\ hmmm,\ seems\ wm\ geom\ different\ across\ platforms\ here\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ proc\ copyit\ \{\}\ \{\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ set\ answer\ \[tk_messageBox\ -message\ \"Please\ confirm\\nto\ copy\ .wishrc\"\ \ -icon\ question\ -type\ yesno\]\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ if\ \{\ \$answer\ ==\ \"yes\"\ \}\ \{\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ file\ copy\ -force\ .wishrc\ /data/data/tk.tcl.wish/files/\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ puts\ copied\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \}\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \}\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ proc\ exiter\ \{\}\ \{\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ set\ answer\ \[tk_messageBox\ -message\ \"Please\ confirm\ to\ Exit.\"\ \ -icon\ question\ -type\ yesno\]\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ if\ \{\ \$answer\ ==\ \"yes\"\ \}\ \{\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ exit\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \}\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \}\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ set\ ::tk::console::maxLines\ 1000\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ .menubar\ add\ casc\ -label\ Extra\ -menu\ \[menu\ .menubar.extra\ -tearoff\ 0\]\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ proc\ menu+\ \{head\ label\ cmd\}\ \{\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ set\ cmd2\ \[list\ consoleinterp\ eval\ \$cmd\]\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ .menubar.\$head\ add\ command\ -label\ \$label\ -command\ \$cmd2\ \;#\ note\ this\ is\ defined\ outside\ the\ console\ eval...\ its\ in\ the\ normal\ namespace\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \}\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ menu+\ extra\ menu\ menudo\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ proc\ ::tk::ConsoleOutput\ \{dest\ string\}\ \{\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ set\ w\ .console\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \$w\ insert\ output\ \$string\ \$dest\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ ::tk::console::ConstrainBuffer\ \$w\ \$::tk::console::maxLines\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ if\ \{\$::tk::do_scroll\}\ \{\$w\ see\ insert\}\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \}\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ set\ ::tk::do_scroll\ 1\n\ \ \ \ \ \ \ \ \ \ \ \ \}\n\ \ \ \ \ \ \ \ \}\n\ \ \ \ \ \ \ \ \n\ \ \ \ \}\ err_code\]\ \{\n\ \ \ \ \ \ \ \ puts\ \$err_code\n\ \ \ \ \}\n\ \ \ \ if\ \{\ \$tcl_platform(os)\ !=\ \"Windows\ NT\"\ \}\ \{\n\ \ \ \ \ \ \ \ if\ \{\ \[file\ exist\ wishrc.tcl\]\ \}\ \{\n\ \ \ \ \ \ \ \ \ \ \ \ puts\ \"sourcing\ wishrc.tcl\"\n\ \ \ \ \ \ \ \ \ \ \ \ source\ wishrc.tcl\n\ \ \ \ \ \ \ \ \}\ else\ \{\n\ \ \ \ \ \ \ \ \ \ \ \ puts\ stderr\ \"wishrc.tcl\ not\ found\"\n\ \ \ \ \ \ \ \ \}\n\ \ \ \ \}\n\n\n======\n\nHere's\ some\ more\ fun\ with\ the\ console\ and\ a\ little\ test\ of\ flashing\ a\ button.\ It\ should\ run\ on\ any\ 8.6\ setup.\ I\ call\ it\ wishrc.tcl\ to\ test\ it\ on\ my\ tablet.\n\n======\nbutton\ \ .b\ \ \ \ -text\ \"push\ me\\nafter\ I\ stop\"\ -command\ \{wm\ wi\ .\}\ -bg\ black\ -fg\ white\npack\ \ \ \ .b\ \ \ \ -fill\ both\ -expand\ true\ \n\nproc\ uniqkey\ \{\ \}\ \{\n\ \ \ \ set\ key\ \ \ \[\ expr\ \{\ pow(2,31)\ +\ \[\ clock\ clicks\ \]\ \}\ \]\n\ \ \ \ set\ key\ \ \ \[\ string\ range\ \$key\ end-8\ end-3\ \]\n\ \ \ \ set\ key\ \ \ \[\ clock\ seconds\ \]\$key\n\ \ \ \ return\ \$key\n\}\n\nproc\ sleep\ \{\ ms\ \}\ \{\n\ \ \ \ set\ uniq\ \[\ uniqkey\ \]\n\ \ \ \ set\ ::__sleep__tmp__\$uniq\ 0\n\ \ \ \ after\ \$ms\ set\ ::__sleep__tmp__\$uniq\ 1\n\ \ \ \ vwait\ ::__sleep__tmp__\$uniq\n\ \ \ \ unset\ ::__sleep__tmp__\$uniq\n\}\n\nproc\ cputs\ \{dest\ string\}\ \{\n\ \ \ \ if\ \{\ !\ \[info\ exist\ ::tk::my_color_set\]\ \}\ \{\n\ \ \ \ \ \ \ \ set\ ::tk::my_color_set\ 1\n\ \ \ \ \ \ \ \ console\ eval\ \{\n\ \ \ \ \ \ \ \ \ \ \ \ .console\ tag\ configure\ green\ \ \ \ \ \ \ \ \ \ \ \ \ -foreground\ \\#00ff00\ -background\ black\n\ \ \ \ \ \ \ \ \ \ \ \ .console\ tag\ configure\ yellowonblack\ \ \ \ \ -foreground\ yellow\ -background\ black\ -font\ \{courier\ 14\ bold\}\n\ \ \ \ \ \ \ \ \ \ \ \ .console\ tag\ configure\ yellow\ \ \ \ \ \ \ \ \ \ \ \ -foreground\ yellow\n\ \ \ \ \ \ \ \ \ \ \ \ .console\ tag\ configure\ whiteonred\ \ \ \ \ \ \ \ -foreground\ white\ -background\ red\n\ \ \ \ \ \ \ \ \ \ \ \ .console\ tag\ configure\ red\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ -foreground\ red\n\ \ \ \ \ \ \ \ \}\n\ \ \ \ \}\n\ \ \ \ console\ eval\ \[list\ ::tk::ConsoleOutput\ \$dest\ \$string\]\n\}\n\nsleep\ 1000\nwm\ geom\ .\ 200x200+100+100\nsleep\ 2000\nfor\ \{set\ m\ 0\}\ \{\$m\ <\ 5\}\ \{incr\ m\}\ \{\n\ \ \ \ .b\ config\ -bg\ red\ -fg\ white\n\ \ \ \ sleep\ 50\n\ \ \ \ .b\ config\ -bg\ white\ \ -fg\ red\n\ \ \ \ sleep\ 50\n\}\nparray\ env\nconsole\ show\ncputs\ whiteonred\ \"white\ on\ red\ \"\ncputs\ yellowonblack\ \"\ And\ yellow\ on\ black\ and\ big\\n\"\n\n======\n\n----\n'''\[Superlinux\]\ -\ 2014-05-05\ 12:29:55'''\n\nI\ want\ to\ highlight\ a\ little\ thing\ which\ comes\ handy,\ and\ I\ know\ to\ any\ programmer\ this\ would\ look\ silly\ after\ you\ read\ it.\n\nNow\ how\ about\ hearing\ the\ message\ of\ \[\[\ tk_messageBox\ \]\]\ ?\ Yes!\ I\ know\ there's\ \[\[\ borg\ speak\ \$message\ \]\]\ \;\ but\ this\ is\ how\ you\ should\ utilize\ it:\n\n\n\ \ \ *\ If\ you\ want\ to\ hear\ the\ \$message\ ''while''\ the\ \[\[tk_messageBox\]\]\ is\ still\ on\ the\ screen\ first\ you\ start\ \[\[borg\ speak\ \$message\]\]\ then\ run\ \[\[tk_messageBox\]\]\ .\ Example:\n\n\n======\nset\ message\ \"Warning!\ You\ are\ trespassing\ Java\ in\ Android\ using\ Tcl/Tk\ and\ AndroWish!\"\nborg\ speak\ \$message\ntk_messageBox\ -message\ \$message\ -icon\ warning\n======\n\n\ \ \ *\ If\ you\ want\ to\ hear\ the\ \$message\ ''after''\ the\ \[\[tk_messageBox\]\]\ vanishes\ from\ the\ screen\ first\ you\ start\ \[\[tk_messageBox\]\]\ then\ run\ \[\[borg\ speak\ \$message\]\]\ .\ Example:\n======\nset\ message\ \"Warning!\ You\ are\ trespassing\ Java\ in\ Android\ using\ Tcl/Tk\ and\ AndroWish!\"\ntk_messageBox\ -message\ \$message\ -icon\ warning\nborg\ speak\ \$message\n======\n\nThis\ should\ show\ and\ prove\ you\ that\ \[\[borg\ speak\]\]\ works\ in\ a\ separate\ thread.\ --\ \[RS\]\ 2014-05-08:\ As\ I\ just\ tested\ in\ an\ interactive\ \[wish\]\ on\ Windows\ 7,\ \[tk_messageBox\]\ just\ blocks\ until\ dismissed\ with\ the\ OK\ button.\n\n----\n\[HE\]\ 2014-08-17\ I\ played\ today\ with\ menu\ and\ found\ it\ difficult\ to\ use\ them\ with\ the\ default\ font.\ I\ could\ read\ them\ but\ using\ them\ was\ quit\ difficult.\ The\ same\ with\ text\ inside\ entries\ and\ buttons.\nComparing\ with\ windows\ I\ saw\ also\ that\ we\ can't\ be\ sure\ that\ we\ have\ STANDARD\ FONTS\ defined\ as\ a\ default\ value.\ And\ I\ saw\ that\ the\ font\ size\ results\ nearly\ to\ the\ same\ size\ regardless\ of\ the\ screen\ (at\ least\ on\ the\ both\ android\ devices,\ one\ 4\"\ and\ one\ 8\",\ and\ the\ win7\ device).\ \nThe\ following\ code\ changes\ the\ default\ value\ when\ used\ at\ the\ beginning\ of\ the\ code\n======\noption\ add\ *Menu.Font\ \ \ TkMenuFont\ widgetDefault\noption\ add\ *Button.Font\ TkTextFont\ widgetDefault\noption\ add\ *Entry.Font\ \ TkTextFont\ widgetDefault\noption\ add\ *Label.Font\ \ TkTextFont\ widgetDefault\nfont\ configure\ TkMenuFont\ -size\ 12\nfont\ configure\ TkTextFont\ -size\ 12\n======\nI\ have\ to\ use\ 'font\ configure'\ because\ I\ couldn't\ find\ out\ how\ to\ change\ the\ named\ standard\ fonts\ with\ the\ option\ command.\n\nThe\ other\ value\ which\ is\ to\ small\ for\ me\ is\ the\ default\ width\ of\ the\ scrollbars.\ Looking\ for\ a\ device\ independent\ way\ I\ come\ to\ the\ following\ solution\ as\ a\ first\ draft:\n======\nset\ stdPixProMm\ 4\noption\ add\ *Scrollbar.width\ \[expr\ \{16\ *\ \[winfo\ screenwidth\ .\]\ *\ 1.0\ /\ (\[winfo\ screenmmwidth\ .\]\ *\ \$stdPixProMm)\}\]\ widgetDefault\n======\nThe\ stdPixProMm\ defines\ the\ amount\ of\ pixels\ per\ mm\ on\ a\ standard\ screen.\ I'm\ not\ sure\ if\ this\ is\ the\ best\ value\ for\ it\ because\ I\ also\ found\ out\ that\ 'winfo\ screenmmwidth'\ and\ 'screenmmheight'\ on\ the\ win7\ doesn't\ return\ the\ correct\ values.\ But\ the\ result\ provides\ on\ all\ three\ devices\ scrollbars\ with\ a\ width\ which\ is\ usable\ with\ fingers.\n\n\n----\n'''\[kc\]\ -\ 2014-09-30\ 03:17:15'''\n\nCan\ anyone\ tell\ how\ to\ adjust\ screen\ brightness\ in\ androwish?\ I\ tried\ \"borg\ content\ update\"\ but\ it\ won't\ work.May\ be\ done\ with\ wrong\ parameter.Please\ help!\n\n----\n'''\[JDA\]\ -\ 2015-01-16\ 17:15'''\n\nIs\ there\ a\ means\ in\ androwish\ to\ access\ openGL\ libraries?\n\nAndrowish\ rocks!\ \ I\ just\ discovered\ Androwish.\ \ I\ was\ able\ to\ download,\ install,\ and\ build\ the\ sample\ helloTclTk\ example\ and\ run\ it\ on\ my\ Motorola\ cell\ phone\ in\ addition\ to\ porting\ a\ small\ Tcl\ script.\ \ This\ all\ in\ less\ than\ a\ few\ hours\ (did\ not\ know\ how\ to\ build\ an\ android\ app).\ \ Androwish\ is\ simply\ awesome.\ \ Thank-you!!\n\n----\n\[HaO\]\ 2015-02-27:\ Scroll\ canvas\ with\ finger.\n\nHere\ is\ a\ solution\ skeleton\ to\ scroll\ a\ canvas\ so\ it\ follows\ the\ finger.\n\n======tcl\nset\ canvas\ \[canvas\ \$base.canvas\ -xscrollincrement\ 1\ -yscrollincrement\ 1\]\nbind\ \$canvas\ <<FingerDown>>\ \[list\ +motion\ start\ \$canvas\ %W\ %x\ %y\ %s\]\nbind\ \$canvas\ <<FingerMotion>>\ \[list\ +motion\ motion\ \$canvas\ %W\ %x\ %y\ %s\]\n\nproc\ motion\ \{mode\ path\ W\ X\ Y\ finger\}\ \{\n\ \ \ \ \ \ \ \ global\ movex\n\ \ \ \ \ \ \ \ global\ movey\n\ \ \ \ \ \ \ \ if\ \{\$finger\ !=\ 1\}\ \{return\}\n\ \ \ \ \ \ \ \ if\ \{\$mode\ eq\ \"motion\"\ &&\ \[winfo\ exists\ \$path\]\ \ &&\ \ \[string\ match\ \$path*\ \$W\]\ \}\ \{\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \$path\ xview\ scroll\ \[expr\ \{\ (\$movex\ -\ \$X)\ *\ \[winfo\ screenwidth\ .\]\ /\ 10000\ \}\ \]\ units\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \$path\ yview\ scroll\ \[expr\ \{\ (\$movey\ -\ \$Y)\ *\ \[winfo\ screenheight\ .\]\ /\ 10000\ \}\ \]\ units\n\ \ \ \ \ \ \ \ \}\n\ \ \ \ \ \ \ \ set\ movex\ \$X\n\ \ \ \ \ \ \ \ set\ movey\ \$Y\n\ \ \ \ \ \ \ \ return\n\}\n======\n\n\[chw\]\ 2015-02-27:\ there's\ even\ a\ shorter\ solution\ which\ works\ OOTB\ due\ to\ the\ default\ setting\ of\ \"sdltk\ touchtranslate\ ...\".\nIt\ uses\ the\ middle\ mouse\ button\ emulation\ for\ panning\ the\ entire\ canvas\ with\ fast\ wipes.\ Slow\ wipes\ deliver\ still\ left\nmouse\ button\ events\ e.g.\ for\ moving\ the\ currently\ active\ canvas\ item.\n\n======tcl\nset\ canvas\ \[canvas\ \$base.canvas\ -xscrollincrement\ 1\ -yscrollincrement\ 1\]\n#\ following\ lines\ borrowed\ from\ /assets/sdl2tk8.6/demos/items.tcl:\nbind\ \$canvas\ <2>\ \"\$canvas\ scan\ mark\ %x\ %y\"\nbind\ \$canvas\ <B2-Motion>\ \"\$canvas\ scan\ dragto\ %x\ %y\ 1\"\n======\n\n----\n\[chw\]\ 2015-09-11:\ Minimalist\ webcam\ using\ \[AndroWish\]'s\ borg\ camera\ command\n\n\n======tcl\n#\ http://<ip-of-device>:8080/....\ takes\ a\ JPEG\ picture\nproc\ init\ \{\}\ \{\n\ \ \ \ destroy\ .label\n\ \ \ \ borg\ camera\ close\n\ \ \ \ catch\ \{image\ delete\ img\}\n\ \ \ \ image\ create\ photo\ img\ -width\ 640\ -height\ 480\n\ \ \ \ borg\ camera\ open\n\ \ \ \ borg\ camera\ parameters\ picture-size\ 640x480\ jpeg-quality\ 80\n\ \ \ \ bind\ .\ <<ImageCapture>>\ \{borg\ camera\ image\ img\}\n\ \ \ \ borg\ camera\ start\n\ \ \ \ pack\ \[label\ .label\ -image\ img\]\n\ \ \ \ socket\ -server\ request\ 8080\n\}\nproc\ request\ \{sock\ args\}\ \{\n\ \ \ \ chan\ configure\ \$sock\ -translation\ binary\ -blocking\ 0\ -buffering\ none\n\ \ \ \ after\ 100\n\ \ \ \ catch\ \{chan\ read\ \$sock\ 1000\}\ err\n\ \ \ \ chan\ configure\ \$sock\ -blocking\ 1\n\ \ \ \ if\ \{!\[borg\ camera\ takejpeg\]\}\ \{\n\ \ \ \ \ \ \ \ chan\ close\ \$sock\n\ \ \ \ \ \ \ \ return\n\ \ \ \ \}\n\ \ \ \ bind\ .\ <<PictureTaken>>\ \[list\ send_jpeg\ \$sock\]\n\ \ \ \ chan\ puts\ -nonewline\ \$sock\ \\\n\ \ \ \ \ \ \ \ \"HTTP/1.0\ 200\ OK\\rConnection:\ close\\r\\nContent-Type:\ image/jpeg\\r\\n\\r\\n\"\n\}\nproc\ send_jpeg\ \{sock\}\ \{\n\ \ \ \ bind\ .\ <<PictureTaken>>\ \{\}\n\ \ \ \ catch\ \{chan\ puts\ -nonewline\ \$sock\ \[borg\ camera\ jpeg\]\}\n\ \ \ \ catch\ \{chan\ close\ \$sock\}\n\ \ \ \ borg\ camera\ start\n\}\ninit\n\n======\n\[JM\]\ 9/5/2017,\ when\ using\ the\ webcam\ example\ from\ the\ VFS\ mounted\ assets\ folder,\ something\ does\ not\ work\ on\ my\ phone\ to\ get\ the\ IP\ address\ and\ appears\ OFFLINE,\ but\ it\ is\ actually\ ONLINE.<<br>>\nOther\ than\ that,\ knowing\ the\ IP\ address\ by\ means\ of\ SSHDroid,\ the\ sample\ works\ great.\n======\n\n****How\ to\ get\ a\ device's\ dhcp\ data,\ ip\ address,\ e.t.c****\nProvided\ wifi\ hardware\ exists,\ and\ the\ device\ is\ connected\ by\ dhcp:\n\n\ \ \ \ borg\ systemproperties\ \ \ wifi.interface\ \ \ \ \ \ \ \ \;#\ find\ wifi\ interface,\ here\ 'wlan0'\n\ \ \ \ borg\ systemproperties\ \ \ dhcp.wlan0.ipaddress\ \ \;#\ find\ device\ ip\ address\ for\ the\ given\ interface,\ i.e.\ 'wlan0'\n\ \ \ \ borg\ systemproperties\ \ \ dhcp.wlan0.server\ \ \ \ \ \;#\ find\ access\ point\ address\n\n\[dzach\]\ 2015-11-18:\ \[chw\]'s\ creative\ frenzy\ continuously\ sprouts\ new\ functionality\ and\ tips.\ Here\ is\ his\ reply\ to\ a\ request\ for\ turning\ ''on|off''\ the\ camera's\ LED:\n\n\ \ \ \ \[Camera's\ LED\ c\]an\ be\ controlled\ with\ \"borg\ camera\"\ command\ but\ is\ device\ dependent.\n\n\ \ \ \ On\ my\ smartphone\ (HTC\ One\ V)\ this\ sequence\ works:\n\n\ \ \ \ borg\ camera\ open\n\ \ \ \ #\ LED\ on\n\ \ \ \ borg\ camera\ parameter\ flash-mode\ torch\n\ \ \ \ #\ LED\ off\n\ \ \ \ borg\ camera\ parameter\ flash-mode\ off\n\n****How\ to\ get\ contact\ info****\n\[dzach\]\ 2015-12-26:\ \[chw\]\ mentions\ the\ source\ code\ of\ Android\ as\ a\ place\ to\ find\ more\ uses\ for\ ''content://...''.\ Indeed,\ using\ the\ source\ code\ is\ the\ fastest\ way\ to\ get\ some\ guidance\ in\ the\ class\ hell\ of\ Android.\ Here\ is\ how\ to\ gain\ access\ to\ the\ contacts\ content,\ found\ in\ ''.../android-sdk-linux/sources/android-23/android/provider/ContactsContract.java'':\n\n\ \ \ \ set\ cursor\ \[borg\ content\ query\ content://com.android.contacts/contacts\]\n\ \ \ \ while\ \{\[\$cursor\ move\ 1\]\}\ \{\n\ \ \ \ \ \ \ \ puts\ \[\$cursor\ getrow\]\n\ \ \ \ \}\n\ \ \ \ \$cursor\ close\n\nor\n\n\ \ \ \ content://com.android.contacts/data/phones\n\nto\ get\ the\ contacts\ phones\ listed,\ or\ use\n\n\ \ \ \ content://com.android.contacts/contacts/filter/<put\ filter\ data\ here>\n\ \ \ \ content://com.android.contacts/data/phones/filter/<put\ filter\ data\ here>\n\nto\ get\ filtered\ contact\ results.\n\nIf,\ instead,\ you\ want\ to\ bring\ up\ the\ contact\ picker\ to\ select\ a\ contact\ from\ there,\ and\ return\ it\ to\ your\ app,\ then\ you\ can\ use\ the\ following:\n\n\ \ \ \ borg\ activity\ android.intent.action.PICK\ \{\}\ \"vnd.android.cursor.dir/contact\"\ \{\}\ \{\}\ \{\}\ callback\nor\n\ \ \ \ borg\ activity\ android.intent.action.PICK\ content://contacts/people\ \{\}\ \{\}\ \{\}\ \{\}\ callback\nand\ then,\ after\ having\ picked\ a\ contact,\ use\ the\ result\ returned\ by\ the\ ''callback''\ in\ a\ ''borg\ content\ query\ content://...''\ call\ to\ get\ the\ contact\ info\ needed.\n\n<<categories>>Android} CALL {my revision {AndroWish: Tips and Tricks}} CALL {::oo::Obj1291247 process revision/AndroWish%3A+Tips+and+Tricks} CALL {::oo::Obj1291245 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