mittelmark / oowidgets

Megawidget creation package using TclOO
https://wiki.tcl-lang.org/page/oowidgets
BSD 3-Clause "New" or "Revised" License
0 stars 0 forks source link

treeview, sorting by configure args #2

Closed gregnix closed 1 year ago

gregnix commented 1 year ago

package require oowidgets namespace eval ::test { } oowidgets::widget ::test::Treeview { constructor {path args} { my install ttk::treeview $path my configure {*}$args } }

ttk::treeview .tree -columns "Row1 Row2" -displaycolumns "Row2 Row1"

test::treeview .tree -columns "Row1 Row2" -displaycolumns "Row2 Row1" .tree heading Row1 -text "row1" -anchor center .tree heading Row2 -text "row2" -anchor center pack .tree

Error: Invalid column index Row2 while executing "$widget configure $opt $val " ...

oowidgets.tcl oo::class create ::oowidgets::BaseWidget method configure

in foreach opt [array names opts] { $widget configure $opt $val executes : -displaycolumns "Row2 Row1" then: -columns "Row1 Row2"

mittelmark commented 1 year ago

Thanks for the report. I recognize the problem. You are right, the configuration was done option by option and in this case displaycolumns internally was configured before columns. I now configure at the end all at once after the loop:

$widget configure {*}$args

So the current version on Github should fix the problem, version is now 0.3.1 for oowidgets.

Thanks for the report. Detlef