本文整理汇总了Python中kiwi.ui.views.BaseView.show方法的典型用法代码示例。如果您正苦于以下问题:Python BaseView.show方法的具体用法?Python BaseView.show怎么用?Python BaseView.show使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类kiwi.ui.views.BaseView
的用法示例。
在下文中一共展示了BaseView.show方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: News
# 需要导入模块: from kiwi.ui.views import BaseView [as 别名]
# 或者: from kiwi.ui.views.BaseView import show [as 别名]
"Reverend CyberSatan",
"http://www.pigdog.org/auto/TheCorporateFuck/link/2683.html"),
("Those Crazy Dutch Have Resurrected Elvis",
"Miss Conduct",
"http://www.pigdog.org/auto/viva_la_musica/link/2678.html")
]
class News(SlaveView):
def __init__(self):
model = gtk.ListStore(str, str)
treeview = gtk.TreeView(model)
renderer = gtk.CellRendererText()
col1 = gtk.TreeViewColumn('News', renderer, text=0)
col2 = gtk.TreeViewColumn('Author', renderer, text=1)
treeview.append_column(col1)
treeview.append_column(col2)
treeview.get_selection().set_mode(gtk.SELECTION_BROWSE)
for item in news:
model.append(item[:-1])
SlaveView.__init__(self, treeview)
news = News()
shell = BaseView(gladefile="news_shell", delete_handler=quit_if_last)
shell.attach_slave("placeholder", news)
news.show_all()
news.focus_toplevel() # explained next section, don't worry
shell.show()
gtk.main()
示例2: NewsItem
# 需要导入模块: from kiwi.ui.views import BaseView [as 别名]
# 或者: from kiwi.ui.views.BaseView import show [as 别名]
#!/usr/bin/env python
import gtk
from kiwi.ui.gadgets import quit_if_last
from kiwi.ui.views import BaseView
class NewsItem:
"""An instance representing an item of news.
Attributes: title, author, url, size"""
title = ''
url = ''
author = ''
size = 0
item = NewsItem()
my_widgets = ["title", "author", "url", "size"]
view = BaseView(gladefile="newsform", widgets=my_widgets,
delete_handler=quit_if_last)
view.add_proxy(item, my_widgets)
view.focus_topmost()
view.show()
gtk.main() # runs till window is closed as per delete_handler
print 'Item: "%s" (%s) %s %d' % (item.title, item.author, item.url, item.size)
示例3: BaseView
# 需要导入模块: from kiwi.ui.views import BaseView [as 别名]
# 或者: from kiwi.ui.views.BaseView import show [as 别名]
#!/usr/bin/env python
import gtk
from kiwi.ui.gadgets import quit_if_last
from kiwi.ui.views import BaseView
app = BaseView(gladefile="hey", delete_handler=quit_if_last)
app.show()
gtk.main()