Struct termimad::ListView[][src]

pub struct ListView<'t, T> {
    pub area: Area,
    pub skin: &'t MadSkin,
    // some fields omitted
}
Expand description

A filterable list whose columns can be automatically resized.

Notes:

  • another version will allow more than one style per cell (i.e. make the cells composites rather than compounds). Shout out if you need that now.
  • this version doesn’t allow cell wrapping

Fields

area: Areaskin: &'t MadSkin

Implementations

Create a new list view with the passed columns.

The columns can’t be changed afterwards but the area can be modified. When two columns have the same title, those titles are merged (but the columns below stay separated).

set a comparator for row sorting

return the height which is available for rows

return an option which when filled contains a tupple with the top and bottom of the vertical scrollbar. Return none when the content fits the available space.

remove all rows (and selection).

Keep the columns and the sort function, if any.

return both the number of displayed rows and the total number

recompute the widths of all columns. This should be called when the area size is modified

write the list view on the given writer

display the whole list in its area

return true if the last line of the list is visible

ensure the last line is visible

set the scroll amount. lines_count can be negative

set the scroll amount. pages_count can be negative

try to select the next visible line

select the first visible line (unless there’s nothing).

select the last visible line (unless there’s nothing).

scroll to ensure the selected line (if any) is visible.

This is automatically called by try_scroll and try select functions

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

The alignment of pointer.

The type for initializers.

Initializes a with the given initializer. Read more

Dereferences the given pointer. Read more

Mutably dereferences the given pointer. Read more

Drops the object pointed to by the given pointer. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.