Beispiel #1
0
func (self *View) processMouseUp(w driver.Window, e event.MouseUp) {
	if self.content != nil {
		mouseUp(w, self.content, event.MouseClick(e))
	}

	self.changeDefaultCursor(nil)
}
Beispiel #2
0
func (self *View) processMouseDown(w driver.Window, e event.MouseDown) {
	if self.content != nil {
		mouseDown(w, self.content, event.MouseClick(e))
	}

	if e.Clicks == 1 {
		// We lookup the widget where the mouse was clicked, if there's no
		// content the view itself will be returned so this function never
		// returns nil.
		// If the widget at the click position isn't a mouse receiver we apply
		// the default behavior which is ot clear all current selections in the
		// widget tree.
		widget := WidgetAt(self, e.Position)

		if _, ok := widget.(event.MouseButtonReceiver); !ok {
			self.clearMouseSelection(w)
		}
	}
}