Partially implement new stuff for X
This commit is contained in:
parent
c7f09c7894
commit
1951b6e408
@ -126,6 +126,14 @@ func (this *Backend) NewCanvas (bounds image.Rectangle) canvas.CanvasCloser {
|
|||||||
return xcanvas.NewCanvas(this.x, bounds)
|
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 () {
|
func (this *Backend) assert () {
|
||||||
if this == nil { panic("x: nil backend") }
|
if this == nil { panic("x: nil backend") }
|
||||||
}
|
}
|
||||||
|
12
x/window.go
12
x/window.go
@ -215,6 +215,17 @@ func (this *window) SetIcon (sizes ...canvas.Texture) {
|
|||||||
wmIcons)
|
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) {
|
func (this *window) NewMenu (bounds image.Rectangle) (tomo.Window, error) {
|
||||||
menu, err := this.backend.newWindow (
|
menu, err := this.backend.newWindow (
|
||||||
bounds.Add(this.metrics.bounds.Min), true)
|
bounds.Add(this.metrics.bounds.Min), true)
|
||||||
@ -309,6 +320,7 @@ func (this *window) Close () {
|
|||||||
this.SetRoot(nil)
|
this.SetRoot(nil)
|
||||||
delete(this.backend.windows, this.xWindow.Id)
|
delete(this.backend.windows, this.xWindow.Id)
|
||||||
this.xWindow.Destroy()
|
this.xWindow.Destroy()
|
||||||
|
this.hierarchy.Close()
|
||||||
}
|
}
|
||||||
|
|
||||||
func (this *window) OnClose (callback func ()) event.Cookie {
|
func (this *window) OnClose (callback func ()) event.Cookie {
|
||||||
|
Loading…
Reference in New Issue
Block a user