unsafe fn pin_to_parent(parent_id: id, child_id: id) {
    let _: () = msg_send![child_id, setTranslatesAutoresizingMaskIntoConstraints: NO];

    let mut constraints: Vec<id> = vec![];

    {
        let parent_anchor: id = msg_send![parent_id, leftAnchor];
        let target_anchor: id = msg_send![child_id, leftAnchor];
        let constraint: id =
            msg_send![parent_anchor, constraintEqualToAnchor: target_anchor constant: 0.0];
        constraints.push(constraint)
    }
    {
        let parent_anchor: id = msg_send![parent_id, rightAnchor];
        let target_anchor: id = msg_send![child_id, rightAnchor];
        let constraint: id =
            msg_send![parent_anchor, constraintEqualToAnchor: target_anchor constant: 0.0];
        constraints.push(constraint)
    }
    {
        let parent_anchor: id = msg_send![parent_id, topAnchor];
        let target_anchor: id = msg_send![child_id, topAnchor];
        let constraint: id =
            msg_send![parent_anchor, constraintEqualToAnchor: target_anchor constant: 0.0];
        constraints.push(constraint)
    }
    {
        let parent_anchor: id = msg_send![parent_id, bottomAnchor];
        let target_anchor: id = msg_send![child_id, bottomAnchor];
        let constraint: id =
            msg_send![parent_anchor, constraintEqualToAnchor: target_anchor constant: 0.0];
        constraints.push(constraint)
    }

    let bundle = NSArray::arrayWithObjects(nil, &constraints);
    NSLayoutConstraint::activateConstraints(nil, bundle);
}
/// Pin one NSView to a parent NSView so it'll resize to fit it
Pin one NSView to a parent NSView so it'll resize to fit it
Pin one NSView to a parent NSView so it ' ll resize to fit it
unsafe fn pin_to_parent(parent_id: id, child_id: id) {
    let _: () = msg_send![child_id, setTranslatesAutoresizingMaskIntoConstraints: NO];
    let mut constraints: Vec<id> = vec![];
    {
        let parent_anchor: id = msg_send![parent_id, leftAnchor];
        let target_anchor: id = msg_send![child_id, leftAnchor];
        let constraint: id =
            msg_send![parent_anchor, constraintEqualToAnchor: target_anchor constant: 0.0];
        constraints.push(constraint)
    }
    {
        let parent_anchor: id = msg_send![parent_id, rightAnchor];
        let target_anchor: id = msg_send![child_id, rightAnchor];
        let constraint: id =
            msg_send![parent_anchor, constraintEqualToAnchor: target_anchor constant: 0.0];
        constraints.push(constraint)
    }
    {
        let parent_anchor: id = msg_send![parent_id, topAnchor];
        let target_anchor: id = msg_send![child_id, topAnchor];
        let constraint: id =
            msg_send![parent_anchor, constraintEqualToAnchor: target_anchor constant: 0.0];
        constraints.push(constraint)
    }
    {
        let parent_anchor: id = msg_send![parent_id, bottomAnchor];
        let target_anchor: id = msg_send![child_id, bottomAnchor];
        let constraint: id =
            msg_send![parent_anchor, constraintEqualToAnchor: target_anchor constant: 0.0];
        constraints.push(constraint)
    }
    let bundle = NSArray::arrayWithObjects(nil, &constraints);
    NSLayoutConstraint::activateConstraints(nil, bundle);
}
unsafe fn pin_to_parent ( parent_id : id , child_id : id ) { let _ : ( ) = msg_send ! [ child_id setTranslatesAutoresizingMaskIntoConstraints NO ] ; let mut constraints : Vec < id > = vec ! [ ] ; { let parent_anchor : id = msg_send ! [ parent_id leftAnchor ] ; let target_anchor : id = msg_send ! [ child_id leftAnchor ] ; let constraint : id = msg_send ! [ parent_anchor constraintEqualToAnchor target_anchor constant 0.0 ] ; constraints . push ( constraint ) } { let parent_anchor : id = msg_send ! [ parent_id rightAnchor ] ; let target_anchor : id = msg_send ! [ child_id rightAnchor ] ; let constraint : id = msg_send ! [ parent_anchor constraintEqualToAnchor target_anchor constant 0.0 ] ; constraints . push ( constraint ) } { let parent_anchor : id = msg_send ! [ parent_id topAnchor ] ; let target_anchor : id = msg_send ! [ child_id topAnchor ] ; let constraint : id = msg_send ! [ parent_anchor constraintEqualToAnchor target_anchor constant 0.0 ] ; constraints . push ( constraint ) } { let parent_anchor : id = msg_send ! [ parent_id bottomAnchor ] ; let target_anchor : id = msg_send ! [ child_id bottomAnchor ] ; let constraint : id = msg_send ! [ parent_anchor constraintEqualToAnchor target_anchor constant 0.0 ] ; constraints . push ( constraint ) } let bundle = NSArray :: arrayWithObjects ( nil , & constraints ) ; NSLayoutConstraint :: activateConstraints ( nil , bundle ) ; }
Pin one NSView to a parent NSView so it'll resize to fit it
Pin one NSView to a parent NSView so it ' ll resize to fit it
parent_id
id
child_id
id
parent_id
id
child_id
id