File: console.go

package info (click to toggle)
mumax3 3.10-9
  • links: PTS, VCS
  • area: contrib
  • in suites: trixie
  • size: 7,596 kB
  • sloc: makefile: 181; ansic: 155; sh: 77
file content (17 lines) | stat: -rw-r--r-- 441 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
package gui

import "fmt"

type console struct {
	data
}

func (e *console) update(id string) []jsCall {
	return []jsCall{{F: "setConsoleText", Args: []interface{}{e.value()}}}
}

func (d *Page) Console(id string, rows, cols int, value interface{}, extra ...string) string {
	e := &console{data: data{value}}
	d.addElem(id, e)
	return fmt.Sprintf(`<textarea id=%v rows=%v cols=%v class=TextBox %v></textarea>`, id, rows, cols, cat(extra))
}