Beispiel #1
0
func (ui *Ui) init() {
	win, _ := gtk.WindowNew(gtk.WINDOW_TOPLEVEL)
	win.SetTitle("GNOMEConnect")
	win.SetDefaultSize(800, 600)
	win.Connect("destroy", func() {
		gtk.MainQuit()
		ui.Quit <- true
	})
	ui.win = win

	hbox, _ := gtk.BoxNew(gtk.ORIENTATION_HORIZONTAL, 0)
	win.Add(hbox)

	scroller := ui.initDevicesList()
	hbox.PackStart(scroller, false, true, 0)

	sep, _ := gtk.SeparatorNew(gtk.ORIENTATION_HORIZONTAL)
	hbox.PackStart(sep, false, true, 0)

	box := ui.initDeviceView()
	hbox.PackEnd(box, true, true, 0)

	titlebar := ui.initTitlebar()
	win.SetTitlebar(titlebar)

	win.ShowAll()
	ui.selectDevice(nil)
}
Beispiel #2
0
func (ui *Ui) initTitlebar() *gtk.Box {
	hbox, _ := gtk.BoxNew(gtk.ORIENTATION_HORIZONTAL, 0)

	headerbar, _ := gtk.HeaderBarNew()
	headerbar.SetTitle("Devices")
	headerbar.SetSizeRequest(sidebarWidth, -1)
	hbox.PackStart(headerbar, false, true, 0)

	sep, _ := gtk.SeparatorNew(gtk.ORIENTATION_HORIZONTAL)
	hbox.PackStart(sep, false, true, 0)

	headerbar, _ = gtk.HeaderBarNew()
	headerbar.SetTitle("GNOMEConnect")
	headerbar.SetShowCloseButton(true)
	hbox.PackEnd(headerbar, true, true, 0)

	return hbox
}