-
-
Notifications
You must be signed in to change notification settings - Fork 369
Home
Maxence Charriere edited this page Nov 26, 2016
·
37 revisions
Package to build multiplatform apps with Go, HTML and CSS.
Murlok is built on these 2 notions: contexts and components.
Contexts are app parts that contains graphic elements. Can be windows, menus, dock, etc... They implement the interface app.Contexter that defines their available operations.
type Contexter interface {
// Mounts the component and renders it in the context.
Mount(c Componer)
// If applicable, returns the position of the context.
Position() (x float64, y float64)
// If applicable, moves the context.
Move(x float64, y float64)
// If applicable, returns the size of the context.
Size() (width float64, height float64)
// If applicable, resizes the context.
Resize(width float64, height float64)
// If applicable, set the icon targeted by path.
SetIcon(path string)
// If applicable, set the badge with v.
SetBadge(v interface{})
// If applicable, closes the context.
Close()
// ...
}
Components are what you write to build graphic elements. It is a Go stucture that satisfy the app.Componer interface. It embeds HTML markup to describes a graphic element. It can also contains other components, and defines the view logic.
type Componer interface {
Render() string
}
To be completed.