unsafe fn allowed_types_accessory_view(allowed_types: &[crate::FileSpec]) -> id {
    // Build the View Structure required to have file format popup.
    // This requires a container view, a label, a popup button,
    // and some layout code to make sure it behaves correctly for
    // fixed size and resizable views
    let total_frame = NSRect::new(
        NSPoint { x: 0.0, y: 0.0 },
        NSSize {
            width: 320.0,
            height: 30.0,
        },
    );

    let padding = 10.0;

    // Prepare the label
    let (label, label_size) = file_format_label();

    // Place the label centered (similar to the popup button)
    label.setFrameOrigin(NSPoint {
        x: padding,
        y: label_size.height / 2.0,
    });

    // Prepare the popup button
    let popup_frame = NSRect::new(
        NSPoint {
            x: padding + label_size.width + padding,
            y: 0.0,
        },
        NSSize {
            width: total_frame.size.width - (padding * 3.0) - label_size.width,
            height: total_frame.size.height,
        },
    );

    let popup_button = file_format_popup_button(allowed_types, popup_frame);

    // Prepare the container
    let container_view: id = msg_send![class!(NSView), alloc];
    let container_view: id = container_view.initWithFrame_(total_frame);

    container_view.addSubview_(label);
    container_view.addSubview_(popup_button);

    container_view.autorelease()
}
// AppKit has a built-in file format accessory view. However, this is only
// displayed for `NSDocument` based apps. We have to construct our own `NSView`
// hierachy to implement something similar.
AppKit has a built-in file format accessory view. However, this is only
displayed for `NSDocument` based apps. We have to construct our own `NSView`
hierachy to implement something similar.
AppKit has a built - in file format accessory view . However this is only displayed for ` NSDocument ` based apps . We have to construct our own ` NSView ` hierachy to implement something similar .
unsafe fn allowed_types_accessory_view(allowed_types: &[crate::FileSpec]) -> id {
    // Build the View Structure required to have file format popup.
    // This requires a container view, a label, a popup button,
    // and some layout code to make sure it behaves correctly for
    // fixed size and resizable views
    let total_frame = NSRect::new(
        NSPoint { x: 0.0, y: 0.0 },
        NSSize {
            width: 320.0,
            height: 30.0,
        },
    );
    let padding = 10.0;
    // Prepare the label
    let (label, label_size) = file_format_label();
    // Place the label centered (similar to the popup button)
    label.setFrameOrigin(NSPoint {
        x: padding,
        y: label_size.height / 2.0,
    });
    // Prepare the popup button
    let popup_frame = NSRect::new(
        NSPoint {
            x: padding + label_size.width + padding,
            y: 0.0,
        },
        NSSize {
            width: total_frame.size.width - (padding * 3.0) - label_size.width,
            height: total_frame.size.height,
        },
    );
    let popup_button = file_format_popup_button(allowed_types, popup_frame);
    // Prepare the container
    let container_view: id = msg_send![class!(NSView), alloc];
    let container_view: id = container_view.initWithFrame_(total_frame);
    container_view.addSubview_(label);
    container_view.addSubview_(popup_button);
    container_view.autorelease()
}
unsafe fn allowed_types_accessory_view ( allowed_types : & [ crate :: FileSpec ] ) -> id { // Build the View Structure required to have file format popup. // This requires a container view, a label, a popup button, // and some layout code to make sure it behaves correctly for // fixed size and resizable views let total_frame = NSRect :: new ( NSPoint { x : 0.0 , y : 0.0 } , NSSize { width : 320.0 , height : 30.0 , } , ) ; let padding = 10.0 ; // Prepare the label let ( label , label_size ) = file_format_label ( ) ; // Place the label centered (similar to the popup button) label . setFrameOrigin ( NSPoint { x : padding , y : label_size . height / 2.0 , } ) ; // Prepare the popup button let popup_frame = NSRect :: new ( NSPoint { x : padding + label_size . width + padding , y : 0.0 , } , NSSize { width : total_frame . size . width - ( padding * 3.0 ) - label_size . width , height : total_frame . size . height , } , ) ; let popup_button = file_format_popup_button ( allowed_types , popup_frame ) ; // Prepare the container let container_view : id = msg_send ! [ class ( NSView ) alloc ] ; let container_view : id = container_view . initWithFrame_ ( total_frame ) ; container_view . addSubview_ ( label ) ; container_view . addSubview_ ( popup_button ) ; container_view . autorelease ( ) }
AppKit has a built-in file format accessory view.
AppKit has a built - in file format accessory view .
allowed_types
&[crate::FileSpec]
allowed_types
&[crate::FileSpec]