本文整理匯總了Golang中github.com/gotk3/gotk3/gdk.EventButton.Y方法的典型用法代碼示例。如果您正苦於以下問題:Golang EventButton.Y方法的具體用法?Golang EventButton.Y怎麽用?Golang EventButton.Y使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類github.com/gotk3/gotk3/gdk.EventButton
的用法示例。
在下文中一共展示了EventButton.Y方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Golang代碼示例。
示例1: getAccountAndJidFromEvent
func (r *roster) getAccountAndJidFromEvent(bt *gdk.EventButton) (jid string, account *account, rowType string, ok bool) {
x := bt.X()
y := bt.Y()
path := new(gtk.TreePath)
found := r.view.GetPathAtPos(int(x), int(y), path, nil, nil, nil)
if !found {
return "", nil, "", false
}
iter, err := r.model.GetIter(path)
if err != nil {
return "", nil, "", false
}
jid = getFromModelIter(r.model, iter, indexJid)
accountID := getFromModelIter(r.model, iter, indexAccountID)
rowType = getFromModelIter(r.model, iter, indexRowType)
account, ok = r.getAccount(accountID)
return jid, account, rowType, ok
}
示例2: buttonCallback
func buttonCallback(area *gtk.DrawingArea, event *gdk.Event, v DrawAreaClient) {
ev := gdk.EventButton{event}
pos := image.Point{int(ev.X()), int(ev.Y())}
v.ButtonCallback(DrawArea{area, 0, 0, 0, 0}, ev.Type(), pos)
}