-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.go
61 lines (47 loc) · 1.44 KB
/
main.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
package main
import (
"EsClient2/store"
"EsClient2/tab"
"EsClient2/window"
"fmt"
"fyne.io/fyne"
"fyne.io/fyne/app"
"fyne.io/fyne/layout"
"fyne.io/fyne/widget"
)
func main() {
a := app.New()
mainW := window.MainW{}
mainW.MainWindow = a.NewWindow("ES Client")
config := store.NewStore()
mainW.Config = &config
mainW.MainWindow.Resize(fyne.NewSize(1000, 600))
mainW.MainWindow.SetMainMenu(fyne.NewMainMenu(
fyne.NewMenu("File",
fyne.NewMenuItem("Quit", func() { exit(a) }),
fyne.NewMenuItem("Settings", func() {})),
fyne.NewMenu("Edit")))
tabContainer, tabs := createContent()
mainW.Tabs = tabContainer
lConnections := tab.CreateConnList(&config, tabs, &mainW)
content := fyne.NewContainerWithLayout(layout.NewBorderLayout(nil, nil, lConnections, nil), lConnections, tabContainer)
mainW.MainWindow.SetContent(content)
mainW.MainWindow.ShowAndRun()
}
func makeSplitTab() fyne.CanvasObject {
left := widget.NewMultiLineEntry()
left.Wrapping = fyne.TextWrapWord
left.SetText("Long text is looooooooooooooong")
right := widget.NewVSplitContainer(
widget.NewLabel("Label"),
widget.NewButton("Button", func() { fmt.Println("button tapped!") }),
)
return widget.NewHSplitContainer(widget.NewVScrollContainer(left), right)
}
func createContent() (*fyne.Container, *widget.TabContainer) {
tabs := widget.NewTabContainer()
return fyne.NewContainerWithLayout(layout.NewMaxLayout(), tabs), tabs
}
func exit(app fyne.App) {
app.Quit()
}