Error processing request

Parameters

CONTENT_LENGTH0
REQUEST_METHODGET
REQUEST_URI/page/SnitTtkNotebook
QUERY_STRING
CONTENT_TYPE
DOCUMENT_URI/page/SnitTtkNotebook
DOCUMENT_ROOT/var/www/nikit/nikit/nginx/../docroot
SCGI1
SERVER_PROTOCOLHTTP/1.1
HTTPSon
REMOTE_ADDR172.69.63.228
REMOTE_PORT28490
SERVER_PORT4443
SERVER_NAMEwiki.tcl-lang.org
HTTP_HOSTwiki.tcl-lang.org
HTTP_CONNECTIONKeep-Alive
HTTP_ACCEPT_ENCODINGgzip
HTTP_CF_IPCOUNTRYUS
HTTP_X_FORWARDED_FOR46.229.168.140
HTTP_CF_RAY57e98c3703ccc198-IAD
HTTP_X_FORWARDED_PROTOhttps
HTTP_CF_VISITOR{"scheme":"https"}
HTTP_CF_EW_VIA15
HTTP_CDN_LOOPcloudflare; subreqs=1
HTTP_ACCEPTtext/html, application/rss+xml, application/atom+xml, text/xml, text/rss+xml
HTTP_USER_AGENTMozilla/5.0 (compatible; SemrushBot/6~bl; +http://www.semrush.com/bot.html)
HTTP_CF_CONNECTING_IP46.229.168.140
HTTP_CF_WORKERtcl-lang.org

Body


Error

can't read "HMenu": no such variable

-code

1

-level

0

-errorstack

INNER loadStk CALL {my formatTemplate TEMPLATE:page HeaderTitle SnitTtkNotebook PageTitle SnitTtkNotebook SubTitle {} Footer {Updated 2018-02-05 19:46:56} Content {<h2 id='134e00784334272a2da4393d588beb130b70f6afbf8dfd52bddee3feacf69c1f' class='mkup_h1'>Extra bindings for <a class='mkup_a mkup_known' href='/page/ttk%3A%3Anotebook'>ttk::notebook</a> for tab handling</h2><UL class='mkup_UL'><li class='mkup_li'>All options and methods are delegated to <a class='mkup_a mkup_known' href='/page/ttk%3A%3Anotebook'>ttk::notebook</a></li><li class='mkup_li'>There are the following bindings provided if notebook has focus<UL class='mkup_UL'><li class='mkup_li'>F2 or right mouse click - rename tab</li><li class='mkup_li'>Control-Shift-Left  move tab to the left</li><li class='mkup_li'>Control-Shift-Right move tab to the right</li><li class='mkup_li'>Control-w delete current tab and destroy its childs</li><li class='mkup_li'>Control-t create new tab</li></UL></li><li class='mkup_li'>a -createcmd option is added to perform an action after the user creates a new tab using &lt;Control-t&gt;</li><li class='mkup_li'>bindings should targeted to the ttk::notebook using: <span class='mkup_tt'>pathname bind event ?script?</span>  see at the example code</li></UL><p class='mkup_p'><img class='mkup_img' alt='WikiDBImage SnitTtkNotebook.png' src='/image/WikiDBImage+SnitTtkNotebook%2Epng'></p>
<div class='sh_sourceCode'><button class='copybtn btn pull-right' data-clipboard-target='#mkup_code_0' title='Click to copy code snippet to clipboard'><span class='glyphicon glyphicon-copy' aria-hidden='true'></span></button><pre id='mkup_code_0' class='sh_tcl sh_sourceCode'>##############################################################################
#
#  Created By    : Dr. Detlef Groth
#  Created       : Mon  Feb 05 17:11:44 2018
#  Last Modified : &lt;180205.2040&gt;
#
#  Description         : Extended bindings for ttk::treeview for tab handling
#                   
#  Requirements  : snit and Tcl/Tk 8.6
#
#  History       : 0.1 initial release 2018-02-05
#        
##############################################################################
#
#  Copyright (c) 2018 Dr. Detlef Groth.
# 
#  License BSD
##############################################################################

package require snit
package provide SnitTtkNotebook 0.1

snit::widget SnitTtkNotebook {
    option -createcmd &quot;&quot;
    option -closecmd &quot;&quot;
    variable nb
    variable nbtext
    variable child
    delegate option * to nb
    delegate method * to nb except [list add bind]
    constructor {args} {
        $self configurelist $args
        install nb using ttk::notebook $win.nb ;#-side top -width 150 -height 50        
        pack $nb -fill both -expand yes -side top
        bind $nb &lt;KeyPress-F2&gt; [mymethod tabRename %x %y]
        bind $nb &lt;Button-3&gt; [mymethod tabRename %x %y]        
        bind $nb &lt;Control-Shift-Left&gt; [mymethod tabMove left %W]
        bind $nb &lt;Control-Shift-Right&gt; [mymethod tabMove right %W]
        bind $nb &lt;Control-w&gt; [mymethod tabClose %W]        
        bind $nb &lt;Control-t&gt; [mymethod new %W]        
        bind $nb &lt;Enter&gt; [list focus -force $nb]
    }
    method add {page args} {
        $nb add $page {*}$args
        if {$options(-createcmd) ne &quot;&quot;} {
            eval $options(-createcmd) $nb $page
        }
    }
    method new {w} {
        frame $nb.f[llength [$nb tabs]]
        $self add $nb.f[llength [$nb tabs]] -text &quot;Tab [expr {[llength [$nb tabs]] + 1}]&quot;
    }
    method bind {ev script} {
        bind $nb $ev $script
    }
    method tabClose {w} {
        set child [$w select]
        set answer [tk_messageBox -title &quot;Question!&quot; -message &quot;Really close tab [$w tab $child -text] ?&quot; -type yesno -icon question]
        if { $answer } {
            $w forget $child
            destroy $child
        } 
    }
    method tabRename {x y} {
        set nbtext &quot;&quot;
        if {![info exists .rename]} {
            toplevel .rename
            wm overrideredirect .rename true
            #wm title .rename &quot;DGApp&quot; ;# for floating on i3
            set x [winfo pointerx .]
            set y [winfo pointery .]
            entry .rename.ent -textvariable [myvar nbtext]
            pack .rename.ent -padx 5 -pady 5
        }
        wm geometry .rename &quot;180x40+$x+$y&quot;
        set tab [$nb select]
        set nbtext [$nb tab $tab -text]
        focus -force .rename.ent
        bind .rename.ent &lt;Return&gt; [mymethod doTabRename %W]
        bind .rename.ent &lt;Escape&gt; [list destroy .rename]
        
    }
    method doTabRename {w} {
        set tab [$nb select]
        $nb tab $tab -text $nbtext
        destroy .rename
    }
    method tabMove {dir w} {
        puts move$dir
        set idx [lsearch [$nb tabs] [$nb select]]
        puts $idx
        set current [$nb select]
        if {$dir eq &quot;left&quot;} {
            if {$idx &gt; 0} {
                $nb insert [expr {$idx - 1}]  $current
            }
        } else {
            if {$idx &lt; [expr {[llength [$nb tabs]] -1}]} {
                $nb insert [expr {$idx + 1}] $current
            }
        }
        # how to break automatic switch??
        after 100 [list $nb select $current]
    }
}

if {$argv0 eq [info script]} {
    if {[llength $argv] &lt;= 1 } {
        proc testCreate {w page} {
            puts &quot;$w $page&quot;
        }
        set nb [SnitTtkNotebook .nb -createcmd testCreate]
        frame .nb.f1
        pack [label .nb.f1.l -text &quot;Tab Content 1&quot;]
        pack [text .nb.f1.t] -side top -fill both -expand true
        frame .nb.f2
        pack [label .nb.f2.l -text &quot;Tab Content 2&quot;]
        frame .nb.f3
        pack [label .nb.f3.l -text &quot;Tab Content 3&quot;]
        $nb add .nb.f1 -text &quot;Tab 1&quot;
        $nb add .nb.f2 -text &quot;Tab 2&quot;
        $nb add .nb.f3 -text &quot;Tab 3&quot;                
        pack $nb -side top -fill both -expand yes
        # demonstrate remove binding
        $nb bind &lt;Control-t&gt; &quot;&quot;
        # demonstrate add binding
        $nb bind &lt;KeyPress-F3&gt; [list puts %W]
    }
}
</pre></div><h2 id='1c479de6e61ba992205bc8509d9c64ab4db1f9feb299a3e4ed2da535641e3350' class='mkup_h1'> Installation </h2><UL class='mkup_UL'><li class='mkup_li'>copy the code to a file SnitTtkNotebook-0.1.tm</li><li class='mkup_li'>put it to your collection of Tcl-Module files</li><li class='mkup_li'>at the beginning of your script add the Module-path with cmd: <span class='mkup_tt'>::tcl::tm::path add ?path...?</span></li><li class='mkup_li'>next line the <span class='mkup_tt'>package require SnitTtkNotebook</span></li></UL><h2 id='f0d0837119d2e68a0faac82afcb4df3df16c9b91e1f5f13351601d6cf748612c' class='mkup_h1'> Discussion </h2><p class='mkup_p'>Place your comments, ideas here.</p><hr><div class='mkup_centered'><table class='mkup_categories'><tr><td class='mkup_td'><a class='mkup_a' href='/page/Category+GUI'>Category GUI</a></td><td class='mkup_td'><a class='mkup_a' href='/page/Category+Snit+Widgets'>Category Snit Widgets</a></td><td class='mkup_td'><a class='mkup_a' href='/page/notebook'>notebook</a></td></tr></table></div>} TOC {{type 1 id 134e00784334272a2da4393d588beb130b70f6afbf8dfd52bddee3feacf69c1f data {Extra bindings for [ttk::notebook] for tab handling}} {type 1 id 1c479de6e61ba992205bc8509d9c64ab4db1f9feb299a3e4ed2da535641e3350 data { Installation }} {type 1 id f0d0837119d2e68a0faac82afcb4df3df16c9b91e1f5f13351601d6cf748612c data { Discussion }}} PMenuEdit {<li class='dropdown' id='li_idPageEdit' style='display:none'>
<a class='dropdown-toggle' data-toggle='dropdown' href='#'><span id=name_idPageEdit>Page</span><span class='caret'></span></a>
<ul class='dropdown-menu scrollable-menu' role='menu'><li><a rel='nofollow' href='/_edit/SnitTtkNotebook?A=1'>Comment</a></li>
<li><a rel='nofollow' hidden='true' href='/_edit/SnitTtkNotebook'>Edit</a></li>
<li><a rel='nofollow' href='/_upload/SnitTtkNotebook'>Upload</a></li>
<li><a rel='nofollow' href='/ref/SnitTtkNotebook'>References</a></li>
<li><a rel='nofollow' href='/history/SnitTtkNotebook'>History</a></li>
<li><hr></li>
<li><a href='#134e00784334272a2da4393d588beb130b70f6afbf8dfd52bddee3feacf69c1f'>Extra bindings for <b>ttk::notebook</b> for tab handling</a>
</li>
<li><a href='#1c479de6e61ba992205bc8509d9c64ab4db1f9feb299a3e4ed2da535641e3350'> Installation </a>
</li>
<li><a href='#f0d0837119d2e68a0faac82afcb4df3df16c9b91e1f5f13351601d6cf748612c'> Discussion </a>
</li>
</ul>
</li>
} PMenuNoEdit {<li class='dropdown' id='li_idPageNoEdit' style='display:none'>
<a class='dropdown-toggle' data-toggle='dropdown' href='#'><span id=name_idPageNoEdit>Page</span><span class='caret'></span></a>
<ul class='dropdown-menu scrollable-menu' role='menu'><li><a rel='nofollow' href='/ref/SnitTtkNotebook'>References</a></li>
<li><a rel='nofollow' href='/history/SnitTtkNotebook'>History</a></li>
<li><hr></li>
<li><a href='#134e00784334272a2da4393d588beb130b70f6afbf8dfd52bddee3feacf69c1f'>Extra bindings for <b>ttk::notebook</b> for tab handling</a>
</li>
<li><a href='#1c479de6e61ba992205bc8509d9c64ab4db1f9feb299a3e4ed2da535641e3350'> Installation </a>
</li>
<li><a href='#f0d0837119d2e68a0faac82afcb4df3df16c9b91e1f5f13351601d6cf748612c'> Discussion </a>
</li>
</ul>
</li>
} PostLoad {} Headers {Cache-Control s-maxage=31536000,max-age=0} RSSfeed {}} CALL {my formatTemplate TEMPLATE:page HeaderTitle SnitTtkNotebook PageTitle SnitTtkNotebook SubTitle {} Footer {Updated 2018-02-05 19:46:56} Content {<h2 id='134e00784334272a2da4393d588beb130b70f6afbf8dfd52bddee3feacf69c1f' class='mkup_h1'>Extra bindings for <a class='mkup_a mkup_known' href='/page/ttk%3A%3Anotebook'>ttk::notebook</a> for tab handling</h2><UL class='mkup_UL'><li class='mkup_li'>All options and methods are delegated to <a class='mkup_a mkup_known' href='/page/ttk%3A%3Anotebook'>ttk::notebook</a></li><li class='mkup_li'>There are the following bindings provided if notebook has focus<UL class='mkup_UL'><li class='mkup_li'>F2 or right mouse click - rename tab</li><li class='mkup_li'>Control-Shift-Left  move tab to the left</li><li class='mkup_li'>Control-Shift-Right move tab to the right</li><li class='mkup_li'>Control-w delete current tab and destroy its childs</li><li class='mkup_li'>Control-t create new tab</li></UL></li><li class='mkup_li'>a -createcmd option is added to perform an action after the user creates a new tab using &lt;Control-t&gt;</li><li class='mkup_li'>bindings should targeted to the ttk::notebook using: <span class='mkup_tt'>pathname bind event ?script?</span>  see at the example code</li></UL><p class='mkup_p'><img class='mkup_img' alt='WikiDBImage SnitTtkNotebook.png' src='/image/WikiDBImage+SnitTtkNotebook%2Epng'></p>
<div class='sh_sourceCode'><button class='copybtn btn pull-right' data-clipboard-target='#mkup_code_0' title='Click to copy code snippet to clipboard'><span class='glyphicon glyphicon-copy' aria-hidden='true'></span></button><pre id='mkup_code_0' class='sh_tcl sh_sourceCode'>##############################################################################
#
#  Created By    : Dr. Detlef Groth
#  Created       : Mon  Feb 05 17:11:44 2018
#  Last Modified : &lt;180205.2040&gt;
#
#  Description         : Extended bindings for ttk::treeview for tab handling
#                   
#  Requirements  : snit and Tcl/Tk 8.6
#
#  History       : 0.1 initial release 2018-02-05
#        
##############################################################################
#
#  Copyright (c) 2018 Dr. Detlef Groth.
# 
#  License BSD
##############################################################################

package require snit
package provide SnitTtkNotebook 0.1

snit::widget SnitTtkNotebook {
    option -createcmd &quot;&quot;
    option -closecmd &quot;&quot;
    variable nb
    variable nbtext
    variable child
    delegate option * to nb
    delegate method * to nb except [list add bind]
    constructor {args} {
        $self configurelist $args
        install nb using ttk::notebook $win.nb ;#-side top -width 150 -height 50        
        pack $nb -fill both -expand yes -side top
        bind $nb &lt;KeyPress-F2&gt; [mymethod tabRename %x %y]
        bind $nb &lt;Button-3&gt; [mymethod tabRename %x %y]        
        bind $nb &lt;Control-Shift-Left&gt; [mymethod tabMove left %W]
        bind $nb &lt;Control-Shift-Right&gt; [mymethod tabMove right %W]
        bind $nb &lt;Control-w&gt; [mymethod tabClose %W]        
        bind $nb &lt;Control-t&gt; [mymethod new %W]        
        bind $nb &lt;Enter&gt; [list focus -force $nb]
    }
    method add {page args} {
        $nb add $page {*}$args
        if {$options(-createcmd) ne &quot;&quot;} {
            eval $options(-createcmd) $nb $page
        }
    }
    method new {w} {
        frame $nb.f[llength [$nb tabs]]
        $self add $nb.f[llength [$nb tabs]] -text &quot;Tab [expr {[llength [$nb tabs]] + 1}]&quot;
    }
    method bind {ev script} {
        bind $nb $ev $script
    }
    method tabClose {w} {
        set child [$w select]
        set answer [tk_messageBox -title &quot;Question!&quot; -message &quot;Really close tab [$w tab $child -text] ?&quot; -type yesno -icon question]
        if { $answer } {
            $w forget $child
            destroy $child
        } 
    }
    method tabRename {x y} {
        set nbtext &quot;&quot;
        if {![info exists .rename]} {
            toplevel .rename
            wm overrideredirect .rename true
            #wm title .rename &quot;DGApp&quot; ;# for floating on i3
            set x [winfo pointerx .]
            set y [winfo pointery .]
            entry .rename.ent -textvariable [myvar nbtext]
            pack .rename.ent -padx 5 -pady 5
        }
        wm geometry .rename &quot;180x40+$x+$y&quot;
        set tab [$nb select]
        set nbtext [$nb tab $tab -text]
        focus -force .rename.ent
        bind .rename.ent &lt;Return&gt; [mymethod doTabRename %W]
        bind .rename.ent &lt;Escape&gt; [list destroy .rename]
        
    }
    method doTabRename {w} {
        set tab [$nb select]
        $nb tab $tab -text $nbtext
        destroy .rename
    }
    method tabMove {dir w} {
        puts move$dir
        set idx [lsearch [$nb tabs] [$nb select]]
        puts $idx
        set current [$nb select]
        if {$dir eq &quot;left&quot;} {
            if {$idx &gt; 0} {
                $nb insert [expr {$idx - 1}]  $current
            }
        } else {
            if {$idx &lt; [expr {[llength [$nb tabs]] -1}]} {
                $nb insert [expr {$idx + 1}] $current
            }
        }
        # how to break automatic switch??
        after 100 [list $nb select $current]
    }
}

if {$argv0 eq [info script]} {
    if {[llength $argv] &lt;= 1 } {
        proc testCreate {w page} {
            puts &quot;$w $page&quot;
        }
        set nb [SnitTtkNotebook .nb -createcmd testCreate]
        frame .nb.f1
        pack [label .nb.f1.l -text &quot;Tab Content 1&quot;]
        pack [text .nb.f1.t] -side top -fill both -expand true
        frame .nb.f2
        pack [label .nb.f2.l -text &quot;Tab Content 2&quot;]
        frame .nb.f3
        pack [label .nb.f3.l -text &quot;Tab Content 3&quot;]
        $nb add .nb.f1 -text &quot;Tab 1&quot;
        $nb add .nb.f2 -text &quot;Tab 2&quot;
        $nb add .nb.f3 -text &quot;Tab 3&quot;                
        pack $nb -side top -fill both -expand yes
        # demonstrate remove binding
        $nb bind &lt;Control-t&gt; &quot;&quot;
        # demonstrate add binding
        $nb bind &lt;KeyPress-F3&gt; [list puts %W]
    }
}
</pre></div><h2 id='1c479de6e61ba992205bc8509d9c64ab4db1f9feb299a3e4ed2da535641e3350' class='mkup_h1'> Installation </h2><UL class='mkup_UL'><li class='mkup_li'>copy the code to a file SnitTtkNotebook-0.1.tm</li><li class='mkup_li'>put it to your collection of Tcl-Module files</li><li class='mkup_li'>at the beginning of your script add the Module-path with cmd: <span class='mkup_tt'>::tcl::tm::path add ?path...?</span></li><li class='mkup_li'>next line the <span class='mkup_tt'>package require SnitTtkNotebook</span></li></UL><h2 id='f0d0837119d2e68a0faac82afcb4df3df16c9b91e1f5f13351601d6cf748612c' class='mkup_h1'> Discussion </h2><p class='mkup_p'>Place your comments, ideas here.</p><hr><div class='mkup_centered'><table class='mkup_categories'><tr><td class='mkup_td'><a class='mkup_a' href='/page/Category+GUI'>Category GUI</a></td><td class='mkup_td'><a class='mkup_a' href='/page/Category+Snit+Widgets'>Category Snit Widgets</a></td><td class='mkup_td'><a class='mkup_a' href='/page/notebook'>notebook</a></td></tr></table></div>} TOC {{type 1 id 134e00784334272a2da4393d588beb130b70f6afbf8dfd52bddee3feacf69c1f data {Extra bindings for [ttk::notebook] for tab handling}} {type 1 id 1c479de6e61ba992205bc8509d9c64ab4db1f9feb299a3e4ed2da535641e3350 data { Installation }} {type 1 id f0d0837119d2e68a0faac82afcb4df3df16c9b91e1f5f13351601d6cf748612c data { Discussion }}} PMenuEdit {<li class='dropdown' id='li_idPageEdit' style='display:none'>
<a class='dropdown-toggle' data-toggle='dropdown' href='#'><span id=name_idPageEdit>Page</span><span class='caret'></span></a>
<ul class='dropdown-menu scrollable-menu' role='menu'><li><a rel='nofollow' href='/_edit/SnitTtkNotebook?A=1'>Comment</a></li>
<li><a rel='nofollow' hidden='true' href='/_edit/SnitTtkNotebook'>Edit</a></li>
<li><a rel='nofollow' href='/_upload/SnitTtkNotebook'>Upload</a></li>
<li><a rel='nofollow' href='/ref/SnitTtkNotebook'>References</a></li>
<li><a rel='nofollow' href='/history/SnitTtkNotebook'>History</a></li>
<li><hr></li>
<li><a href='#134e00784334272a2da4393d588beb130b70f6afbf8dfd52bddee3feacf69c1f'>Extra bindings for <b>ttk::notebook</b> for tab handling</a>
</li>
<li><a href='#1c479de6e61ba992205bc8509d9c64ab4db1f9feb299a3e4ed2da535641e3350'> Installation </a>
</li>
<li><a href='#f0d0837119d2e68a0faac82afcb4df3df16c9b91e1f5f13351601d6cf748612c'> Discussion </a>
</li>
</ul>
</li>
} PMenuNoEdit {<li class='dropdown' id='li_idPageNoEdit' style='display:none'>
<a class='dropdown-toggle' data-toggle='dropdown' href='#'><span id=name_idPageNoEdit>Page</span><span class='caret'></span></a>
<ul class='dropdown-menu scrollable-menu' role='menu'><li><a rel='nofollow' href='/ref/SnitTtkNotebook'>References</a></li>
<li><a rel='nofollow' href='/history/SnitTtkNotebook'>History</a></li>
<li><hr></li>
<li><a href='#134e00784334272a2da4393d588beb130b70f6afbf8dfd52bddee3feacf69c1f'>Extra bindings for <b>ttk::notebook</b> for tab handling</a>
</li>
<li><a href='#1c479de6e61ba992205bc8509d9c64ab4db1f9feb299a3e4ed2da535641e3350'> Installation </a>
</li>
<li><a href='#f0d0837119d2e68a0faac82afcb4df3df16c9b91e1f5f13351601d6cf748612c'> Discussion </a>
</li>
</ul>
</li>
} PostLoad {} Headers {Cache-Control s-maxage=31536000,max-age=0} RSSfeed {}} CALL {my showpage SnitTtkNotebook} CALL {my page SnitTtkNotebook} CALL {::oo::Obj2716963 process page/SnitTtkNotebook} CALL {::oo::Obj2716961 process}

-errorcode

TCL LOOKUP VARNAME HMenu

-errorinfo

can't read "HMenu": no such variable
    while executing
"subst -nobackslashes -nocommands [my getTemplate $template]"
    (class "::Wiki" method "formatTemplate" line 19)
    invoked from within
"my formatTemplate TEMPLATE:page HeaderTitle [armour $page_name] PageTitle [armour $page_name]  SubTitle "" Footer [my subTitle $date "" "Updated" $O] ..."
    (class "::Wiki" method "showpage" line 160)
    invoked from within
"my showpage $name"
    (class "::Wiki" method "page" line 4)
    invoked from within
"my page $page "
    (class "::Wiki" method "process" line 42)
    invoked from within
"$server process [string trim $uri /]"

-errorline

4