Пример #1
0
// NewWindow creates a new config window with its widget, ready to use.
//
func NewWindow(data datatype.Source, log cdtype.Logger) (*GuiConfigure, error) {
	win, e := gtk.WindowNew(gtk.WINDOW_TOPLEVEL)
	if e != nil {
		return nil, e
	}
	win.SetDefaultSize(WindowWidth, WindowHeight)
	win.SetTitle(WindowTitle)
	win.SetWMClass(WindowClass, WindowTitle)

	win.SetIconFromFile(data.AppIcon())

	widget := NewWidget(data, log)
	widget.SetWindow(win)

	win.Add(widget)
	win.ShowAll()

	return widget, nil
}