-
Notifications
You must be signed in to change notification settings - Fork 0
/
frame.go
40 lines (32 loc) · 825 Bytes
/
frame.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
package impress
import (
"image"
"github.com/codeation/impress/driver"
)
type Frame struct {
framer driver.Framer
}
// NewFrame create new inner frame with a specified size
func (app *Application) NewFrame(rect image.Rectangle) *Frame {
return app.frame.NewFrame(rect)
}
// NewFrame create new child frame with a specified size
func (f *Frame) NewFrame(rect image.Rectangle) *Frame {
return &Frame{
framer: f.framer.NewFrame(rect),
}
}
// Drop deletes frame.
// Note that a dropped frame can no longer be used
func (f *Frame) Drop() {
f.framer.Drop()
f.framer = nil // TODO notice when the window is dropped
}
// Size changes frame size and position
func (f *Frame) Size(rect image.Rectangle) {
f.framer.Size(rect)
}
// Raise brings the frame to the forefront
func (f *Frame) Raise() {
f.framer.Raise()
}