uiterm: remove *Ui argument from View methods

This commit is contained in:
Tim Cooper
2014-12-06 21:55:33 -04:00
parent dc4b3a3662
commit 9b0214d112
6 changed files with 60 additions and 36 deletions
+10 -5
View File
@@ -11,20 +11,25 @@ type Label struct {
Fg Attribute
Bg Attribute
ui *Ui
x0, y0, x1, y1 int
}
func (l *Label) setActive(ui *Ui, active bool) {
func (l *Label) uiInitialize(ui *Ui) {
l.ui = ui
}
func (l *Label) setBounds(ui *Ui, x0, y0, x1, y1 int) {
func (l *Label) setActive(active bool) {
}
func (l *Label) setBounds(x0, y0, x1, y1 int) {
l.x0 = x0
l.y0 = y0
l.x1 = x1
l.y1 = y1
}
func (l *Label) draw(ui *Ui) {
func (l *Label) draw() {
reader := strings.NewReader(l.Text)
for y := l.y0; y < l.y1; y++ {
for x := l.x0; x < l.x1; x++ {
@@ -39,8 +44,8 @@ func (l *Label) draw(ui *Ui) {
}
}
func (l *Label) keyEvent(ui *Ui, mod Modifier, key Key) {
func (l *Label) keyEvent(mod Modifier, key Key) {
}
func (l *Label) characterEvent(ui *Ui, chr rune) {
func (l *Label) characterEvent(chr rune) {
}