Error processing request

Parameters

CONTENT_LENGTH0
REQUEST_METHODGET
REQUEST_URI/revision/Drag+and+Drop+Notebook+Tabs?V=7
QUERY_STRINGV=7
CONTENT_TYPE
DOCUMENT_URI/revision/Drag+and+Drop+Notebook+Tabs
DOCUMENT_ROOT/var/www/nikit/nikit/nginx/../docroot
SCGI1
SERVER_PROTOCOLHTTP/1.1
HTTPSon
REMOTE_ADDR172.69.59.48
REMOTE_PORT25744
SERVER_PORT4443
SERVER_NAMEwiki.tcl-lang.org
HTTP_HOSTwiki.tcl-lang.org
HTTP_CONNECTIONKeep-Alive
HTTP_ACCEPT_ENCODINGgzip, br
HTTP_X_FORWARDED_FOR3.147.66.178
HTTP_CF_RAY879d99779e5e10e3-ORD
HTTP_X_FORWARDED_PROTOhttps
HTTP_CF_VISITOR{"scheme":"https"}
HTTP_ACCEPT*/*
HTTP_USER_AGENTMozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; ClaudeBot/1.0; [email protected])
HTTP_CF_CONNECTING_IP3.147.66.178
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 {Drag and Drop Notebook Tabs} {[CJB]: An example of how to make drag and drop tabs with a ttk::notebook.

----

======
#Create notebook
set n [ttk::notebook .nb]
pack $n -fill both -expand 1

#Create tabs
foreach tab [list First Second Third] {
    set w [frame $n.[string tolower $tab]]
    label $w.src_lab -text "Clicked Tab Index:" -anchor e
    label $w.src_idx -textvariable src_index -width 3
    label $w.dst_lab -text "Released Tab Index:" -anchor e
    label $w.dst_idx -textvariable dst_index -width 3
    grid $w.src_lab $w.src_idx -sticky news
    grid $w.dst_lab $w.dst_idx -sticky news
    $n add $w -text $tab
}

#Bindings
bind all <KeyPress-question> {console show}
bind $n <ButtonPress>   [list click   %W %x %y]
bind $n <ButtonRelease> [list release %W %x %y]
bind $n <Motion>        [list motion  %W %X %Y]

#Sets index of tab clicked.
proc click   {W x y} {
    variable src_index [$W index @$x,$y]
    puts stderr "Clicked $src_index"
}

#Moves the tab to the position where it was dropped.
proc release {W x y} {
    variable src_index
    variable dst_index
    puts stderr "Released $src_index"
    #Check for a valid source
    if {[string is int -strict $src_index]} {
        set dst_index [$W index @$x,$y]
        #Check for a valid destination
        if {[string is int -strict $dst_index]} {
            set tab [lindex [$W tabs] $src_index]
            $W insert $dst_index $tab
            puts stderr "Insert $tab @ $dst_index"
        }
    }
}

#Passes mouse motion events to underlying widgets while dragging.
#Allows the notebook tabs to highlight on mouse-over.
proc motion  {W X Y} {
    set w [winfo containing $X $Y]
    if {$w ne $W && $w ne ""} {
        set x [expr {$X - [winfo rootx $w]}]
        set y [expr {$Y - [winfo rooty $w]}]
        event generate $w <Motion> -x $x -y $y
    }
}
======
[peterc] 2010-07-29: Looks good and it works well :) My only suggestion would be to change the cursor to a tab-like image during the drag (and change it back after button release) so the user has more visual feedback that they've picked up and are dragging the tab. Bonus points if you can include the tab title somehow :)
======

<<categories>>Example|GUI|Widget} regexp2} CALL {my render {Drag and Drop Notebook Tabs} {[CJB]: An example of how to make drag and drop tabs with a ttk::notebook.

----

======
#Create notebook
set n [ttk::notebook .nb]
pack $n -fill both -expand 1

#Create tabs
foreach tab [list First Second Third] {
    set w [frame $n.[string tolower $tab]]
    label $w.src_lab -text "Clicked Tab Index:" -anchor e
    label $w.src_idx -textvariable src_index -width 3
    label $w.dst_lab -text "Released Tab Index:" -anchor e
    label $w.dst_idx -textvariable dst_index -width 3
    grid $w.src_lab $w.src_idx -sticky news
    grid $w.dst_lab $w.dst_idx -sticky news
    $n add $w -text $tab
}

#Bindings
bind all <KeyPress-question> {console show}
bind $n <ButtonPress>   [list click   %W %x %y]
bind $n <ButtonRelease> [list release %W %x %y]
bind $n <Motion>        [list motion  %W %X %Y]

#Sets index of tab clicked.
proc click   {W x y} {
    variable src_index [$W index @$x,$y]
    puts stderr "Clicked $src_index"
}

#Moves the tab to the position where it was dropped.
proc release {W x y} {
    variable src_index
    variable dst_index
    puts stderr "Released $src_index"
    #Check for a valid source
    if {[string is int -strict $src_index]} {
        set dst_index [$W index @$x,$y]
        #Check for a valid destination
        if {[string is int -strict $dst_index]} {
            set tab [lindex [$W tabs] $src_index]
            $W insert $dst_index $tab
            puts stderr "Insert $tab @ $dst_index"
        }
    }
}

#Passes mouse motion events to underlying widgets while dragging.
#Allows the notebook tabs to highlight on mouse-over.
proc motion  {W X Y} {
    set w [winfo containing $X $Y]
    if {$w ne $W && $w ne ""} {
        set x [expr {$X - [winfo rootx $w]}]
        set y [expr {$Y - [winfo rooty $w]}]
        event generate $w <Motion> -x $x -y $y
    }
}
======
[peterc] 2010-07-29: Looks good and it works well :) My only suggestion would be to change the cursor to a tab-like image during the drag (and change it back after button release) so the user has more visual feedback that they've picked up and are dragging the tab. Bonus points if you can include the tab title somehow :)
======

<<categories>>Example|GUI|Widget}} CALL {my revision {Drag and Drop Notebook Tabs}} CALL {::oo::Obj825198 process revision/Drag+and+Drop+Notebook+Tabs} CALL {::oo::Obj825196 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