當前位置: 首頁>>代碼示例>>Golang>>正文


Golang XUtil.Dummy方法代碼示例

本文整理匯總了Golang中github.com/Nightgunner5/xgbutil.XUtil.Dummy方法的典型用法代碼示例。如果您正苦於以下問題:Golang XUtil.Dummy方法的具體用法?Golang XUtil.Dummy怎麽用?Golang XUtil.Dummy使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在github.com/Nightgunner5/xgbutil.XUtil的用法示例。


在下文中一共展示了XUtil.Dummy方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Golang代碼示例。

示例1: Drag

// Drag is the public interface that will make the appropriate connections
// to register a drag event for three functions: the begin function, the
// step function and the end function.
// The 'grabwin' is the window that the grab is placed on (and therefore the
// window where all button events are redirected to after the drag has started),
// and the 'win' is the window that the initial 'begin' callback is set on.
// In typical use cases, these windows should be the same.
// If 'grab' is false, then no pointer grab is issued.
func Drag(xu *xgbutil.XUtil, grabwin xproto.Window, win xproto.Window,
	buttonStr string, grab bool,
	begin xgbutil.MouseDragBeginFun, step xgbutil.MouseDragFun,
	end xgbutil.MouseDragFun) {

	ButtonPressFun(
		func(xu *xgbutil.XUtil, ev xevent.ButtonPressEvent) {
			dragBegin(xu, ev, grabwin, win, begin, step, end)
		}).Connect(xu, win, buttonStr, false, grab)

	// If the grab win isn't the dummy, then setup event handlers for the
	// grab window.
	if grabwin != xu.Dummy() {
		xevent.MotionNotifyFun(dragStep).Connect(xu, grabwin)
		xevent.ButtonReleaseFun(dragEnd).Connect(xu, grabwin)
	}
}
開發者ID:Nightgunner5,項目名稱:xgbutil,代碼行數:25,代碼來源:drag.go

示例2: DummyGrab

// DummyGrab grabs the keyboard and sends all key events to the dummy window.
func DummyGrab(xu *xgbutil.XUtil) error {
	return SmartGrab(xu, xu.Dummy())
}
開發者ID:Nightgunner5,項目名稱:xgbutil,代碼行數:4,代碼來源:keybind.go

示例3: Initialize

// Initialize attaches the appropriate callbacks to make mouse bindings easier.
// i.e., prep the dummy window to handle mouse dragging events
func Initialize(xu *xgbutil.XUtil) {
	xevent.MotionNotifyFun(dragStep).Connect(xu, xu.Dummy())
	xevent.ButtonReleaseFun(dragEnd).Connect(xu, xu.Dummy())
}
開發者ID:Nightgunner5,項目名稱:xgbutil,代碼行數:6,代碼來源:mousebind.go


注:本文中的github.com/Nightgunner5/xgbutil.XUtil.Dummy方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。