예제 #1
0
파일: sterm.go 프로젝트: evmar/smash
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()
}