Struct SmartTable

Source
pub struct SmartTable { /* private fields */ }
Expand description

Smart table widget

Implementations§

Source§

impl SmartTable

Source

pub fn new<S: Into<Option<&'static str>>>( x: i32, y: i32, w: i32, h: i32, label: S, ) -> Self

Construct a new SmartTable widget using coords, size and label

Source

pub fn default_fill() -> Self

Create a SmartTable the size of the parent widget

Source

pub fn set_opts(&mut self, opts: TableOpts)

Sets the tables options

Source

pub fn with_opts(self, opts: TableOpts) -> Self

Instantiate with TableOpts

Examples found in repository?
examples/headers.rs (lines 15-19)
8fn main() {
9    let app = app::App::default().with_scheme(app::Scheme::Gtk);
10    let mut wind = window::Window::default().with_size(800, 600);
11
12    let mut table = SmartTable::default()
13        .with_size(790, 590)
14        .center_of_parent()
15        .with_opts(TableOpts {
16            rows: 30,
17            cols: 15,
18            ..Default::default()
19        });
20
21    wind.end();
22    wind.show();
23
24    for i in 0..30 {
25        table.set_row_header_value(i, &(i + 100).to_string());
26    }
27
28    for i in 0..15 {
29        table.set_col_header_value(i, &i.to_string());
30    }
31
32    app.run().unwrap();
33}
More examples
Hide additional examples
examples/simple.rs (lines 16-21)
8fn main() {
9    let app = app::App::default().with_scheme(app::Scheme::Gtk);
10    let mut wind = window::Window::default().with_size(800, 600);
11
12    // We pass the rows and columns thru the TableOpts field
13    let mut table = SmartTable::default()
14        .with_size(790, 590)
15        .center_of_parent()
16        .with_opts(TableOpts {
17            rows: 30,
18            cols: 30,
19            editable: true,
20            ..Default::default()
21        });
22
23    wind.end();
24    wind.show();
25
26    // set the value at the row,column 4,5 to "another", notice that indices start at 0
27    table.set_cell_value(3, 4, "another");
28    assert_eq!(table.cell_value(3, 4), "another");
29
30    // To avoid closing the window on hitting the escape key
31    wind.set_callback(move |_| {
32        if app::event() == enums::Event::Close {
33            app.quit();
34        }
35    });
36
37    app.run().unwrap();
38}
examples/int_table.rs (lines 16-21)
8fn main() {
9    let app = app::App::default().with_scheme(app::Scheme::Gtk);
10    let mut wind = window::Window::default().with_size(800, 600);
11
12    // We pass the rows and columns thru the TableOpts field
13    let mut table = SmartTable::default()
14        .with_size(790, 590)
15        .center_of_parent()
16        .with_opts(TableOpts {
17            rows: 30,
18            cols: 1000,
19            editable: true,
20            ..Default::default()
21        });
22
23    wind.end();
24    wind.show();
25
26    table
27        .input()
28        .as_mut()
29        .unwrap()
30        .set_type(input::InputType::Int);
31
32    // set the value at the row,column 4,5 to "another", notice that indices start at 0
33    table.set_cell_value(3, 4, "10");
34    assert_eq!(table.cell_value(3, 4), "10");
35
36    // To avoid closing the window on hitting the escape key
37    wind.set_callback(move |_| {
38        if app::event() == enums::Event::Close {
39            app.quit();
40        }
41    });
42
43    app.run().unwrap();
44}
examples/styled.rs (lines 16-24)
9fn main() {
10    let app = app::App::default().with_scheme(app::Scheme::Gtk);
11    let mut wind = window::Window::default().with_size(800, 600);
12
13    let mut table = SmartTable::default()
14        .with_size(790, 590)
15        .center_of_parent()
16        .with_opts(TableOpts {
17            rows: 30,
18            cols: 15,
19            cell_selection_color: Color::Red.inactive(),
20            header_frame: FrameType::FlatBox,
21            header_color: Color::BackGround.lighter(),
22            cell_border_color: Color::White,
23            ..Default::default()
24        });
25
26    wind.end();
27    wind.show();
28
29    // Just filling the vec with some values
30    for i in 0..30 {
31        for j in 0..15 {
32            table.set_cell_value(i, j, &(i + j).to_string());
33        }
34    }
35    table.redraw();
36
37    // To avoid closing the window on hitting the escape key
38    wind.set_callback(move |_| {
39        if app::event() == Event::Close {
40            app.quit();
41        }
42    });
43
44    app.run().unwrap();
45}
Source

