antoyo / relm

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

notebook pages communication #202

Closed whdxwym closed 4 years ago

whdxwym commented 4 years ago

I have a notebook with two pages, and want to read data from one page in the other page. I send GetMsg to the page's parent, and the parent send GetMsg to the other page, then the other page send data with a SendMsg to the parent, and the parent send it to the first page. I think this way is too complicated, and I cannot find an example to do it. Is there a better way?

antoyo commented 4 years ago

It is indeed the way to two this. There's syntax to make this less cumbersome. If that's not enough, maybe you could only have one relm widgets so that you don't have to send the data between multiple relm widgets.

whdxwym commented 4 years ago

Ok, thank you very much. my notebook page contains too many entries to fit in one file, so I guess I have to use the old way.

antoyo commented 4 years ago

If that is the case, you can still create sub-modules to divide the widget in multiple files: that's what I did in titanium where app is divided in multiple files.