Documentation
¶
Overview ¶
Package docking provides an embeddable docking workspace for MyGo native UI.
Panels are ordinary Go views, so applications can put them in independent packages and register only the ones they need. A Workspace belongs to one MyGo view and must be used on that view's main thread.
Index ¶
- type Location
- type Panel
- type Workspace
- func (w *Workspace) AttachWindow(window *mygo.Window) error
- func (w *Workspace) AutoHidden(id string) bool
- func (w *Workspace) Close(id string) error
- func (w *Workspace) Dock(id string, edge Location) error
- func (w *Workspace) Float(id string) error
- func (w *Workspace) LocationOf(id string) (Location, bool)
- func (w *Workspace) Register(p Panel, at Location) error
- func (w *Workspace) SetAutoHide(id string, enabled bool) error
- func (w *Workspace) Show(id string) error
- func (w *Workspace) View(c *ui.Context, central func(*ui.Context))
- func (w *Workspace) Visible(id string) bool
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Panel ¶
Panel describes an independently supplied view. Its ID must be unique and stable within a workspace. Content is called in the current MyGo build pass. State which must survive docking belongs to the provider, not ui.Element.
type Workspace ¶
type Workspace struct {
// contains filtered or unexported fields
}
Workspace manages panels in one view. Its zero value is ready to use. A Workspace should not be used simultaneously in multiple windows.
func (*Workspace) AttachWindow ¶
AttachWindow connects the workspace to its owning window. Call it on the main thread after creating the window and before floating a panel. Its independent child windows close with the owner.
func (*Workspace) AutoHidden ¶
AutoHidden reports whether a panel is assigned to an auto-hide rail.
func (*Workspace) Float ¶
Float shows a registered panel in an independent child window. AttachWindow must be called before opening an independent window.
func (*Workspace) LocationOf ¶
LocationOf returns the panel's last location, including when it is closed.
func (*Workspace) Register ¶
Register adds a panel at its initial location. A panel's ID and content are required; attempting to register the same ID twice returns an error.
func (*Workspace) SetAutoHide ¶
SetAutoHide moves a docked panel to or from its edge's auto-hide rail. Closing and showing a panel preserves this setting. Floating panels must be docked before they can be auto-hidden.
Directories
¶
| Path | Synopsis |
|---|---|
|
cmd
|
|
|
demo
command
|
|
|
examples
|
|
|
demopanels
Package demopanels is an example of panels supplied by another Go package.
|
Package demopanels is an example of panels supplied by another Go package. |
|
minimal
command
Package main demonstrates embedding a workspace with one independent panel.
|
Package main demonstrates embedding a workspace with one independent panel. |