InsertAt adds the given page to the Tab such that it is the nth page of the Tab (starting at 0).
(name string, n int, child Control)
| 47 | // InsertAt adds the given page to the Tab such that it is the |
| 48 | // nth page of the Tab (starting at 0). |
| 49 | func (t *Tab) InsertAt(name string, n int, child Control) { |
| 50 | c := (*C.uiControl)(nil) |
| 51 | if child != nil { |
| 52 | c = touiControl(child.LibuiControl()) |
| 53 | } |
| 54 | cname := C.CString(name) |
| 55 | C.uiTabInsertAt(t.t, cname, C.int(n), c) |
| 56 | freestr(cname) |
| 57 | ch := make([]Control, len(t.children) + 1) |
| 58 | // and insert into t.children at the right place |
| 59 | copy(ch[:n], t.children[:n]) |
| 60 | ch[n] = child |
| 61 | copy(ch[n + 1:], t.children[n:]) |
| 62 | t.children = ch |
| 63 | } |
| 64 | |
| 65 | // Delete deletes the nth page of the Tab. |
| 66 | func (t *Tab) Delete(n int) { |
no test coverage detected