本文整理汇总了Python中dialog.Dialog.handle方法的典型用法代码示例。如果您正苦于以下问题:Python Dialog.handle方法的具体用法?Python Dialog.handle怎么用?Python Dialog.handle使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类dialog.Dialog
的用法示例。
在下文中一共展示了Dialog.handle方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: handle
# 需要导入模块: from dialog import Dialog [as 别名]
# 或者: from dialog.Dialog import handle [as 别名]
def handle(self,ch):
""" handles found file selection, populating the preview window, new searches, and opening a file """
self.handle_chat_events()
focus_index = self.current
focus_field = self.focus_list[self.current][1]
if ch in [keytab.KEYTAB_SPACE,keytab.KEYTAB_CR]:
if focus_field == self.buddys:
(selection,choices) = self.buddys.getvalue()
# make the selected buddy current in chat
self.start_chat(choices[selection])
self.current = self.reply.getorder()-1
ch = Component.CMP_KEY_NOP
elif focus_field == self.config_button:
conf_dialog = ChatConfigDialog(self,"Chat Config Dialog")
values = conf_dialog.main()
if values:
self.config = values
self.save_config()
self.current = self.buddys.getorder()-1
ch = Component.CMP_KEY_NOP
self.connect( values['name'], values['password'], values['server'], int(values['port']) )
elif focus_field == self.reply and ch == keytab.KEYTAB_CR:
# type in the reply
self.send_message( self.current_buddy, self.reply.getvalue() )
self.reply.setvalue("")
self.reply.home()
ch = Component.CMP_KEY_NOP
elif ch in [keytab.KEYTAB_F04,keytab.KEYTAB_ALTK,keytab.KEYTAB_ALTE]:
return ch
ret_ch = Dialog.handle(self,ch)
if ret_ch in [Component.CMP_KEY_CANCEL]:
self.stop_chat_thread()
ret_ch = keytab.KEYTAB_ALTK
return ret_ch