Ejemplo n.º 1
0
func setup() *Context {
	ctx := new(Context)
	ctx.ItemStore = NewMockItemStore()
	ctx.Entry = NewFakeEntry()
	ctx.AddButton = NewFakeAddButton()
	ctx.ToggleButton = NewFakeToggleButton()
	ui := ui.NewUi(ctx.Entry, NewFakeListStore(), ctx.AddButton, ctx.ToggleButton, func() {})
	ctx.App = NewApp(ctx.ItemStore, ui, 10)
	return ctx
}
Ejemplo n.º 2
0
func Load() ui.Ui {
	ls := loadListStore()
	toggleButton := NewToggleButton(loadToggleRenderer(), ls)
	entry := loadEntry()
	addButton := entry
	win := loadWindow()
	return ui.NewUi(entry, ls, addButton, toggleButton, func() {
		win.ShowAll()
		gtk.Main()
	})
}