Skip to content

Instantly share code, notes, and snippets.

@hoffoo
Created August 12, 2014 19:35
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save hoffoo/47e690b92ee43d0eafd6 to your computer and use it in GitHub Desktop.
Save hoffoo/47e690b92ee43d0eafd6 to your computer and use it in GitHub Desktop.
package main
// our first concern is to keep a good state of all the objects in the ui
// to do it quickly we need to control how objects are inserted, moved, and resized
type Monitor struct {
size_x int
size_y int
widgets []Widget
}
type Widget [4]int
func NewMonitor(size_x, size_y int) {
}
func NewWidget(m *Monitor, x, y, size_x, size_y int) {
}
func insert(w *Widget, x, y int) {
}
func remove(w *Widget) {
}
func reinsert(w *Widget, x, y int) {
remove(w)
insert(w, x, y)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment