-
Notifications
You must be signed in to change notification settings - Fork 0
/
gohStartGtk.go
50 lines (44 loc) · 1.25 KB
/
gohStartGtk.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
// gohStartGtk.go
// Source file auto-generated on Sun, 14 Jul 2019 16:40:30 using Gotk3ObjHandler v1.3 ©2019 H.F.M
/*
This program comes with absolutely no warranty. See the The MIT License (MIT) for details:
https://opensource.org/licenses/mit-license.php
*/
package main
import (
"log"
"os"
"github.com/gotk3/gotk3/gtk"
)
/******************************/
/* Gtk3 Window Initialisation */
/******************************/
func mainStartGtk(winTitle string, width, height int, center bool) {
mainObjects = new(MainControlsObj)
gtk.Init(nil)
if newBuilder(mainGlade) == nil {
// Init tempDir and Remove tempDirectory on exit
tempDir = tempMake(Name)
defer os.RemoveAll(tempDir)
// Parse Gtk objects
gladeObjParser()
// Objects Signals initialisations
signalsPropHandler()
// Fill control with images
assignImages()
// Set Window Properties
if center {
mainObjects.mainWin.SetPosition(gtk.WIN_POS_CENTER)
}
mainObjects.mainWin.SetTitle(winTitle)
mainObjects.mainWin.SetDefaultSize(width, height)
mainObjects.mainWin.Connect("delete-event", windowDestroy)
mainObjects.mainWin.ShowAll()
// Start main application ...
mainApplication()
// Start Gui loop
gtk.Main()
} else {
log.Fatal("Builder initialisation error.")
}
}