• Problem with event <> in exe file

    From lamuzzachiodi@gmail.com@21:1/5 to All on Mon Nov 15 17:59:40 2021
    Hello, i've have two treeviews: selecting a row of the first, a procedure show relateds rows in the second (using the <<TreeviewSelect>> event).
    Also, there are a button that update the first tree and delete the second.
    I've compiled this using tclkits and it's ok. Almost.
    When i run the exe it throws an error because the event <<TreeviewSelect>> is generated and it run the procedure that show rows in the second tree without a real selected row in the first. This doesn't happen when i run the script no-exe.
    Why could be this?.
    Thanks.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From greg@21:1/5 to All on Tue Nov 16 13:07:33 2021
    schrieb am Dienstag, 16. November 2021 um 02:59:42 UTC+1:
    Hello, i've have two treeviews: selecting a row of the first, a procedure show relateds rows in the second (using the <<TreeviewSelect>> event).
    Also, there are a button that update the first tree and delete the second. I've compiled this using tclkits and it's ok. Almost.
    When i run the exe it throws an error because the event <<TreeviewSelect>> is generated and it run the procedure that show rows in the second tree without a real selected row in the first. This doesn't happen when i run the script no-exe.
    Why could be this?.
    Thanks.

    Are different Tcl / Tk versions being used?

    Which version is used, sample code?

    greg

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From lamuzzachiodi@gmail.com@21:1/5 to All on Tue Nov 16 19:41:47 2021
    Greg,
    i've left just the basic of my original code for test and yes, are differents versions. 8.6.4 (script) vs 8.6.11 (.exe).
    I can run the same script in both versions (no one exe) and the result is different. When you press the button "update" (of my example below) in the first case (.4) never show the dialog but in .11 the dialog is showed one time and after that is not
    showed until you press the button again after select some row of the first tree.
    It's this difference of behaviour intentional or is some kind of bug?.
    My code for test:
    ;# -------------------------------------------------------------------------------------------
    package require Tk

    tk_messageBox -message [info patchlevel] -title version -icon info


    ttk::treeview .t1 -columns { a b c} -yscroll ".vsb set" -xscroll ".hsb set" -show headings
    ttk::scrollbar .vsb -orient vertical -command ".t1 yview"
    ttk::scrollbar .hsb -orient horizontal -command ".t1 xview"
    .t1 heading a -text a
    .t1 heading b -text b
    .t1 heading c -text c

    bind .t1 <<TreeviewSelect>> { Fill2 [lindex [%W item [%W focus ] -values] 0] }

    grid .t1 .vsb -sticky nsew
    grid .hsb -sticky nsew


    ttk::treeview .t2 -columns { a b c} -yscroll ".vsb2 set" -xscroll ".hsb2 set" -show headings
    ttk::scrollbar .vsb2 -orient vertical -command ".t2 yview"
    ttk::scrollbar .hsb2 -orient horizontal -command ".t2 xview"

    .t2 heading a -text a
    .t2 heading b -text b
    .t2 heading c -text c


    grid .t2 .vsb2 -sticky nsew
    grid .hsb2 -sticky nsew
    ttk::button .b -text Update -command { Fill1}
    grid .b

    proc Empty1 { } {
    .t1 delete [.t1 children {} ]
    }

    proc Empty2 {} {
    .t2 delete [.t2 children {} ]
    }

    proc Fill2 { idx} {

    Empty2
    switch $idx {
    1 {
    .t2 insert {} end -values { a a a }
    .t2 insert {} end -values { a a a }
    .t2 insert {} end -values { a a a }
    }
    2 {
    .t2 insert {} end -values { b b b }
    .t2 insert {} end -values { b b b }
    .t2 insert {} end -values { b b b }
    }
    3 {
    .t2 insert {} end -values { c c c }
    .t2 insert {} end -values { c c c }
    .t2 insert {} end -values { c c c }
    }
    default {
    tk_messageBox -message "What ?" -icon error
    }
    }
    }

    proc Fill1 {} {
    Empty1
    .t1 insert {} end -values { 1 1 1 }
    .t1 insert {} end -values { 2 2 2 }
    .t1 insert {} end -values { 3 3 3 }
    Empty2
    }

    Fill1
    ;# -------------------------------------------------------------------------------------------

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From greg@21:1/5 to All on Wed Nov 17 02:07:51 2021
    tcltk-release-notes-8.6.10.txt

    https://sourceforge.net/projects/tcl/files/Tcl/8.6.10/tcltk-release-notes-8.6.10.txt/view


    * <<TreeviewSelect>> trigger on item delete



    Greg

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From lamuzzachiodi@gmail.com@21:1/5 to All on Wed Nov 17 15:03:26 2021
    Hello, oh i see.
    Thanks, i'm will follow this in another thread.

    Alejandro

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)