0.5->0.6 migration advice? #659
-
For study purpose, I tried upgrading the package that I use, regreet, onto newer (example of error for
But I guess this was fixed in 0.6.2, so when upgrading to e.g. for this code: connect_activate[
sender, usernames_box, username_entry, sessions_box, session_entry
] => move |this| {
sender.input(Self::Input::Login {
input: this.text().to_string(),
info: UserSessInfo::extract(
&usernames_box, &username_entry, &sessions_box, &session_entry
),
})
} I have an error:
Thourgh trial-and-error I've managed to fix (?) it by making these references with connect_activate[
sender, &usernames_box, &username_entry, &sessions_box, &session_entry
] => move |this| { However, now it errors on
I've asked the same question in gtk-rs repo, and they say it's probably related to my relm4 usage, rather than gtk-rs breakage. The migration guide, changelog, changes in examples between |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
I think in 0.5 template children accidentally "tainted" the scope of the entire view macro (because they were globally available, which made it impossible to refer to the children when using the same template twice). Now you should be able to access it like you would do in regular Rust: In you case, that would mean something like this: connect_activate[
sender, usernames_box = ui.usernames_box.clone(), username_entry, sessions_box, session_entry
] |
Beta Was this translation helpful? Give feedback.
I think in 0.5 template children accidentally "tainted" the scope of the entire view macro (because they were globally available, which made it impossible to refer to the children when using the same template twice). Now you should be able to access it like you would do in regular Rust:
parent.child_name
.In you case, that would mean something like this: