1
0
Fork 0
mirror of synced 2024-05-02 11:33:00 +12:00

Create basic function to disable selecting object

This commit is contained in:
Rafał Mikrut 2020-09-25 20:29:09 +02:00
parent 4b96634305
commit 45e0bde981

View file

@ -370,6 +370,9 @@ fn main() {
}
}
let tree_selection = tree_view_duplicate_finder.get_selection();
tree_selection.set_select_function(Some(Box::new(select_function)));
scrolled_window_duplicate_finder.add(&tree_view_duplicate_finder);
scrolled_window_duplicate_finder.show_all();
@ -432,7 +435,6 @@ fn main() {
for (name, entry) in hashmap {
let name: String = name[..(name.len() - 1)].to_string();
let index = name.rfind('/').unwrap();
println!("{}", name);
let values: [&dyn ToValue; 4] = [
&(name[index + 1..].to_string()),
&(name[..index].to_string()),
@ -604,3 +606,8 @@ pub fn print_text_messages_to_text_view(text_messages: &Messages, text_view: &gt
text_view.get_buffer().unwrap().set_text(messages.as_str());
}
fn select_function(_ts: &gtk::TreeSelection, _tm: &gtk::TreeModel, _tp: &gtk::TreePath, _b: bool) -> bool {
// TODO Create proper function to disable selecting header rows
false
}