Hi,
I’m working on Rust and GTK 3 alternative to Fslint(Python 2 and GTK 2), but I now stuck on changing background color and disabling rows in ListStore
This is how it looks in FSlint, rows 2 x 28 etc. are disabled(not selectable) and have changed background color.
You can use set_select_function on Gtk.TreeSelection to set a callback that will decide whether a row is selectable.
You can change the colors of a cell by adding an attribute for your cell renderer and changing the cell-background and cell-background-set properties (documentation).
(I don’t remember if it’s those properties, or the background-* ones from Gtk.CellRendererText, but I hope you can find the correct ones from there )
But still I don’t know how to disable selection of rows, since in Rust this function have different definition - std::option::Option<std::boxed::Box<(dyn for<'r, 's, 't0> std::ops::Fn(&'r gtk::TreeSelection, &'s gtk::TreeModel, &'t0 gtk::TreePath, bool) -> bool + 'static)>>
Is there any easier method to disable selection?
Why GTK is so hard and not intuitive?
I created some time ago simple UI in Godot and writing logic was a lot of easier(probably also because it use C++)