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§
Source§impl<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,
Source§impl<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.