use gtk::{prelude::BoxExt, Box, Label, Orientation, TextView};
use std::sync::Arc;
const MARGIN: i32 = 6;
const SPACING: i32 = 8;
pub struct Widget {
gobject: Box,
}
impl Widget {
pub fn new_arc(title: &Label, response: &TextView, control: &Box) -> Arc<Self> {
let gobject = Box::builder()
.margin_bottom(MARGIN)
.margin_end(MARGIN)
.margin_start(MARGIN)
.margin_top(MARGIN)
.spacing(SPACING)
.orientation(Orientation::Vertical)
.build();
gobject.append(title);
gobject.append(response);
gobject.append(control);
Arc::new(Self { gobject })
}
pub fn gobject(&self) -> &Box {
&self.gobject
}
}