本文整理汇总了Golang中github.com/gotk3/gotk3/gdk.EventButton.Time方法的典型用法代码示例。如果您正苦于以下问题:Golang EventButton.Time方法的具体用法?Golang EventButton.Time怎么用?Golang EventButton.Time使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类github.com/gotk3/gotk3/gdk.EventButton
的用法示例。
在下文中一共展示了EventButton.Time方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Golang代码示例。
示例1: createAccountPopup
func (r *roster) createAccountPopup(jid string, account *account, bt *gdk.EventButton) {
builder := builderForDefinition("AccountPopupMenu")
obj, _ := builder.GetObject("accountMenu")
mn := obj.(*gtk.Menu)
builder.ConnectSignals(map[string]interface{}{
"on_connect": func() {
account.session.WantToBeOnline = true
account.Connect()
},
"on_disconnect": func() {
account.session.WantToBeOnline = false
account.disconnect()
},
"on_edit": account.edit,
"on_dump_info": func() {
r.debugPrintRosterFor(account.session.GetConfig().Account)
},
})
connx, _ := builder.GetObject("connectMenuItem")
connect := connx.(*gtk.MenuItem)
dconnx, _ := builder.GetObject("disconnectMenuItem")
disconnect := dconnx.(*gtk.MenuItem)
connect.SetSensitive(account.session.IsDisconnected())
disconnect.SetSensitive(account.session.IsConnected())
mn.ShowAll()
mn.PopupAtMouseCursor(nil, nil, int(bt.Button()), bt.Time())
}
示例2: createAccountPeerPopup
func (r *roster) createAccountPeerPopup(jid string, account *account, bt *gdk.EventButton) {
builder := builderForDefinition("ContactPopupMenu")
mn := getObjIgnoringErrors(builder, "contactMenu").(*gtk.Menu)
builder.ConnectSignals(map[string]interface{}{
"on_remove_contact": func() {
account.session.RemoveContact(jid)
r.ui.removePeer(account, jid)
r.redraw()
},
"on_allow_contact_to_see_status": func() {
account.session.ApprovePresenceSubscription(jid, "" /* generate id */)
},
"on_forbid_contact_to_see_status": func() {
account.session.DenyPresenceSubscription(jid, "" /* generate id */)
},
"on_ask_contact_to_see_status": func() {
account.session.RequestPresenceSubscription(jid)
},
"on_peer_fingerprints": func() {
r.ui.showFingerprintsForPeer(jid, account)
},
"on_dump_info": func() {
r.debugPrintRosterFor(account.session.GetConfig().Account)
},
"on_rename_signal": func() {
r.renameContactPopup(account.session.GetConfig(), jid)
},
})
mn.ShowAll()
mn.PopupAtMouseCursor(nil, nil, int(bt.Button()), bt.Time())
}