Menu

#228 Autolabeling ttk::treeview nodes with their index number

closed-out-of-date
3
2013-03-04
2010-05-27
Anonymous
No

in tree mode ( -show tree) is it not possible to put index number in integer foam.
i mean first column in tree mode always give row numbers. whenever we delete an item the row number should be updated.
for example lets have height of treeview is 10, so we have 10 rows , column 0 indicate 1 to 10 in integer. if i delete item 5 then it should update all index numbers.
if you could add this feature then it would be great.
Thanks

Discussion

  • Donal K. Fellows

    • labels: --> 88. Themed Tk (Ttk)
    • priority: 9 --> 5
    • assigned_to: nobody --> jenglish
     
  • Donal K. Fellows

    • summary: ttk::treeview --> Autolabeling ttk::treeview nodes with their index number
     
  • Joe English

    Joe English - 2010-05-27

    I'm not quite sure what it is you're asking for, but at a first guess, something like the following might ought to work:

    set i 0; foreach item [$tv children {}] { $tv item $iitem -text "[incr i]" }

    Wrap this up in a proc and call it whenever you modify the tree structure.

    Does that help?

     
  • Joe English

    Joe English - 2010-05-27
    • priority: 5 --> 3
     
  • Joe English

    Joe English - 2013-03-04

    (stale report - closing)

     
  • Joe English

    Joe English - 2013-03-04
    • status: open --> closed-out-of-date