Compare commits

...

4 Commits

2 changed files with 17 additions and 10 deletions

View File

@@ -155,6 +155,7 @@ type ContentBox interface {
ContentBounds () image.Rectangle
ScrollTo (image.Point)
OnContentBoundsChange (func ()) event.Cookie
SetAlign (x, y Align)
}
// TextBox is a box that contains text content.
@@ -164,22 +165,22 @@ type TextBox interface {
SetText (string)
SetTextColor (color.Color)
SetFace (font.Face)
SetHAlign (Align)
SetVAlign (Align)
SetWrap (bool)
}
// ContentBox is a box that can contain child objects. It arranges them
// according to a layout rule.
type ContainerBox interface {
ContentBox
SetGap (image.Point)
Add (Object)
Delete (Object)
Insert (child Object, before Object)
Clear ()
Length () int
At (int) Object
SetLayout (Layout)
PropagateEvents (bool)
SetGap (image.Point)
Add (Object)
Delete (Object)
Insert (child Object, before Object)
Clear ()
Length () int
At (int) Object
SetLayout (Layout)
}
// LayoutHints are passed to a layout to tell it how to arrange child boxes.
@@ -187,6 +188,8 @@ type LayoutHints struct {
Bounds image.Rectangle
OverflowX bool
OverflowY bool
AlignX Align
AlignY Align
Gap image.Point
}

View File

@@ -35,6 +35,10 @@ func Stop () {
backend = nil
}
func Do (callback func ()) {
backend.Do(callback)
}
func NewWindow (bounds image.Rectangle) (MainWindow, error) {
assertBackend()
return backend.NewWindow(bounds)