Added the ability to make different window types

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

View File

@ -21,9 +21,9 @@ type Backend interface {
Do (callback func ()) Do (callback func ())
// NewWindow creates a new window with the specified width and height, // NewWindow creates a new window with the specified width and height,
// and returns a struct representing it that fulfills the Window // and returns a struct representing it that fulfills the MainWindow
// interface. // interface.
NewWindow (width, height int) (window elements.Window, err error) NewWindow (width, height int) (window elements.MainWindow, err error)
// Copy puts data into the clipboard. // Copy puts data into the clipboard.
Copy (data.Data) Copy (data.Data)

View File

@ -14,6 +14,7 @@ import "git.tebibyte.media/sashakoshka/tomo/canvas"
import "git.tebibyte.media/sashakoshka/tomo/elements" import "git.tebibyte.media/sashakoshka/tomo/elements"
// import "runtime/debug" // import "runtime/debug"
type mainWindow struct { *window }
type window struct { type window struct {
backend *Backend backend *Backend
xWindow *xwindow.Window xWindow *xwindow.Window