• tablelist: which column was clicked/edited?

    From Ralf Fassel@21:1/5 to All on Mon Mar 13 17:05:34 2023
    I have a tablelist, where the <<ListBoxSelect>> command is a
    time-consuming operation, so I want to invoke it only in some columns,
    but not in others.

    Especially column 1 is configured

    -editwindow checkbutton \
    -labelwindow checkbutton \

    and when I click the checkbutton in that column, I do *not* want to
    invoke the <<ListBoxSelect>> binding.

    Is there some easy way to achieve this?

    I also have

    -editstartcommand [namespace code [list set_active_image 1]] \
    -editendcommand [namespace code [list set_active_image 0]] \

    configured on the tablelist itself, where I check for column 1 and set checked/unchecked images, so I could prohibit <<ListBoxSelect>> while
    'editing' column 1, but maybe there is a smarter way?

    TNX
    R'

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From nemethi@21:1/5 to All on Mon Mar 13 21:57:23 2023
    Am 13.03.23 um 21:51 schrieb nemethi:
    Am 13.03.23 um 17:05 schrieb Ralf Fassel:
    I have a tablelist, where the <<ListBoxSelect>> command is a
    time-consuming operation, so I want to invoke it only in some columns,
    but not in others.

    Especially column 1 is configured

            -editwindow checkbutton \
              -labelwindow checkbutton \

    and when I click the checkbutton in that column, I do *not* want to
    invoke the <<ListBoxSelect>> binding.

    Is there some easy way to achieve this?

    I also have

        -editstartcommand [namespace code [list set_active_image 1]] \
        -editendcommand [namespace code [list set_active_image 0]] \

    configured on the tablelist itself, where I check for column 1 and set
    checked/unchecked images, so I could prohibit <<ListBoxSelect>> while
    'editing' column 1, but maybe there is a smarter way?

    TNX
    R'

    bind [$tbl bodytag] <Button-1> {onBtn1 %W %x %y}
    proc onBtn1 {w x y} {
        lassign [tablelist::convEventFields $w $x $y] tbl x y
        global clickedCol
        set clickedCol [$tbl nearestcolumn $x]
        puts $clickedCol
    }

    Te above code sets the global variable clickedCol to the column index of
    the clicked column.  Your callback for the virtual event
    <<ListBoxSelect>> could then make use of this variable to suppress the time-consuming operation for some of the columns.


    Of course, <<ListboxSelect>> (or <<TablelistSelect>>), rather than <<ListBoxSelect>>.

    --
    Csaba Nemethi https://www.nemethi.de mailto:csaba.nemethi@t-online.de

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From nemethi@21:1/5 to All on Mon Mar 13 21:51:57 2023
    Am 13.03.23 um 17:05 schrieb Ralf Fassel:
    I have a tablelist, where the <<ListBoxSelect>> command is a
    time-consuming operation, so I want to invoke it only in some columns,
    but not in others.

    Especially column 1 is configured

    -editwindow checkbutton \
    -labelwindow checkbutton \

    and when I click the checkbutton in that column, I do *not* want to
    invoke the <<ListBoxSelect>> binding.

    Is there some easy way to achieve this?

    I also have

    -editstartcommand [namespace code [list set_active_image 1]] \
    -editendcommand [namespace code [list set_active_image 0]] \

    configured on the tablelist itself, where I check for column 1 and set checked/unchecked images, so I could prohibit <<ListBoxSelect>> while 'editing' column 1, but maybe there is a smarter way?

    TNX
    R'

    bind [$tbl bodytag] <Button-1> {onBtn1 %W %x %y}
    proc onBtn1 {w x y} {
    lassign [tablelist::convEventFields $w $x $y] tbl x y
    global clickedCol
    set clickedCol [$tbl nearestcolumn $x]
    puts $clickedCol
    }

    Te above code sets the global variable clickedCol to the column index of
    the clicked column. Your callback for the virtual event
    <<ListBoxSelect>> could then make use of this variable to suppress the time-consuming operation for some of the columns.

    --
    Csaba Nemethi https://www.nemethi.de mailto:csaba.nemethi@t-online.de

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