{"record":{"id":"b099bc53bbdee510","repo":"elkowar/eww","slug":"error-trying-to-add-multiple-children-to-a-circul","errorCode":null,"errorMessage":"Error, trying to add multiple children to a circular-progress widget","messagePattern":"Error, trying to add multiple children to a circular-progress widget","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"crates/eww/src/widgets/circular_progressbar.rs","lineNumber":101,"sourceCode":"}\n\nimpl Default for CircProg {\n    fn default() -> Self {\n        Self::new()\n    }\n}\n\nimpl CircProg {\n    pub fn new() -> Self {\n        glib::Object::new::<Self>()\n    }\n}\n\nimpl ContainerImpl for CircProgPriv {\n    fn add(&self, widget: &gtk::Widget) {\n        if let Some(content) = &*self.content.borrow() {\n            // TODO: Handle this error when populating children widgets instead\n            error_handling_ctx::print_error(anyhow!(\"Error, trying to add multiple children to a circular-progress widget\"));\n            self.parent_remove(content);\n        }\n        self.parent_add(widget);\n        self.content.replace(Some(widget.clone()));\n    }\n}\n\nfn calc_widget_lowest_preferred_dimension(widget: &gtk::Widget) -> (i32, i32) {\n    let preferred_width = widget.preferred_width();\n    let preferred_height = widget.preferred_height();\n    let min_lowest = i32::min(preferred_width.0, preferred_height.0);\n    let natural_lowest = i32::min(preferred_width.1, preferred_height.1);\n    (min_lowest, natural_lowest)\n}\n\nimpl BinImpl for CircProgPriv {}\n\nimpl WidgetImpl for CircProgPriv {","sourceCodeStart":83,"sourceCodeEnd":119,"githubUrl":"https://github.com/elkowar/eww/blob/48f5aa8b379adf29da0b0bb9ca04164f65d8bdaa/crates/eww/src/widgets/circular_progressbar.rs#L83-L119","documentation":"Circular-progress is a GTK container subclass that accepts at most one child (the content widget). Its ContainerImpl::add checks whether content is already set; if so, it prints this error and removes the previous child rather than stacking widgets.","triggerScenarios":"The widget definition for a circular-progress contains two or more child widgets, so populate_widget_children calls add() a second time on the same instance.","commonSituations":"Accidentally leaving two children in the circular-progress element in yuck; a custom widget expansion that injects an extra child; refactoring a box into circular-progress without removing extra children.","solutions":["Keep exactly one child inside the circular-progress widget in your config","Wrap multiple children in a `box` if you need a composite layout inside (though circular-progress expects a single content child)","Check custom widget definitions that might add extra children"],"exampleFix":"; before\n(circular-progress\n  (label :text \"a\")\n  (label :text \"b\"))\n\n; after\n(circular-progress\n  (box :orientation \"v\"\n    (label :text \"a\")\n    (label :text \"b\")))","handlingStrategy":"validation","validationCode":"// ensure a single child before population\nif children.len() > 1 {\n    return Err(anyhow!(\"circular-progress accepts exactly one child\"));\n}","typeGuard":null,"tryCatchPattern":"// treat as non-fatal: handler already prints and removes the old child\n// ensure your config doesn't rely on multi-child behavior","preventionTips":["Give circular-progress exactly one child","Wrap composite layouts in a box inside the widget","Audit custom widgets that expand into circular-progress"],"tags":["eww","gtk","widget","children"],"backgroundTag":"invalid-argument-value","analyzedSha":"48f5aa8b379adf29da0b0bb9ca04164f65d8bdaa","analyzedAt":"2026-09-08T03:13:26.897Z","contentChangedAt":"2026-09-08T03:13:26.897Z","schemaVersion":2},"datasetVersion":"2026-09-16T09:17:16.951Z"}