MCPcopy Create free account
hub / github.com/cogentcore/core / Init

Method Init

texteditor/diffbrowser/browser.go:29–52  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

27}
28
29func (br *Browser) Init() {
30 br.Frame.Init()
31 br.Styler(func(s *styles.Style) {
32 s.Grow.Set(1, 1)
33 })
34 br.OnShow(func(e events.Event) {
35 br.OpenFiles()
36 })
37
38 tree.AddChildAt(br, "splits", func(w *core.Splits) {
39 w.SetSplits(.15, .85)
40 tree.AddChildAt(w, "treeframe", func(w *core.Frame) {
41 w.Styler(func(s *styles.Style) {
42 s.Direction = styles.Column
43 s.Overflow.Set(styles.OverflowAuto)
44 s.Grow.Set(1, 1)
45 })
46 tree.AddChildAt(w, "tree", func(w *Node) {})
47 })
48 tree.AddChildAt(w, "tabs", func(w *core.Tabs) {
49 w.Type = core.FunctionalTabs
50 })
51 })
52}
53
54// NewBrowserWindow opens a new diff Browser in a new window
55func NewBrowserWindow() (*Browser, *core.Body) {

Callers

nothing calls this directly

Calls 7

OpenFilesMethod · 0.95
AddChildAtFunction · 0.92
StylerMethod · 0.80
OnShowMethod · 0.80
SetSplitsMethod · 0.80
InitMethod · 0.65
SetMethod · 0.65

Tested by

no test coverage detected