Created
August 12, 2014 19:35
-
-
Save hoffoo/47e690b92ee43d0eafd6 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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