Esempio n. 1
0
// this method is required by surface delegates!
func (self *GooDelegate) Draw(s *goosurface.Surface) {
	s.Begin()
	s.Clear(0.0, 0.0, 0.0, 0.9)
	s.End()
}
Esempio n. 2
0
// if we want to know about mouse motion on our surface(s)
// associated with a delegate, we add this method.
// Simply by putting this here, the goosurface package
// knows to let gtk2 know that we want mouse motion events.
func (self *GooDelegate) MouseMoved(s *goosurface.Surface, x float, y float) {
	s.Begin()
	s.Clear(0, 0, 0, 0.9)
	s.SetColor(1, 1, 1, 0.8)
	s.MoveTo(40, 30)
	s.SetFontSize(16)
	str := fmt.Sprintf("(%6.2f, %6.2f)", x, y)
	s.ShowText(str)
	s.End()
}