Open smallB007 opened 4 years ago
Hi, I would appreciate if somebody would either tell me that this functionality is not supported/missing/or I'm doing something wrong(most likely). Seriously... For somebody (like author of the crate who know the code and workings of it) to be able to help this shouldn't be that difficult. Leaving/Ignoring questions is rather... well let's be honest disappointing and irritating.
Note that set_on_submit
can accept closures, which lets you embed parameters:
fn Enter_Fn(app: &mut cursive::Cursive, row: usize, index: usize, table_id: usize) { }
for i in 0..10 {
//create panels
let mut panel_left = create_table();//see decl below, it is the same as in examples from the repo
panel_left.set_on_submit(|s, r, index| Enter_Fn(s,r,index, i)); //register callback. Note that here we include the `i` parameter.
// here I have some code that defines layout etc, so the last line is "pseudo code"
siv.add_layout(panel_left);
}
Hi everyone, I'm using cursive crate along with cursive_table_view crate. I'm registering callback to each created table and yes, this callback is being triggered, but I believe that there is not enough info in that callback.
How to know in the Enter_Fn function which table was active when the enter was pressed, that is, we are inside of the Enter_Fn callback but all we have is app, row and index but not the view which triggered that callback.
Thanks for any help