Partially implement new stuff for X

This commit is contained in:
Sasha Koshka 2024-06-11 23:45:40 -04:00
parent c7f09c7894
commit 1951b6e408
2 changed files with 20 additions and 0 deletions

View File

@ -126,6 +126,14 @@ func (this *Backend) NewCanvas (bounds image.Rectangle) canvas.CanvasCloser {
return xcanvas.NewCanvas(this.x, bounds)
}
func (this *Backend) SetStyle (style tomo.Style) {
this.system.SetStyle(style)
}
func (this *Backend) SetIcons (icons tomo.Icons) {
this.system.SetIcons(icons)
}
func (this *Backend) assert () {
if this == nil { panic("x: nil backend") }
}

View File

@ -215,6 +215,17 @@ func (this *window) SetIcon (sizes ...canvas.Texture) {
wmIcons)
}
func (this *window) SetResizable (x, y bool) {
// TODO
}
func (this *window) SetBounds (bounds image.Rectangle) {
this.xWindow.WMMoveResize (
bounds.Min.X, bounds.Min.Y,
bounds.Min.X + bounds.Dx(),
bounds.Min.Y + bounds.Dy())
}
func (this *window) NewMenu (bounds image.Rectangle) (tomo.Window, error) {
menu, err := this.backend.newWindow (
bounds.Add(this.metrics.bounds.Min), true)
@ -309,6 +320,7 @@ func (this *window) Close () {
this.SetRoot(nil)
delete(this.backend.windows, this.xWindow.Id)
this.xWindow.Destroy()
this.hierarchy.Close()
}
func (this *window) OnClose (callback func ()) event.Cookie {