-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathframe.go
41 lines (33 loc) · 886 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
41
package impress
import (
"image"
"github.com/codeation/impress/driver"
)
// Frame represents a GUI frame.
type Frame struct {
framer driver.Framer
}
// NewFrame creates a new inner frame with the specified size.
func (app *Application) NewFrame(rect image.Rectangle) *Frame {
return app.frame.NewFrame(rect)
}
// NewFrame creates a new child frame with the specified size.
func (f *Frame) NewFrame(rect image.Rectangle) *Frame {
return &Frame{
framer: f.framer.NewFrame(rect),
}
}
// Drop deletes the frame.
// Note that a dropped frame can no longer be used.
func (f *Frame) Drop() {
f.framer.Drop()
f.framer = nil // TODO: Add notice when the frame is dropped.
}
// Size changes the 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()
}