Struct cacao::view::SplitViewController
source · [−]pub struct SplitViewController<Sidebar, Content, Details> {
pub objc: ShareId<Object>,
pub sidebar: SplitViewItem<Sidebar>,
pub content: SplitViewItem<Content>,
pub details: Option<SplitViewItem<Details>>,
}
Expand description
A SplitViewController manages two or more view controllers in a split-pane view.
You typically use this controller as a content view controller for a Window
. With it, you can
build interfaces like those found in Mail.app or Xcode. Dividers can be configured to save
their positions so that users can adjust them as they please.
Note that the third pane is optional; you can opt to leave it None
, in which case there’s no
allocation there, or you can set a placeholder and use it as a details pane.
A note on property names: the Cocoa(Touch) controllers tend to view these as:
|sidebar|details|content|
This pattern fits things such as a the aforementioned apps (e.g, Mail). Cacao takes the position that most apps really end up doing the following, though:
|sidebar|content|details|
where details may or may not be visible (e.g, chat applications often work this way).
Fields
objc: ShareId<Object>
A reference to the underlying Objective-C split view controller.
A reference to the sidebar SplitViewItem
.
content: SplitViewItem<Content>
A reference to the content SplitViewItem
.
details: Option<SplitViewItem<Details>>
An optional reference to the details SplitViewItem
, if set.
Implementations
sourceimpl<Sidebar, Content, Details> SplitViewController<Sidebar, Content, Details> where
Sidebar: ViewDelegate + 'static,
Content: ViewDelegate + 'static,
Details: ViewDelegate + 'static,
impl<Sidebar, Content, Details> SplitViewController<Sidebar, Content, Details> where
Sidebar: ViewDelegate + 'static,
Content: ViewDelegate + 'static,
Details: ViewDelegate + 'static,
sourceimpl<Sidebar, Content, Details> SplitViewController<Sidebar, Content, Details>
impl<Sidebar, Content, Details> SplitViewController<Sidebar, Content, Details>
Toggles the sidebar, if it exists, with an animation. If there’s no sidebar in this split view (which is highly unlikely, unless you went out of your way to duck this) then it will do nothing.
sourcepub fn set_autosave_name(&self, name: &str)
pub fn set_autosave_name(&self, name: &str)
Sets the autosave name for the underlying SplitView
.
Setting this name causes the system to persist separator locations to a defaults database, and the position(s) will be restored upon the user reopening the application.
Trait Implementations
sourceimpl<Sidebar, Content, Details> Controller for SplitViewController<Sidebar, Content, Details>
impl<Sidebar, Content, Details> Controller for SplitViewController<Sidebar, Content, Details>
sourcefn get_backing_node(&self) -> ShareId<Object>
fn get_backing_node(&self) -> ShareId<Object>
Returns the underlying Objective-C object.
Auto Trait Implementations
impl<Sidebar, Content, Details> !RefUnwindSafe for SplitViewController<Sidebar, Content, Details>
impl<Sidebar, Content, Details> !Send for SplitViewController<Sidebar, Content, Details>
impl<Sidebar, Content, Details> !Sync for SplitViewController<Sidebar, Content, Details>
impl<Sidebar, Content, Details> Unpin for SplitViewController<Sidebar, Content, Details>
impl<Sidebar, Content, Details> !UnwindSafe for SplitViewController<Sidebar, Content, Details>
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more