Error processing request

Parameters

CONTENT_LENGTH0
REQUEST_METHODGET
REQUEST_URI/revision/always+on+top?V=45
QUERY_STRINGV=45
CONTENT_TYPE
DOCUMENT_URI/revision/always+on+top
DOCUMENT_ROOT/var/www/nikit/nikit/nginx/../docroot
SCGI1
SERVER_PROTOCOLHTTP/1.1
REMOTE_ADDR172.69.7.13
REMOTE_PORT25580
SERVER_PORT8888
SERVER_NAMEwiki.tcl-lang.org
HTTP_HOSTwiki.tcl-lang.org
HTTP_CONNECTIONKeep-Alive
HTTP_ACCEPT_ENCODINGgzip
HTTP_X_FORWARDED_FOR18.117.77.76
HTTP_CF_RAY890da63fcd8861b1-ORD
HTTP_X_FORWARDED_PROTOhttp
HTTP_CF_VISITOR{"scheme":"http"}
HTTP_ACCEPT*/*
HTTP_USER_AGENTMozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; ClaudeBot/1.0; [email protected])
HTTP_CF_CONNECTING_IP18.117.77.76
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 {always on top} ''\"How\ can\ I\ keep\ my\ toplevel\ on\ top?\"''\ is\ a\ FAQ.\ \ See\ http://tcl.sourceforge.net/faqs/tk/#wm/ontop\ for\ portable\ Tk\ solutions,\ and\ \[raise\]\ for\ related\ information.\n\n\n----\n**Win32**\n\n\[MPJ\]\ -\ June\ 21,\ 2002\n\nNow\ that\ topmost\ is\ supported\ in\ the\ Tcl\ core\ (8.4\ and\ higher)\ for\ the\ MsWindows\ platform\ you\ can\ just\ use:\ \n======\nwm\ attributes\ (window)\ -topmost\ 1\n======\nThe\ example\ below\ will\ cause\ the\ topmost\ setting\ to\ be\ toggled\ when\ the\ F3\ key\ is\ pressed.\n======\nbind\ .\ <F3>\ \"setontop\"\nproc\ setontop\ \{\}\ \{wm\ attributes\ .\ -topmost\ \[expr\ \[wm\ attributes\ .\ -topmost\]\ ^\ 1\]\}\n======\n<<discussion>>\n----\n\[Miko\]\nDon't\ work\ for\ me.\ Wish\ is\ running\ but\ the\ window\ is\ invisible\ (\ tested\ on\ Win\ 2K\ and\ XP).\ \[MPJ\]\ ~\ Works\ fine\ for\ me\ on\ 95/98/2k/XP.\ \ To\ test\ run\ wish\ and\ type\ \"wm\ attributes\ .\ -topmost\ 1\"\ which\ will\ keep\ the\ wish\ window\ on\ top\ even\ if\ it\ does\ not\ have\ focus.\n----\n\n\nThe\ API\ function\ needed\ is\ (see\ also\ \[http://msdn.microsoft.com/library/default.asp?url=/library/en-us/winui/windows_2blf.asp\]):\n======c\n\ \ SetWindowPos(HWND\ hWnd,\ \ \ \ \ \ \ //\ handle\ to\ window\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ HWND\ hWndAfter,\ \ //\ placement\ order\ handle\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ int\ x,\ int\ y,\ \ \ \ //\ position\ (horizontal,\ vertical)\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ int\ cx,\ int\ cy,\ \ //\ size\ (width,\ height)\ \n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ UINT\ uFlags)\ \ \ \ \ //\ positioning\ flags\n======\nThe\ placement\ order\ handle\ can\ be\ either\ another\ HWND\ or\ once\ of\ the\ following\ constants:\n\ \ \ *\ `HWND_BOTTOM`\ (1)\ Moves\ to\ the\ bottom\n\ \ \ *\ `HWND_NOTOPMOST`\ (-2)\ Place\ above\ all\ non-topmost\ windows.\n\ \ \ *\ `HWND_TOP`\ (0)\ Move\ to\ the\ top\n\ \ \ *\ `HWND_TOPMOST`\ (-1)\ Move\ to\ the\ top\ and\ keep\ it\ there.\nThe\ Flags\ can\ be\ one\ of\ a\ number\ but\ for\ this\ page\ probably\ SWP_NOMOVE\ (2)\ and\ SWP_NOSIZE\ (1)\ are\ likely\ the\ most\ useful.\ So:\n======c\n\ \ SetWindowPos(\[winfo\ id\ .\],\ HWND_TOPMOST,\ 0,\ 0,\ 0,\ 0,\ SWP_NOMOVE\ |\ SWP_NOSIZE)\n======\nwhich\ turns\ out\ to\ be\ the\ code\ used\ by\ `XRaiseWindow`\ in\ `win/tkWinWindow.c`\n\n\n\n\n----\n\[Melissa\ Schrumpf\]\ recommends\ the\ \[GPL\]ed\ WinCtl\n\[http://david.biesack.home.mindspring.com/WinCtl.html\]\nutility,\ which\ makes\ it\ possible\ to\ write\n======\n\ \ \ \ exec\ WinCtlW.exe\ -id\ \[wm\ frame\ .\]\ topmost\ &\n======\n(or\ might\ there\ be\ more\ punctuation\ in\ the\ vicinity\ of\nthe\ id?).\n\n----\n\n\[Martin\ Lemburg\]\ -\ 25th\ February\ 2002,\ 13:16\ GMT\n\nI\ found\ the\ original\ topmost\ package\ made\ by\ John\ Rosauer\ in\ 12.1997.\nIt\ works\ only\ with\ tcl/tk\ v.8.0.\n\nThe\ URL\ is:\nftp://ftp.dcade.de/pub/ml/tcl/packages/topmost10.zip\ \[ftp://ftp.dcade.de/pub/ml/tcl/packages/topmost10.zip\]\n\nI\ created\ a\ stubs\ enabled\ topmost\ package,\ usable\ with\ tcl/tk\ 8.1.1\ and\ higher.\n\nThe\ URL\ is:\n\nftp://ftp.dcade.de/pub/ml/tcl/packages/topmost20.zip\ \[ftp://ftp.dcade.de/pub/ml/tcl/packages/topmost20.zip\]\n\n'''''LES'''\ on\ March\ 30\ 2004:\ the\ two\ links\ above\ are\ broken''\n\nUsage:\n======\n\ \ \ package\ require\ topmost\ 2.0\;\n\n\ \ \ topmost\ widget\ ?boolean?\n======\nMuch\ fun!\n\n\[Martin\ Lemburg\]\n----\n\n\[MPJ\]\ -\ March\ 9th\ 2002\n\nUsing\ the\ topmost\ source\ as\ a\ guideline\ I\ wrote\ this\ tcl\ proc\ using\ \[Ffidl\].\ \ Its\ usage\ is\ similar\ to\ the\ topmost\ package\ except\ that\ it\ does\ not\ want\ a\ widget\ name\ but\ the\ window\ title.\n======\n\ load\ ffidl05.dll\n\ ffidl::callout\ dll_SetWindowPos\ \ \ \ \ \{int\ int\ int\ int\ int\ int\ int\}\ int\ \ \ \[ffidl::symbol\ user32.dll\ SetWindowPos\]\n\ ffidl::callout\ dll_GetWindowLong\ \ \ \ \{int\ int\}\ int\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \[ffidl::symbol\ user32.dll\ GetWindowLongA\]\n\ ffidl::callout\ dll_FindWindowTitle\ \ \{int\ pointer-utf8\}\ int\ \ \ \ \ \ \ \ \ \ \ \ \ \ \[ffidl::symbol\ user32.dll\ FindWindowA\]\n\ #\ windowname\ is\ based\ on\ wm\ title\n\ #\ state\ is\ 1\ to\ set\ or\ anything\ else\ to\ reset,\ empty\ returns\ the\ current\ state\n\ proc\ topmost\ \{windowname\ \{state\ \"\"\}\}\ \{\n\ \ \ \ \ \ \ \ set\ hwnd\ \[dll_FindWindowTitle\ 0\ \$windowname\]\n\ \ \ \ \ \ \ \ if\ \{\$hwnd\ ==\ 0\ \}\ \{\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ return\ \"Not\ a\ valid\ top\ window\"\n\ \ \ \ \ \ \ \ \}\n\ \ \ \ \ \ \ \ set\ WS_EX_TOPMOST\ 0x8\n\ \ \ \ \ \ \ \ set\ GWL_EXSTYLE\ -20\n\ \ \ \ \ \ \ \ set\ TOPMOST\ -1\n\ \ \ \ \ \ \ \ set\ NOTOPMOST\ -2\n\ \ \ \ \ \ \ \ set\ SWP_NOACTIVATE\ 0x10\n\ \ \ \ \ \ \ \ set\ SWP_NOMOVE\ 0x2\n\ \ \ \ \ \ \ \ set\ SWP_NOSIZE\ 0x1\n\ \ \ \ \ \ \ \ set\ screenwidth\ \[lindex\ \[split\ \[wm\ geometry\ .\]\ x+\]\ 0\]\n\ \ \ \ \ \ \ \ set\ screenheight\ \[lindex\ \[split\ \[wm\ geometry\ .\]\ x+\]\ 1\]\n\ \ \ \ \ \ \ \ set\ result\ \[expr\ (\[dll_GetWindowLong\ \$hwnd\ \$GWL_EXSTYLE\]\ &\ \$WS_EX_TOPMOST\ )>>3\]\n\ \ \ \ \ \ \ \ if\ \{\$state\ ==\ \"\"\ \}\ \{\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ return\ \$result\n\ \ \ \ \ \ \ \ \}\n\ \ \ \ \ \ \ \ if\ \{\$state\ ==\ 1\}\ \{\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ dll_SetWindowPos\ \$hwnd\ \$TOPMOST\ 0\ 0\ \\\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \$screenwidth\ \$screenheight\ \\\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \[expr\ \$SWP_NOACTIVATE\ |\ \$SWP_NOMOVE\ |\ \$SWP_NOSIZE\]\n\ \ \ \ \ \ \ \ \}\ else\ \{\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ dll_SetWindowPos\ \$hwnd\ \$NOTOPMOST\ 0\ 0\ \\\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \$screenwidth\ \$screenheight\ \\\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \[expr\ \$SWP_NOACTIVATE\ |\ \$SWP_NOMOVE\ |\ \$SWP_NOSIZE\]\n\ \ \ \ \ \ \ \ \}\n\ \ \ \ \ \ \ \ return\ \[expr\ (\[dll_GetWindowLong\ \$hwnd\ \$GWL_EXSTYLE\]\ &\ \$WS_EX_TOPMOST\ )>>3\]\n\ \}\n======\nUsage:\n======\n\ topmost\ \[wm\ title\ .\]\ ?boolean?\n======\n<<discussion>>\n----\n**UNIX\ Systems**\n\nThe\ `-topmost`\ attribute\ is\ also\ supported\ there\ provided\ you've\ got\ Tk\ 8.5\ (and\ provided\ your\ WM\ takes\ notice,\ which\ most\ do).\n======\nwm\ attribute\ .theWindow\ -topmost\ 1\n======\n----\n<<discussion>>\n''\[MGS\]''\ 2003/03/26\ -\ For\ non-Windows\ systems,\ you\ could\ something\ like\ this:\n======\n\ proc\ ontop\ \{W\ boolean\}\ \{\n\ \ \ set\ bindtags\ \[bindtags\ \$W\]\n\ \ \ set\ index\ \[lsearch\ \$bindtags\ bind\$W\]\n\ \ \ if\ \{\ \$boolean\ \}\ \{\n\ \ \ \ \ if\ \{\ \$index\ ==\ -1\ \}\ \{\n\ \ \ \ \ \ \ bindtags\ \$W\ \[linsert\ \$bindtags\ 0\ bind\$W\]\n\ \ \ \ \ \ \ bind\ bind\$W\ <Visibility>\ \[list\ ontop:state\ %W\ %s\]\n\ \ \ \ \ \}\n\ \ \ \}\ else\ \{\n\ \ \ \ \ if\ \{\ \$index\ !=\ -1\ \}\ \{\n\ \ \ \ \ \ \ bindtags\ \$W\ \[lreplace\ \$bindtags\ \$index\ \$index\]\n\ \ \ \ \ \ \ bind\ bind\$W\ <Visibility>\ \{\}\n\ \ \ \ \ \}\n\ \ \ \}\n\ \}\n\ \n\ proc\ ontop:state\ \{W\ state\}\ \{\n\ \ \ puts\ \"ontop\ \\\[\$W\\\]\ \\\[\$state\\\]\"\n\ \ \ if\ \{\ !\[string\ equal\ \[winfo\ toplevel\ \$W\]\ \$W\]\ \}\ \{\n\ \ \ \ \ puts\ \"\ \ window\ \\\[\$W\\\]\ is\ not\ a\ toplevel\"\n\ \ \ \ \ return\n\ \ \ \}\n\ \ \ if\ \{\ !\[string\ equal\ \$state\ VisibilityUnobscured\]\ \}\ \{\ raise\ \$W\ \}\n\ \}\n\ \n\ \ \ #\ demo\ code\n\ \ \ toplevel\ .t\n\ \ \ ontop\ .t\ 1\n\ \n\ \ \ checkbutton\ .top\ \\\n\ \ \ \ \ -text\ \"On\ Top\"\ \\\n\ \ \ \ \ -variable\ ontop(.)\ \\\n\ \ \ \ \ -command\ \"ontop\ .\ \\\$ontop(.)\"\n\ \n\ \ \ button\ .exit\ -text\ exit\ -default\ active\ -command\ exit\n\ \n\ \ \ pack\ .exit\ -side\ bottom\ -anchor\ se\n\ \ \ pack\ .top\ \ -side\ top\ \ \ \ -padx\ 50\ -pady\ 50\n======\nwhich\ will\ raise\ a\ window\ whenever\ it\ is\ obscured.\ But\ beware,\ if\ you\ have\ more\ than\ one\ window,\ you\ can\ have\ multiple\ windows\ fighting\ over\ who\ gets\ to\ be\ on\ top\ (if\ they\ overlap).\n\n----\n\[TFW\]\ -\ Jan\ 9,\ 2003\n\nI\ find\ it\ convienent\ to\ add\ a\ checkbox\ to\ the\ system\ \[menu\]\ to\ toggle\ always\ on\ top\ on/off.\n\n----\nRelated\ topic:\n======\n\ \ \ \ wm\ transient\ \$higher_widget\ \$lower_widget\n======\nkeeps\ \$higher_widget\ on\ top\ of\ \$lower_widget.\ \ Sometimes.\nAs\ \[DKF\]\ explains,\n\"This\ doesn't\ actually\ enforce\ it,\ it\ just\ gives\ a\ strong\ hint\ to\ the\ \[window\ manager\]\n(or\ OS,\ depending\ on\ platform)\ that\ the\ child\ is\ an\ agent\ acting\ on\nbehalf\ of\ the\ parent.\ \ Most\ WMs\ interpret\ this\ as\ meaning\ keep\ it\ on\ top\ of\ its\nparent\ and\ decorate\ it\ like\ a\ dialog,\ but\ not\ all.\ \ However,\ that's\ usually\ good\nenough\ anyway.\"\n\nFor\ more\ on\ the\ subject,\ see\ \"\[Modal\ dialogs\]\".\n\n----\n\[SRT\]\ -\ Mar\ 30,\ 2004\n\nKDE\ and\ probably\ GNOME-compliant\ window\ managers\ have\ support\ for\ the\n`_NET_WM_STATE_STAYS_ON_TOP`\ porperty.\ The\ perl/Tk\ code\ below\ may\ be\nused\ to\ set\ this\ property\ on\ toplevel\ windows.\ Unfortunately,\ a\ndirect\ translation\ to\ Tcl/Tk\ is\ not\ possible\ as\ Tcl/Tk\ has\ no\nsupport\ for\ the\ \"property\"\ method.\ Nevertheless\ it\ would\ be\nnice\ if\ wm\ attributes\ -topmost\ had\ similar\ support\ builtin.\n======perl\n\ sub\ keep_on_top\ \{\n\ \ \ \ \ my\ \$w\ =\ shift\;\n\ \ \ \ \ my(\$wrapper)\ =\ \$w->toplevel->wrapper\;\n\ \ \ \ \ eval\ \{\n\ \ \ \ \ \ \ \ \ if\ (!grep\ \{\ \$_\ eq\ '_NET_WM_STATE_STAYS_ON_TOP'\ \}\ \$w->property('get',\ '_NET_SUPPORTED',\ 'root'))\ \{\n\ \ \ \ \ \ \ \ \ \ \ \ \ die\ \"_NET_WM_STATE_STAYS_ON_TOP\ not\ supported\"\;\n\ \ \ \ \ \ \ \ \ \}\n\ \ \ \ \ \ \ \ \ \$w->property('set',\ '_NET_WM_STATE',\ \"ATOM\",\ 32,\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \[\"_NET_WM_STATE_STAYS_ON_TOP\"\],\ \$wrapper)\;\n\ \ \ \ \ \}\;\n\ \ \ \ \ if\ (\$@)\ \{\n\ \ \ \ \ \ \ \ \ warn\ \$@\;\n\ \ \ \ \ \ \ \ \ 0\;\n\ \ \ \ \ \}\ else\ \{\n\ \ \ \ \ \ \ \ \ 1\;\n\ \ \ \ \ \}\n\ \}\n======\n\[DKF\]:\ We\ don't\ support\ a\ property\ method\ because\ it's\ too\ easy\ to\ cause\ damage\ with\ it.\ \ We\ prefer\ a\ small\ extension\ for\ the\ task.\ \ OTOH,\ the\ above\ is\ useful\ grist\ to\ the\ mill\ of\ ongoing\ \[wm\ attributes\]\ development.\n\n\[DKF\]:\ And\ we\ support\ it\ in\ Tk\ 8.5.\n----\nFor\ ptk,\ the\ natural\ solution\ is\ Tk:StayOnTop\n\[http://search.cpan.org/~gbrock/Tk-StayOnTop-0.11/StayOnTop.pm\].\nChris\ Whiting\ gives\ this\n\[http://notyet\]\ example\ of\ its\ use.\n<<discussion>>\n<<categories>>\ Tk\ |\ GUI regexp2} CALL {my render {always on top} ''\"How\ can\ I\ keep\ my\ toplevel\ on\ top?\"''\ is\ a\ FAQ.\ \ See\ http://tcl.sourceforge.net/faqs/tk/#wm/ontop\ for\ portable\ Tk\ solutions,\ and\ \[raise\]\ for\ related\ information.\n\n\n----\n**Win32**\n\n\[MPJ\]\ -\ June\ 21,\ 2002\n\nNow\ that\ topmost\ is\ supported\ in\ the\ Tcl\ core\ (8.4\ and\ higher)\ for\ the\ MsWindows\ platform\ you\ can\ just\ use:\ \n======\nwm\ attributes\ (window)\ -topmost\ 1\n======\nThe\ example\ below\ will\ cause\ the\ topmost\ setting\ to\ be\ toggled\ when\ the\ F3\ key\ is\ pressed.\n======\nbind\ .\ <F3>\ \"setontop\"\nproc\ setontop\ \{\}\ \{wm\ attributes\ .\ -topmost\ \[expr\ \[wm\ attributes\ .\ -topmost\]\ ^\ 1\]\}\n======\n<<discussion>>\n----\n\[Miko\]\nDon't\ work\ for\ me.\ Wish\ is\ running\ but\ the\ window\ is\ invisible\ (\ tested\ on\ Win\ 2K\ and\ XP).\ \[MPJ\]\ ~\ Works\ fine\ for\ me\ on\ 95/98/2k/XP.\ \ To\ test\ run\ wish\ and\ type\ \"wm\ attributes\ .\ -topmost\ 1\"\ which\ will\ keep\ the\ wish\ window\ on\ top\ even\ if\ it\ does\ not\ have\ focus.\n----\n\n\nThe\ API\ function\ needed\ is\ (see\ also\ \[http://msdn.microsoft.com/library/default.asp?url=/library/en-us/winui/windows_2blf.asp\]):\n======c\n\ \ SetWindowPos(HWND\ hWnd,\ \ \ \ \ \ \ //\ handle\ to\ window\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ HWND\ hWndAfter,\ \ //\ placement\ order\ handle\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ int\ x,\ int\ y,\ \ \ \ //\ position\ (horizontal,\ vertical)\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ int\ cx,\ int\ cy,\ \ //\ size\ (width,\ height)\ \n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ UINT\ uFlags)\ \ \ \ \ //\ positioning\ flags\n======\nThe\ placement\ order\ handle\ can\ be\ either\ another\ HWND\ or\ once\ of\ the\ following\ constants:\n\ \ \ *\ `HWND_BOTTOM`\ (1)\ Moves\ to\ the\ bottom\n\ \ \ *\ `HWND_NOTOPMOST`\ (-2)\ Place\ above\ all\ non-topmost\ windows.\n\ \ \ *\ `HWND_TOP`\ (0)\ Move\ to\ the\ top\n\ \ \ *\ `HWND_TOPMOST`\ (-1)\ Move\ to\ the\ top\ and\ keep\ it\ there.\nThe\ Flags\ can\ be\ one\ of\ a\ number\ but\ for\ this\ page\ probably\ SWP_NOMOVE\ (2)\ and\ SWP_NOSIZE\ (1)\ are\ likely\ the\ most\ useful.\ So:\n======c\n\ \ SetWindowPos(\[winfo\ id\ .\],\ HWND_TOPMOST,\ 0,\ 0,\ 0,\ 0,\ SWP_NOMOVE\ |\ SWP_NOSIZE)\n======\nwhich\ turns\ out\ to\ be\ the\ code\ used\ by\ `XRaiseWindow`\ in\ `win/tkWinWindow.c`\n\n\n\n\n----\n\[Melissa\ Schrumpf\]\ recommends\ the\ \[GPL\]ed\ WinCtl\n\[http://david.biesack.home.mindspring.com/WinCtl.html\]\nutility,\ which\ makes\ it\ possible\ to\ write\n======\n\ \ \ \ exec\ WinCtlW.exe\ -id\ \[wm\ frame\ .\]\ topmost\ &\n======\n(or\ might\ there\ be\ more\ punctuation\ in\ the\ vicinity\ of\nthe\ id?).\n\n----\n\n\[Martin\ Lemburg\]\ -\ 25th\ February\ 2002,\ 13:16\ GMT\n\nI\ found\ the\ original\ topmost\ package\ made\ by\ John\ Rosauer\ in\ 12.1997.\nIt\ works\ only\ with\ tcl/tk\ v.8.0.\n\nThe\ URL\ is:\nftp://ftp.dcade.de/pub/ml/tcl/packages/topmost10.zip\ \[ftp://ftp.dcade.de/pub/ml/tcl/packages/topmost10.zip\]\n\nI\ created\ a\ stubs\ enabled\ topmost\ package,\ usable\ with\ tcl/tk\ 8.1.1\ and\ higher.\n\nThe\ URL\ is:\n\nftp://ftp.dcade.de/pub/ml/tcl/packages/topmost20.zip\ \[ftp://ftp.dcade.de/pub/ml/tcl/packages/topmost20.zip\]\n\n'''''LES'''\ on\ March\ 30\ 2004:\ the\ two\ links\ above\ are\ broken''\n\nUsage:\n======\n\ \ \ package\ require\ topmost\ 2.0\;\n\n\ \ \ topmost\ widget\ ?boolean?\n======\nMuch\ fun!\n\n\[Martin\ Lemburg\]\n----\n\n\[MPJ\]\ -\ March\ 9th\ 2002\n\nUsing\ the\ topmost\ source\ as\ a\ guideline\ I\ wrote\ this\ tcl\ proc\ using\ \[Ffidl\].\ \ Its\ usage\ is\ similar\ to\ the\ topmost\ package\ except\ that\ it\ does\ not\ want\ a\ widget\ name\ but\ the\ window\ title.\n======\n\ load\ ffidl05.dll\n\ ffidl::callout\ dll_SetWindowPos\ \ \ \ \ \{int\ int\ int\ int\ int\ int\ int\}\ int\ \ \ \[ffidl::symbol\ user32.dll\ SetWindowPos\]\n\ ffidl::callout\ dll_GetWindowLong\ \ \ \ \{int\ int\}\ int\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \[ffidl::symbol\ user32.dll\ GetWindowLongA\]\n\ ffidl::callout\ dll_FindWindowTitle\ \ \{int\ pointer-utf8\}\ int\ \ \ \ \ \ \ \ \ \ \ \ \ \ \[ffidl::symbol\ user32.dll\ FindWindowA\]\n\ #\ windowname\ is\ based\ on\ wm\ title\n\ #\ state\ is\ 1\ to\ set\ or\ anything\ else\ to\ reset,\ empty\ returns\ the\ current\ state\n\ proc\ topmost\ \{windowname\ \{state\ \"\"\}\}\ \{\n\ \ \ \ \ \ \ \ set\ hwnd\ \[dll_FindWindowTitle\ 0\ \$windowname\]\n\ \ \ \ \ \ \ \ if\ \{\$hwnd\ ==\ 0\ \}\ \{\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ return\ \"Not\ a\ valid\ top\ window\"\n\ \ \ \ \ \ \ \ \}\n\ \ \ \ \ \ \ \ set\ WS_EX_TOPMOST\ 0x8\n\ \ \ \ \ \ \ \ set\ GWL_EXSTYLE\ -20\n\ \ \ \ \ \ \ \ set\ TOPMOST\ -1\n\ \ \ \ \ \ \ \ set\ NOTOPMOST\ -2\n\ \ \ \ \ \ \ \ set\ SWP_NOACTIVATE\ 0x10\n\ \ \ \ \ \ \ \ set\ SWP_NOMOVE\ 0x2\n\ \ \ \ \ \ \ \ set\ SWP_NOSIZE\ 0x1\n\ \ \ \ \ \ \ \ set\ screenwidth\ \[lindex\ \[split\ \[wm\ geometry\ .\]\ x+\]\ 0\]\n\ \ \ \ \ \ \ \ set\ screenheight\ \[lindex\ \[split\ \[wm\ geometry\ .\]\ x+\]\ 1\]\n\ \ \ \ \ \ \ \ set\ result\ \[expr\ (\[dll_GetWindowLong\ \$hwnd\ \$GWL_EXSTYLE\]\ &\ \$WS_EX_TOPMOST\ )>>3\]\n\ \ \ \ \ \ \ \ if\ \{\$state\ ==\ \"\"\ \}\ \{\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ return\ \$result\n\ \ \ \ \ \ \ \ \}\n\ \ \ \ \ \ \ \ if\ \{\$state\ ==\ 1\}\ \{\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ dll_SetWindowPos\ \$hwnd\ \$TOPMOST\ 0\ 0\ \\\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \$screenwidth\ \$screenheight\ \\\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \[expr\ \$SWP_NOACTIVATE\ |\ \$SWP_NOMOVE\ |\ \$SWP_NOSIZE\]\n\ \ \ \ \ \ \ \ \}\ else\ \{\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ dll_SetWindowPos\ \$hwnd\ \$NOTOPMOST\ 0\ 0\ \\\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \$screenwidth\ \$screenheight\ \\\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \[expr\ \$SWP_NOACTIVATE\ |\ \$SWP_NOMOVE\ |\ \$SWP_NOSIZE\]\n\ \ \ \ \ \ \ \ \}\n\ \ \ \ \ \ \ \ return\ \[expr\ (\[dll_GetWindowLong\ \$hwnd\ \$GWL_EXSTYLE\]\ &\ \$WS_EX_TOPMOST\ )>>3\]\n\ \}\n======\nUsage:\n======\n\ topmost\ \[wm\ title\ .\]\ ?boolean?\n======\n<<discussion>>\n----\n**UNIX\ Systems**\n\nThe\ `-topmost`\ attribute\ is\ also\ supported\ there\ provided\ you've\ got\ Tk\ 8.5\ (and\ provided\ your\ WM\ takes\ notice,\ which\ most\ do).\n======\nwm\ attribute\ .theWindow\ -topmost\ 1\n======\n----\n<<discussion>>\n''\[MGS\]''\ 2003/03/26\ -\ For\ non-Windows\ systems,\ you\ could\ something\ like\ this:\n======\n\ proc\ ontop\ \{W\ boolean\}\ \{\n\ \ \ set\ bindtags\ \[bindtags\ \$W\]\n\ \ \ set\ index\ \[lsearch\ \$bindtags\ bind\$W\]\n\ \ \ if\ \{\ \$boolean\ \}\ \{\n\ \ \ \ \ if\ \{\ \$index\ ==\ -1\ \}\ \{\n\ \ \ \ \ \ \ bindtags\ \$W\ \[linsert\ \$bindtags\ 0\ bind\$W\]\n\ \ \ \ \ \ \ bind\ bind\$W\ <Visibility>\ \[list\ ontop:state\ %W\ %s\]\n\ \ \ \ \ \}\n\ \ \ \}\ else\ \{\n\ \ \ \ \ if\ \{\ \$index\ !=\ -1\ \}\ \{\n\ \ \ \ \ \ \ bindtags\ \$W\ \[lreplace\ \$bindtags\ \$index\ \$index\]\n\ \ \ \ \ \ \ bind\ bind\$W\ <Visibility>\ \{\}\n\ \ \ \ \ \}\n\ \ \ \}\n\ \}\n\ \n\ proc\ ontop:state\ \{W\ state\}\ \{\n\ \ \ puts\ \"ontop\ \\\[\$W\\\]\ \\\[\$state\\\]\"\n\ \ \ if\ \{\ !\[string\ equal\ \[winfo\ toplevel\ \$W\]\ \$W\]\ \}\ \{\n\ \ \ \ \ puts\ \"\ \ window\ \\\[\$W\\\]\ is\ not\ a\ toplevel\"\n\ \ \ \ \ return\n\ \ \ \}\n\ \ \ if\ \{\ !\[string\ equal\ \$state\ VisibilityUnobscured\]\ \}\ \{\ raise\ \$W\ \}\n\ \}\n\ \n\ \ \ #\ demo\ code\n\ \ \ toplevel\ .t\n\ \ \ ontop\ .t\ 1\n\ \n\ \ \ checkbutton\ .top\ \\\n\ \ \ \ \ -text\ \"On\ Top\"\ \\\n\ \ \ \ \ -variable\ ontop(.)\ \\\n\ \ \ \ \ -command\ \"ontop\ .\ \\\$ontop(.)\"\n\ \n\ \ \ button\ .exit\ -text\ exit\ -default\ active\ -command\ exit\n\ \n\ \ \ pack\ .exit\ -side\ bottom\ -anchor\ se\n\ \ \ pack\ .top\ \ -side\ top\ \ \ \ -padx\ 50\ -pady\ 50\n======\nwhich\ will\ raise\ a\ window\ whenever\ it\ is\ obscured.\ But\ beware,\ if\ you\ have\ more\ than\ one\ window,\ you\ can\ have\ multiple\ windows\ fighting\ over\ who\ gets\ to\ be\ on\ top\ (if\ they\ overlap).\n\n----\n\[TFW\]\ -\ Jan\ 9,\ 2003\n\nI\ find\ it\ convienent\ to\ add\ a\ checkbox\ to\ the\ system\ \[menu\]\ to\ toggle\ always\ on\ top\ on/off.\n\n----\nRelated\ topic:\n======\n\ \ \ \ wm\ transient\ \$higher_widget\ \$lower_widget\n======\nkeeps\ \$higher_widget\ on\ top\ of\ \$lower_widget.\ \ Sometimes.\nAs\ \[DKF\]\ explains,\n\"This\ doesn't\ actually\ enforce\ it,\ it\ just\ gives\ a\ strong\ hint\ to\ the\ \[window\ manager\]\n(or\ OS,\ depending\ on\ platform)\ that\ the\ child\ is\ an\ agent\ acting\ on\nbehalf\ of\ the\ parent.\ \ Most\ WMs\ interpret\ this\ as\ meaning\ keep\ it\ on\ top\ of\ its\nparent\ and\ decorate\ it\ like\ a\ dialog,\ but\ not\ all.\ \ However,\ that's\ usually\ good\nenough\ anyway.\"\n\nFor\ more\ on\ the\ subject,\ see\ \"\[Modal\ dialogs\]\".\n\n----\n\[SRT\]\ -\ Mar\ 30,\ 2004\n\nKDE\ and\ probably\ GNOME-compliant\ window\ managers\ have\ support\ for\ the\n`_NET_WM_STATE_STAYS_ON_TOP`\ porperty.\ The\ perl/Tk\ code\ below\ may\ be\nused\ to\ set\ this\ property\ on\ toplevel\ windows.\ Unfortunately,\ a\ndirect\ translation\ to\ Tcl/Tk\ is\ not\ possible\ as\ Tcl/Tk\ has\ no\nsupport\ for\ the\ \"property\"\ method.\ Nevertheless\ it\ would\ be\nnice\ if\ wm\ attributes\ -topmost\ had\ similar\ support\ builtin.\n======perl\n\ sub\ keep_on_top\ \{\n\ \ \ \ \ my\ \$w\ =\ shift\;\n\ \ \ \ \ my(\$wrapper)\ =\ \$w->toplevel->wrapper\;\n\ \ \ \ \ eval\ \{\n\ \ \ \ \ \ \ \ \ if\ (!grep\ \{\ \$_\ eq\ '_NET_WM_STATE_STAYS_ON_TOP'\ \}\ \$w->property('get',\ '_NET_SUPPORTED',\ 'root'))\ \{\n\ \ \ \ \ \ \ \ \ \ \ \ \ die\ \"_NET_WM_STATE_STAYS_ON_TOP\ not\ supported\"\;\n\ \ \ \ \ \ \ \ \ \}\n\ \ \ \ \ \ \ \ \ \$w->property('set',\ '_NET_WM_STATE',\ \"ATOM\",\ 32,\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \[\"_NET_WM_STATE_STAYS_ON_TOP\"\],\ \$wrapper)\;\n\ \ \ \ \ \}\;\n\ \ \ \ \ if\ (\$@)\ \{\n\ \ \ \ \ \ \ \ \ warn\ \$@\;\n\ \ \ \ \ \ \ \ \ 0\;\n\ \ \ \ \ \}\ else\ \{\n\ \ \ \ \ \ \ \ \ 1\;\n\ \ \ \ \ \}\n\ \}\n======\n\[DKF\]:\ We\ don't\ support\ a\ property\ method\ because\ it's\ too\ easy\ to\ cause\ damage\ with\ it.\ \ We\ prefer\ a\ small\ extension\ for\ the\ task.\ \ OTOH,\ the\ above\ is\ useful\ grist\ to\ the\ mill\ of\ ongoing\ \[wm\ attributes\]\ development.\n\n\[DKF\]:\ And\ we\ support\ it\ in\ Tk\ 8.5.\n----\nFor\ ptk,\ the\ natural\ solution\ is\ Tk:StayOnTop\n\[http://search.cpan.org/~gbrock/Tk-StayOnTop-0.11/StayOnTop.pm\].\nChris\ Whiting\ gives\ this\n\[http://notyet\]\ example\ of\ its\ use.\n<<discussion>>\n<<categories>>\ Tk\ |\ GUI} CALL {my revision {always on top}} CALL {::oo::Obj4774727 process revision/always+on+top} CALL {::oo::Obj4774725 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