pub fn input(&mut self) -> &mut Option<Input>

Get the input widget

Examples found in repository?
examples/int_table.rs (line 27)
8fn main() {
9    let app = app::App::default().with_scheme(app::Scheme::Gtk);
10    let mut wind = window::Window::default().with_size(800, 600);
11
12    // We pass the rows and columns thru the TableOpts field
13    let mut table = SmartTable::default()
14        .with_size(790, 590)
15        .center_of_parent()
16        .with_opts(TableOpts {
17            rows: 30,
18            cols: 1000,
19            editable: true,
20            ..Default::default()
21        });
22
23    wind.end();
24    wind.show();
25
26    table
27        .input()
28        .as_mut()
29        .unwrap()
30        .set_type(input::InputType::Int);
31
32    // set the value at the row,column 4,5 to "another", notice that indices start at 0
33    table.set_cell_value(3, 4, "10");
34    assert_eq!(table.cell_value(3, 4), "10");
35
36    // To avoid closing the window on hitting the escape key
37    wind.set_callback(move |_| {
38        if app::event() == enums::Event::Close {
39            app.quit();
40        }
41    });
42
43    app.run().unwrap();
44}
Source

pub fn data(&self) -> Vec<Vec<Cell>>

Get a copy of the data

Source

pub fn data_ref(&self) -> Arc<Mutex<Vec<Vec<Cell>>>>

Get the inner data

Source

pub fn set_cell_value(&mut self, row: i32, col: i32, val: &str)

Set the cell value, using the row and column to index the data

Examples found in repository?
examples/simple.rs (line 27)
8fn main() {
9    let app = app::App::default().with_scheme(app::Scheme::Gtk);
10    let mut wind = window::Window::default().with_size(800, 600);
11
12    // We pass the rows and columns thru the TableOpts field
13    let mut table = SmartTable::default()
14        .with_size(790, 590)
15        .center_of_parent()
16        .with_opts(TableOpts {
17            rows: 30,
18            cols: 30,
19            editable: true,
20            ..Default::default()
21        });
22
23    wind.end();
24    wind.show();
25
26    // set the value at the row,column 4,5 to "another", notice that indices start at 0
27    table.set_cell_value(3, 4, "another");
28    assert_eq!(table.cell_value(3, 4), "another");
29
30    // To avoid closing the window on hitting the escape key
31    wind.set_callback(move |_| {
32        if app::event() == enums::Event::Close {
33            app.quit();
34        }
35    });
36
37    app.run().unwrap();
38}
More examples
Hide additional examples
examples/int_table.rs (line 33)
8fn main() {
9    let app = app::App::default().with_scheme(app::Scheme::Gtk);
10    let mut wind = window::Window::default().with_size(800, 600);
11
12    // We pass the rows and columns thru the TableOpts field
13    let mut table = SmartTable::default()
14        .with_size(790, 590)
15        .center_of_parent()
16        .with_opts(TableOpts {
17            rows: 30,
18            cols: 1000,
19            editable: true,
20            ..Default::default()
21        });
22
23    wind.end();
24    wind.show();
25
26    table
27        .input()
28        .as_mut()
29        .unwrap()
30        .set_type(input::InputType::Int);
31
32    // set the value at the row,column 4,5 to "another", notice that indices start at 0
33    table.set_cell_value(3, 4, "10");
34    assert_eq!(table.cell_value(3, 4), "10");
35
36    // To avoid closing the window on hitting the escape key
37    wind.set_callback(move |_| {
38        if app::event() == enums::Event::Close {
39            app.quit();
40        }
41    });
42
43    app.run().unwrap();
44}
examples/styled.rs (line 32)
9fn main() {
10    let app = app::App::default().with_scheme(app::Scheme::Gtk);
11    let mut wind = window::Window::default().with_size(800, 600);
12
13    let mut table = SmartTable::default()
14        .with_size(790, 590)
15        .center_of_parent()
16        .with_opts(TableOpts {
17            rows: 30,
18            cols: 15,
19            cell_selection_color: Color::Red.inactive(),
20            header_frame: FrameType::FlatBox,
21            header_color: Color::BackGround.lighter(),
22            cell_border_color: Color::White,
23            ..Default::default()
24        });
25
26    wind.end();
27    wind.show();
28
29    // Just filling the vec with some values
30    for i in 0..30 {
31        for j in 0..15 {
32            table.set_cell_value(i, j, &(i + j).to_string());
33        }
34    }
35    table.redraw();
36
37    // To avoid closing the window on hitting the escape key
38    wind.set_callback(move |_| {
39        if app::event() == Event::Close {
40            app.quit();
41        }
42    });
43
44    app.run().unwrap();
45}
Source

pub fn cell_value(&self, row: i32, col: i32) -> String

Get the cell value, using the row and column to index the data

Examples found in repository?
examples/simple.rs (line 28)
8fn main() {
9    let app = app::App::default().with_scheme(app::Scheme::Gtk);
10    let mut wind = window::Window::default().with_size(800, 600);
11
12    // We pass the rows and columns thru the TableOpts field
13    let mut table = SmartTable::default()
14        .with_size(790, 590)
15        .center_of_parent()
16        .with_opts(TableOpts {
17            rows: 30,
18            cols: 30,
19            editable: true,
20            ..Default::default()
21        });
22
23    wind.end();
24    wind.show();
25
26    // set the value at the row,column 4,5 to "another", notice that indices start at 0
27    table.set_cell_value(3, 4, "another");
28    assert_eq!(table.cell_value(3, 4), "another");
29
30    // To avoid closing the window on hitting the escape key
31    wind.set_callback(move |_| {
32        if app::event() == enums::Event::Close {
33            app.quit();
34        }
35    });
36
37    app.run().unwrap();
38}
More examples
Hide additional examples
examples/int_table.rs (line 34)
8fn main() {
9    let app = app::App::default().with_scheme(app::Scheme::Gtk);
10    let mut wind = window::Window::default().with_size(800, 600);
11
12    // We pass the rows and columns thru the TableOpts field
13    let mut table = SmartTable::default()
14        .with_size(790, 590)
15        .center_of_parent()
16        .with_opts(TableOpts {
17            rows: 30,
18            cols: 1000,
19            editable: true,
20            ..Default::default()
21        });
22
23    wind.end();
24    wind.show();
25
26    table
27        .input()
28        .as_mut()
29        .unwrap()
30        .set_type(input::InputType::Int);
31
32    // set the value at the row,column 4,5 to "another", notice that indices start at 0
33    table.set_cell_value(3, 4, "10");
34    assert_eq!(table.cell_value(3, 4), "10");
35
36    // To avoid closing the window on hitting the escape key
37    wind.set_callback(move |_| {
38        if app::event() == enums::Event::Close {
39            app.quit();
40        }
41    });
42
43    app.run().unwrap();
44}
Source

pub fn set_cell_color(&mut self, row: i32, col: i32, color: Color)

Set the cell value, using the row and column to index the data

Source

pub fn set_cell_selection_color(&mut self, row: i32, col: i32, color: Color)

Set the cell value, using the row and column to index the data

Source

pub fn set_cell_font_color(&mut self, row: i32, col: i32, color: Color)

Set the cell value, using the row and column to index the data

Source

pub fn set_cell_border_color(&mut self, row: i32, col: i32, color: Color)

Set the cell value, using the row and column to index the data

Source

pub fn set_cell_font(&mut self, row: i32, col: i32, font: Font)

Set the cell value, using the row and column to index the data

Source

pub fn set_cell_font_size(&mut self, row: i32, col: i32, sz: i32)

Set the cell value, using the row and column to index the data

Source

pub fn set_cell_align(&mut self, row: i32, col: i32, align: Align)

Set the cell value, using the row and column to index the data

Source

pub fn set_row_header_value(&mut self, row: i32, val: &str)

Set the row header value at the row index

Examples found in repository?
examples/headers.rs (line 25)
8fn main() {
9    let app = app::App::default().with_scheme(app::Scheme::Gtk);
10    let mut wind = window::Window::default().with_size(800, 600);
11
12    let mut table = SmartTable::default()
13        .with_size(790, 590)
14        .center_of_parent()
15        .with_opts(TableOpts {
16            rows: 30,
17            cols: 15,
18            ..Default::default()
19        });
20
21    wind.end();
22    wind.show();
23
24    for i in 0..30 {
25        table.set_row_header_value(i, &(i + 100).to_string());
26    }
27
28    for i in 0..15 {
29        table.set_col_header_value(i, &i.to_string());
30    }
31
32    app.run().unwrap();
33}
Source

pub fn set_col_header_value(&mut self, col: i32, val: &str)

Set the column header value at the column index

