-
-
Notifications
You must be signed in to change notification settings - Fork 79
Open
Description
I have the following code:
#[widget]
impl Widget for MyWidget {
// ...
view! {
gtk::Box {
orientation: Orientation::Horizontal,
spacing: 10,
// ...
gtk::ToolButton {
hexpand: false,
clicked => Msg::Delete,
icon_widget: view! {
gtk::Image {
icon_name: Some("edit-delete"),
icon_size: IconSize::Button
}
}
}
}
}
}At runtime, the entire widget is not rendered, and instead I see this message on the terminal:
(myapp:104508): Gtk-WARNING **: 19:28:54.676: Attempting to add a widget with type GtkImage to a container of type GtkBox, but the widget is already inside a container of type GtkButton, please remove the widget from its existing container first.
The macro outputs the following code, which I believe is wrong:
impl Widget for MyWidget {
// ...
type Root = gtk::Image;
fn root(&self) -> Self::Root {
self.widgets.gtkimage1.clone()
}
}The widget is added inside a gtk::Box in another widget, but what I believe is happening is that only the image in the inner view! macro is being added, instead of the outer view! macro.
Metadata
Metadata
Assignees
Labels
No labels