Closed vortex314 closed 1 year ago
Hi! Opened a PR to fix this. Presumably, get_selected_cell
would be the correct function to call. See #123 and let me know if it's fine as usual.
Looks you missed : tabel.set_row_height in the wrapper.
There is no height-setting function; in the link you provided (https://docs.lvgl.io/master/widgets/table.html#width-and-height) it states that height is auto-calculated based on other info, and also there is no lv_table_set_row_height()
function at all.
indeed you're right. My bad.
Anything else needed to use tables?
In version 7.11 there was a call lv_table_set_cell_type which permitted to later on apply a different style to some cells in the table. I didn't find the equivalent in 8.3 yet. The target is that the head row is colored and can be used upon clicking to sort the data.
Don't see it... all the raw C bindings exported can be found here: https://docs.rs/lvgl-sys/latest/lvgl_sys/
Search for lv_table_
. However, I don't see something similar either there or in the LVGL docs.
Looks to be decommissioned the, was referring to this : https://docs.lvgl.io/7.11/widgets/table.html?highlight=lv_table_set_cell_type#_CPPv422lv_table_set_cell_typeP8lv_obj_t8uint16_t8uint16_t7uint8_t
unsure what I can do about that :c
Starts to look good. :-D
Merged #123
This code
table.on_event(|mut _table, _event| match _event {
Event::Clicked => {
let (r, c) = _table.get_selected_cell().unwrap();
info!("Table event : {:?} row {} col {} ", _event, r, c);
Returns for all cells 65535 ? Any cell I can click upon.
2023-05-10 18:52:07.576 INFO lv_1::view - Table event : Clicked row 65535 col 65535
Did I miss something ?
uhhh... that's odd. I'll take a look
Seems like it doesn't see a selection? https://docs.lvgl.io/8.3/widgets/core/table.html?highlight=table#keys I think you're meant to send a key event to make a selection, somehow
Indeed. You're right.
2023-05-10 19:07:37.679 INFO lv_1::view - Table event : Clicked row 65535 col 65535
2023-05-10 19:07:38.436 INFO lv_1::view - Table event : Pressed
2023-05-10 19:07:38.436 INFO lv_1::view - Table event : Pressed row 5 col 1
2023-05-10 19:07:38.436 INFO lv_1::view - Table event : Pressing
2023-05-10 19:07:38.436 INFO lv_1::view - Table event : Pressing row 5 col 1
2023-05-10 19:07:38.473 INFO lv_1::view - Table event : Pressing
2023-05-10 19:07:38.474 INFO lv_1::view - Table event : Pressing row 5 col 1
2023-05-10 19:07:38.504 INFO lv_1::view - Table event : ValueChanged
2023-05-10 19:07:38.504 INFO lv_1::view - Table event : ValueChanged row 5 col 1
2023-05-10 19:07:38.504 INFO lv_1::view - Table event : Released
2023-05-10 19:07:38.504 INFO lv_1::view - Table event : Released row 65535 col 65535
It's not under the Clicked event. It's under Pressed ,Pressing and Released when you use a mouse button.
Hi, here again with next one. ;-) Your swift feedback keeps me motivated to make my application work with LVGL. The following code seems to miss the methods
set_col_width
and setset_row_height
while they are exposed in the C source. https://docs.lvgl.io/master/widgets/table.html#width-and-heightSecondary question : how can I detect which cell was clicked ? I this via
lv_table_get_selected_cell
or vialv_event_get_draw_part_dsc
? Thanks again for your enduring assistance.