Skip to content

Use glib's clone! macro inside the view! macro. #160

Answered by edfloreshz
edfloreshz asked this question in Q&A
Discussion options

You must be logged in to vote

Just found a way!

connect_clicked: clone!(@weak new_list_entry, @strong sender => move |_| {
    let buffer = new_list_entry.buffer();
    if !buffer.text().is_empty() {
        send!(sender, SidebarMsg::AddList(buffer.text()))
    }
})

Replies: 1 comment

Comment options

edfloreshz
Apr 8, 2022
Maintainer Author

You must be logged in to vote
0 replies
Answer selected by AaronErhardt
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
1 participant