Пример #1
0
func main() {
	ui := gtk.Init()

	win := smash.NewWindow(ui)

	term := smash.NewTermView(win)
	win.View = term

	w, h := term.Measure(24, 80)
	win.GetUiWindow().SetSize(w, h)

	term.Start(exec.Command("bash"))

	win.Show()
	ui.Loop()
}
Пример #2
0
func SmashMain() {
	ui := gtk.Init()
	win := &Window{
		ui:   ui,
		font: NewMonoFont(),
	}
	win.win = ui.NewWindow(win, true)
	// Use the font once to get its metrics.
	cr := win.win.GetCairo()
	win.font.Use(cr, false)
	w, h := win.font.cw*80, win.font.ch*24
	win.win.SetSize(w, h)
	var err error
	win.View, err = NewLogView(win, h)
	if err != nil {
		panic(err)
	}
	win.win.Show()
	ui.Loop()
}