Examples found in repository?
examples/headers.rs (line 29)
8fn main() {
9    let app = app::App::default().with_scheme(app::Scheme::Gtk);
10    let mut wind = window::Window::default().with_size(800, 600);
11
12    let mut table = SmartTable::default()
13        .with_size(790, 590)
14        .center_of_parent()
15        .with_opts(TableOpts {
16            rows: 30,
17            cols: 15,
18            ..Default::default()
19        });
20
21    wind.end();
22    wind.show();
23
24    for i in 0..30 {
25        table.set_row_header_value(i, &(i + 100).to_string());
26    }
27
28    for i in 0..15 {
29        table.set_col_header_value(i, &i.to_string());
30    }
31
32    app.run().unwrap();
33}
Source

pub fn row_header_value(&mut self, row: i32) -> String

Get the row header value at the row index

Source

pub fn col_header_value(&mut self, col: i32) -> String

Get the column header value at the column index

Source

pub fn insert_empty_row(&mut self, row: i32, row_header: &str)

Insert an empty row at the row index

Source

pub fn insert_row(&mut self, row: i32, row_header: &str, vals: &[&str])

Append a row to your table

Source

pub fn append_empty_row(&mut self, row_header: &str)

Append an empty row to your table

Source

pub fn append_row(&mut self, row_header: &str, vals: &[&str])

Append a row to your table

Source

pub fn insert_empty_col(&mut self, col: i32, col_header: &str)

Insert an empty column at the column index

Source

pub fn insert_col(&mut self, col: i32, col_header: &str, vals: &[&str])

Append a column to your table

Source

pub fn append_empty_col(&mut self, col_header: &str)

Append an empty column to your table

Source

pub fn append_col(&mut self, col_header: &str, vals: &[&str])

Append a column to your table

Source

pub fn remove_row(&mut self, row: i32)

Remove a row at the row index

Source

pub fn remove_col(&mut self, col: i32)

Remove a column at the column index

Source

pub fn set_callback<F: FnMut(&mut Self) + 'static>(&mut self, cb: F)

Set a callback for the SmartTable

Source

pub fn set_on_update_callback<F: FnMut(i32, i32, String) + Send + 'static>( &mut self, cb: F, )

Set a callback for on user input callback function takes the values row, col, and the new value of the cell

Source

pub fn clear(&mut self)

Clears all cells in the table

Source

pub fn row_count(&self) -> i32

Returns the row count

Source

pub fn column_count(&self) -> i32

Returns the column count

Source

pub fn col_width(&self, col: i32) -> i32

Get the column’s width

Source

pub fn row_height(&self, row: i32) -> i32

Get the row’s height

Source

pub fn set_col_width(&mut self, col: i32, width: i32)

Set column’s width

Source

pub fn set_row_height(&mut self, row: i32, height: i32)

Set the row’s height

Source

pub fn col_header_height(&self) -> i32

Get the column header height

Source

pub fn row_header_width(&self) -> i32

Get the row header width

Source

pub fn set_col_header_height(&mut self, height: i32)

Set column header height

Source

pub fn set_row_header_width(&mut self, width: i32)

Set the row header width

Source§

impl SmartTable

Source

pub fn with_pos(self, x: i32, y: i32) -> Self

Initialize to position x, y

Source

pub fn with_size(self, width: i32, height: i32) -> Self

Initialize to size width, height

