antoyo / relm

Idiomatic, GTK+-based, GUI library, inspired by Elm, written in Rust
MIT License
2.43k stars 78 forks source link

Declarative TreeViews #185

Open steven-joruk opened 4 years ago

steven-joruk commented 4 years ago

Hello! I'm finding TreeViews a bit unintuitive to use with #[widget].

  1. In issue #50 you gave some example code for connecting a child's signals which sounds great, but the branch was deleted. Is this still a goal, or is it already possible? I couldn't see any examples or obvious implementation.

  2. In issue #181 and in the async example the solution for using connect! on a TreeSelection is to store a clone of the relm object in the model to use later on, but it doesn't feel nice - maybe init_view could be given a &Relm<T> or the relm's stream?

  3. Is setting up CellRenderers and TreeViewColumns declaratively a future goal or is it a bad approach?

Thanks :).

antoyo commented 4 years ago

Hi.

  1. The example was moved here.
  2. I think init_view() used to take a Relm as a parameter, but I removed it to make the function signatures simpler. Now that you talk about it, maybe I could change the code generation so that connect!() could take self as a parameter.
  3. Yes it is. That would require creating custom relm widgets for these.