Added the ability to make different window types

This commit is contained in:
2023-03-24 00:34:25 -04:00
parent fff5ad4d96
commit d710d13f0d
3 changed files with 52 additions and 3 deletions

View File

@@ -25,6 +25,9 @@ type Window interface {
// for some backends.
SetIcon (sizes []image.Image)
// NewModal creates a new modal dialog window.
NewModal (width, height int) (window Window, err error)
// Show shows the window. The window starts off hidden, so this must be
// called after initial setup to make sure it is visible.
Show ()
@@ -38,3 +41,13 @@ type Window interface {
// OnClose specifies a function to be called when the window is closed.
OnClose (func ())
}
// MainWindow is a window capable of owning multiple sub-windows.
type MainWindow interface {
Window
// NewPanel creates a panel window that is semantically tied to this
// window. This is intended to be used for utility windows, tool bars,
// torn-off menus, etc.
NewPanel (width, height int) (window Window, err error)
}