fltk-rs / fltk-table

A smart table widget for fltk-rs
MIT License
16 stars 4 forks source link

Displayed row numbers conventionally start at 1 not 0 #7

Closed mark-summerfield closed 2 years ago

mark-summerfield commented 2 years ago

Although internally we expect row numbers to start at 0, the row numbers displayed by a table conventionally start at 1. This should at least be an option.

MoAlyousef commented 2 years ago

I’ll add it to the opts. For the time being you can change the row header values:

for i in 0..30 {
        table.set_row_header_value(i, &i.to_string());
    }
mark-summerfield commented 2 years ago

That almost works, here's what does:-)

for i in 0..30 {
    table.set_row_header_value(i, &(i + 1).to_string());
}
MoAlyousef commented 2 years ago

Indeed :) The latest main now starts row count at 1.