Examples found in repository?
examples/headers.rs (line 13)
8fn main() {
9    let app = app::App::default().with_scheme(app::Scheme::Gtk);
10    let mut wind = window::Window::default().with_size(800, 600);
11
12    let mut table = SmartTable::default()
13        .with_size(790, 590)
14        .center_of_parent()
15        .with_opts(TableOpts {
16            rows: 30,
17            cols: 15,
18            ..Default::default()
19        });
20
21    wind.end();
22    wind.show();
23
24    for i in 0..30 {
25        table.set_row_header_value(i, &(i + 100).to_string());
26    }
27
28    for i in 0..15 {
29        table.set_col_header_value(i, &i.to_string());
30    }
31
32    app.run().unwrap();
33}
More examples
Hide additional examples
examples/simple.rs (line 14)
8fn main() {
9    let app = app::App::default().with_scheme(app::Scheme::Gtk);
10    let mut wind = window::Window::default().with_size(800, 600);
11
12    // We pass the rows and columns thru the TableOpts field
13    let mut table = SmartTable::default()
14        .with_size(790, 590)
15        .center_of_parent()
16        .with_opts(TableOpts {
17            rows: 30,
18            cols: 30,
19            editable: true,
20            ..Default::default()
21        });
22
23    wind.end();
24    wind.show();
25
26    // set the value at the row,column 4,5 to "another", notice that indices start at 0
27    table.set_cell_value(3, 4, "another");
28    assert_eq!(table.cell_value(3, 4), "another");
29
30    // To avoid closing the window on hitting the escape key
31    wind.set_callback(move |_| {
32        if app::event() == enums::Event::Close {
33            app.quit();
34        }
35    });
36
37    app.run().unwrap();
38}
examples/int_table.rs (line 14)
8fn main() {
9    let app = app::App::default().with_scheme(app::Scheme::Gtk);
10    let mut wind = window::Window::default().with_size(800, 600);
11
12    // We pass the rows and columns thru the TableOpts field
13    let mut table = SmartTable::default()
14        .with_size(790, 590)
15        .center_of_parent()
16        .with_opts(TableOpts {
17            rows: 30,
18            cols: 1000,
19            editable: true,
20            ..Default::default()
21        });
22
23    wind.end();
24    wind.show();
25
26    table
27        .input()
28        .as_mut()
29        .unwrap()
30        .set_type(input::InputType::Int);
31
32    // set the value at the row,column 4,5 to "another", notice that indices start at 0
33    table.set_cell_value(3, 4, "10");
34    assert_eq!(table.cell_value(3, 4), "10");
35
36    // To avoid closing the window on hitting the escape key
37    wind.set_callback(move |_| {
38        if app::event() == enums::Event::Close {
39            app.quit();
40        }
41    });
42
43    app.run().unwrap();
44}
examples/styled.rs (line 14)
9fn main() {
10    let app = app::App::default().with_scheme(app::Scheme::Gtk);
11    let mut wind = window::Window::default().with_size(800, 600);
12
13    let mut table = SmartTable::default()
14        .with_size(790, 590)
15        .center_of_parent()
16        .with_opts(TableOpts {
17            rows: 30,
18            cols: 15,
19            cell_selection_color: Color::Red.inactive(),
20            header_frame: FrameType::FlatBox,
21            header_color: Color::BackGround.lighter(),
22            cell_border_color: Color::White,
23            ..Default::default()
24        });
25
26    wind.end();
27    wind.show();
28
29    // Just filling the vec with some values
30    for i in 0..30 {
31        for j in 0..15 {
32            table.set_cell_value(i, j, &(i + j).to_string());
33        }
34    }
35    table.redraw();
36
37    // To avoid closing the window on hitting the escape key
38    wind.set_callback(move |_| {
39        if app::event() == Event::Close {
40            app.quit();
41        }
42    });
43
44    app.run().unwrap();
45}
Source

pub fn with_label(self, title: &str) -> Self

Initialize with a label

Source

pub fn with_align(self, align: Align) -> Self

Initialize with alignment

Source

pub fn with_type<T: WidgetType>(self, typ: T) -> Self

Initialize with type

Source

pub fn below_of<W: WidgetExt>(self, wid: &W, padding: i32) -> Self

Initialize at bottom of another widget

Source

pub fn above_of<W: WidgetExt>(self, wid: &W, padding: i32) -> Self

Initialize above of another widget

Source

pub fn right_of<W: WidgetExt>(self, wid: &W, padding: i32) -> Self

Initialize right of another widget

Source

pub fn left_of<W: WidgetExt>(self, wid: &W, padding: i32) -> Self

Initialize left of another widget

Source

pub fn center_of<W: WidgetExt>(self, w: &W) -> Self

Initialize center of another widget

Source

pub fn center_x<W: WidgetExt>(self, w: &W) -> Self

Initialize center of another widget on the x axis

Source

pub fn center_y<W: WidgetExt>(self, w: &W) -> Self

Initialize center of another widget on the y axis

Source

pub fn center_of_parent(self) -> Self

Initialize center of parent

