diff options
Diffstat (limited to 'place.go')
| -rw-r--r-- | place.go | 46 |
1 files changed, 23 insertions, 23 deletions
@@ -8,6 +8,29 @@ import ( "go.wit.com/widget" ) +/* + gocui defines the offset like this: + + width -> increases to the right + ---------------------------------- hieght + | H = 1 | increases + | | | + | W = 1 W = 18 | | + | | v + | H = 5 | downwards + ------------------------------------- +*/ + +// moves the gocui view to the W and H offset on the screen +func (tk *guiWidget) MoveToOffset(W, H int) { + tk.gocuiSetWH(W, H) +} + +// returns where the corner of widget starts (upper left) +func (tk *guiWidget) Position() (int, int) { + return tk.gocuiSize.w0, tk.gocuiSize.h0 +} + func (w *guiWidget) placeBox(startW int, startH int) { if w.WidgetType != widget.Box { return @@ -215,29 +238,6 @@ func textSize(n *tree.Node) (int, int) { return width, height } -// moves the gocui view the W and H offset on the screen -/* - gocui defines the offset like this: - - width -> increases to the right - ---------------------------------- hieght - | H = 1 | increases - | | | - | W = 1 W = 18 | | - | | v - | H = 5 | downwards - ------------------------------------- -*/ -// change over to this name -func (tk *guiWidget) MoveToOffset(W, H int) { - tk.gocuiSetWH(W, H) -} - -// returns where the corner of widget starts (upper left) -func (tk *guiWidget) Position() (int, int) { - return tk.gocuiSize.w0, tk.gocuiSize.h0 -} - func (tk *guiWidget) gocuiSetWH(sizeW, sizeH int) { w := len(widget.GetString(tk.value)) lines := strings.Split(widget.GetString(tk.value), "\n") |
