MCPcopy Create free account
hub / github.com/andlabs/ui / InsertAt

Method InsertAt

tab.go:49–63  ·  view source on GitHub ↗

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)

Source from the content-addressed store, hash-verified

47// InsertAt adds the given page to the Tab such that it is the
48// nth page of the Tab (starting at 0).
49func (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.
66func (t *Tab) Delete(n int) {

Callers 1

AppendMethod · 0.95

Calls 3

touiControlFunction · 0.85
freestrFunction · 0.85
LibuiControlMethod · 0.65

Tested by

no test coverage detected