本文整理汇总了Python中dialogs.Dialog.destroy方法的典型用法代码示例。如果您正苦于以下问题:Python Dialog.destroy方法的具体用法?Python Dialog.destroy怎么用?Python Dialog.destroy使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类dialogs.Dialog
的用法示例。
在下文中一共展示了Dialog.destroy方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __edit_prefs
# 需要导入模块: from dialogs import Dialog [as 别名]
# 或者: from dialogs.Dialog import destroy [as 别名]
def __edit_prefs(self, *args):
kmap = {
'hide-read':'bool',
'update-interval':'int',
'max-articles':'int',
'use-notify':'bool',
'on-the-fly':'bool',
'enable-debug':'bool',
'auto-update':'bool',
'live-search':'bool',
'auto-hide-search':'bool',
'show-status':'bool',
}
hmap = {
'hide-read':_('Hide Read Items'),
'update-interval':_('Update interval (in minutes)'),
'max-articles':_('Maximum number of articles to keep (excluding starred)'),
'auto-update':_('Allow the engine to download new articles automatically.'),
'on-the-fly':_('Start downloading articles for new feeds on-the-fly'),
'use-notify':_('Show notification on updates'),
'enable-debug':_('Enable detailed logs'),
'live-search':_('Return search results as you type'),
'auto-hide-search':_('Hide Search form on results'),
'show-status':_('Show the bottom status bar'),
}
data = []
for k,v in kmap.iteritems():
data.append({
'type':v,
'name':k,
'header':hmap.get(k),#FIXME: can this be gotten from gsettings?
})
d = Dialog(self, _('Edit preferences'), data, self.settings)
r = d.run()
d.destroy()
示例2: __add_category
# 需要导入模块: from dialogs import Dialog [as 别名]
# 或者: from dialogs.Dialog import destroy [as 别名]
def __add_category(self, *args):
args = [
{'type':'str','name':'name', 'header':_('Name') },
]
d = Dialog(self, _('Add a category'), args)
r = d.run()
item = d.response
item['type'] = 'category'
d.destroy()
if r == Gtk.ResponseType.OK:
self.__create(item)
示例3: __add_feed
# 需要导入模块: from dialogs import Dialog [as 别名]
# 或者: from dialogs.Dialog import destroy [as 别名]
def __add_feed(self, *args):
data = [
{'type':'str','name':'url', 'header':_('Link') },
]
d = Dialog(self, _('Add a feed'), data)
r = d.run()
item = d.response
item['type'] = 'feed'
d.destroy()
if r == Gtk.ResponseType.OK:
self.__create(item)
示例4: __edit_item
# 需要导入模块: from dialogs import Dialog [as 别名]
# 或者: from dialogs.Dialog import destroy [as 别名]
def __edit_item(self, *args):
item = self.tree.current_item #FIXME: not good!!
print item
if item['type'] == 'category':
args = [{'type':'str','name':'name', 'header':_('Name'), 'value':item['name'] },]
d = Dialog(self, _('Edit this category'), args)
elif item['type'] == 'feed':
args = [{'type':'str','name':'url', 'header':_('Link'), 'value':item['url'] },]
d = Dialog(self, _('Edit this feed'), args)
r = d.run()
o = d.response
for k,v in o.iteritems():
item[k] = v
d.destroy()
if r == Gtk.ResponseType.OK:
self.__edit(item)
示例5: start
# 需要导入模块: from dialogs import Dialog [as 别名]
# 或者: from dialogs.Dialog import destroy [as 别名]
def start(button):
progressDialog = Dialog("", 40, 5)
progress = Progressbar(38, 0, 10)
progressDialog.addComponent(progress, 1, 2)
progressDialog.center()
dialog.unfocus()
progressDialog.draw()
progressDialog.focus()
for i in range(1, 11):
time.sleep(0.5)
progress.setValue(i)
time.sleep(0.5)
progressDialog.destroy()
dialog.focus()