Examples found in repository?
examples/headers.rs (line 14)
8fn main() {
9    let app = app::App::default().with_scheme(app::Scheme::Gtk);
10    let mut wind = window::Window::default().with_size(800, 600);
11
12    let mut table = SmartTable::default()
13        .with_size(790, 590)
14        .center_of_parent()
15        .with_opts(TableOpts {
16            rows: 30,
17            cols: 15,
18            ..Default::default()
19        });
20
21    wind.end();
22    wind.show();
23
24    for i in 0..30 {
25        table.set_row_header_value(i, &(i + 100).to_string());
26    }
27
28    for i in 0..15 {
29        table.set_col_header_value(i, &i.to_string());
30    }
31
32    app.run().unwrap();
33}
More examples
Hide additional examples
examples/simple.rs (line 15)
8fn main() {
9    let app = app::App::default().with_scheme(app::Scheme::Gtk);
10    let mut wind = window::Window::default().with_size(800, 600);
11
12    // We pass the rows and columns thru the TableOpts field
13    let mut table = SmartTable::default()
14        .with_size(790, 590)
15        .center_of_parent()
16        .with_opts(TableOpts {
17            rows: 30,
18            cols: 30,
19            editable: true,
20            ..Default::default()
21        });
22
23    wind.end();
24    wind.show();
25
26    // set the value at the row,column 4,5 to "another", notice that indices start at 0
27    table.set_cell_value(3, 4, "another");
28    assert_eq!(table.cell_value(3, 4), "another");
29
30    // To avoid closing the window on hitting the escape key
31    wind.set_callback(move |_| {
32        if app::event() == enums::Event::Close {
33            app.quit();
34        }
35    });
36
37    app.run().unwrap();
38}
examples/int_table.rs (line 15)
8fn main() {
9    let app = app::App::default().with_scheme(app::Scheme::Gtk);
10    let mut wind = window::Window::default().with_size(800, 600);
11
12    // We pass the rows and columns thru the TableOpts field
13    let mut table = SmartTable::default()
14        .with_size(790, 590)
15        .center_of_parent()
16        .with_opts(TableOpts {
17            rows: 30,
18            cols: 1000,
19            editable: true,
20            ..Default::default()
21        });
22
23    wind.end();
24    wind.show();
25
26    table
27        .input()
28        .as_mut()
29        .unwrap()
30        .set_type(input::InputType::Int);
31
32    // set the value at the row,column 4,5 to "another", notice that indices start at 0
33    table.set_cell_value(3, 4, "10");
34    assert_eq!(table.cell_value(3, 4), "10");
35
36    // To avoid closing the window on hitting the escape key
37    wind.set_callback(move |_| {
38        if app::event() == enums::Event::Close {
39            app.quit();
40        }
41    });
42
43    app.run().unwrap();
44}
examples/styled.rs (line 15)
9fn main() {
10    let app = app::App::default().with_scheme(app::Scheme::Gtk);
11    let mut wind = window::Window::default().with_size(800, 600);
12
13    let mut table = SmartTable::default()
14        .with_size(790, 590)
15        .center_of_parent()
16        .with_opts(TableOpts {
17            rows: 30,
18            cols: 15,
19            cell_selection_color: Color::Red.inactive(),
20            header_frame: FrameType::FlatBox,
21            header_color: Color::BackGround.lighter(),
22            cell_border_color: Color::White,
23            ..Default::default()
24        });
25
26    wind.end();
27    wind.show();
28
29    // Just filling the vec with some values
30    for i in 0..30 {
31        for j in 0..15 {
32            table.set_cell_value(i, j, &(i + j).to_string());
33        }
34    }
35    table.redraw();
36
37    // To avoid closing the window on hitting the escape key
38    wind.set_callback(move |_| {
39        if app::event() == Event::Close {
40            app.quit();
41        }
42    });
43
44    app.run().unwrap();
45}
Source

pub fn size_of<W: WidgetExt>(self, w: &W) -> Self

Initialize to the size of another widget

Source

pub fn size_of_parent(self) -> Self

Initialize to the size of the parent

Methods from Deref<Target = TableRow>§

Source

pub fn row_selected(&mut self, row: i32) -> bool

Returns whether a row was selected

Source

pub fn select_row( &mut self, row: i32, selection_flag: TableRowSelectFlag, ) -> Result<(), FltkError>

Selects a row

§Errors

Errors on failure to select row

Source

pub fn select_all_rows(&mut self, selection_flag: TableRowSelectFlag)

Selects all rows

Trait Implementations§

Source§

impl Clone for SmartTable

Source§

fn clone(&self) -> SmartTable

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for SmartTable

Source§

fn fmt(&self, fmt: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for SmartTable

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl Deref for SmartTable

Source§

type Target = TableRow

The resulting type after dereferencing.
Source§

fn deref(&self) -> &Self::Target

Dereferences the value.
Source§

impl DerefMut for SmartTable

Source§

fn deref_mut(&mut self) -> &mut Self::Target

Mutably dereferences the value.

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<P, T> Receiver for P
where P: Deref<Target = T> + ?Sized, T: ?Sized,

Source§

type Target = T

🔬This is a nightly-only experimental API. (arbitrary_self_types)
The target type on which the method may be called.
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.