ttkbootstrap icon indicating copy to clipboard operation
ttkbootstrap copied to clipboard

Add selection_changed event to TableView

Open Aareon opened this issue 9 months ago • 2 comments

Is your feature request related to a problem? Please describe.

I have a need for responding when table selection changes, such as updating a num selected label.

Describe the solution you'd like

A bindable event for when table selection changes.

Describe alternatives you've considered

Other features I've considered are embedding a check button inside a table element to select a row. This did not work as I expected, but I figured an event would be much more versatile.

Additional context

No response

Aareon avatar Nov 17 '23 21:11 Aareon

Binding Button-1 and KeyRelease on tableview.view, I have found that getting the selection does not work as expected on the first event. I've tried using tableview.view.update then tableview.view.selection() to no avail. Getting the selection requires clicking twice. See below GIF.

NVIDIA_Share_oocBb7TS46

Aareon avatar Nov 18 '23 17:11 Aareon

I've also noticed that tableview.insert_row("end", ["value1", "value2", "value3"]) does not work, at least on 3.12. tableview.view.insert_row() does work as expected.

Aareon avatar Nov 18 '23 23:11 Aareon