当前位置: 首页>>代码示例>>Python>>正文


Python BaseView.focus_topmost方法代码示例

本文整理汇总了Python中kiwi.ui.views.BaseView.focus_topmost方法的典型用法代码示例。如果您正苦于以下问题:Python BaseView.focus_topmost方法的具体用法?Python BaseView.focus_topmost怎么用?Python BaseView.focus_topmost使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在kiwi.ui.views.BaseView的用法示例。


在下文中一共展示了BaseView.focus_topmost方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: BaseView

# 需要导入模块: from kiwi.ui.views import BaseView [as 别名]
# 或者: from kiwi.ui.views.BaseView import focus_topmost [as 别名]
from kiwi.ui.views import BaseView, SlaveView
from kiwi.ui.objectlist import Column
from kiwi.ui.gadgets import quit_if_last

# Main window
addressbook = BaseView(gladefile="addressbook",
                       widgets=("add", "del"),
                       delete_handler=quit_if_last)

## Slave Components:
# Entry editor GUI component
entry_editor = SlaveView(toplevel=addressbook,
                         widgets=("name", "address", "phone"),
                         gladefile="entry_editor")
# Entries list GUI component
list_entries = SlaveView(toplevel=addressbook,
                         widgets=("table",),
                         gladefile="list_entries")

list_entries.table.set_columns([Column("name", title="Name"),
                                Column("address", title="Address"),
                                Column("phone", title="Phone")])

## Attach slaves to main window
addressbook.attach_slave("entry_editor", entry_editor)
addressbook.attach_slave("list", list_entries)

addressbook.show_all()
addressbook.focus_topmost()
gtk.main()
开发者ID:barbieri,项目名称:barbieri-playground,代码行数:32,代码来源:addressbook.py

示例2: NewsItem

# 需要导入模块: from kiwi.ui.views import BaseView [as 别名]
# 或者: from kiwi.ui.views.BaseView import focus_topmost [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)
开发者ID:Schevo,项目名称:kiwi,代码行数:26,代码来源:newsform.py

示例3: Person

# 需要导入模块: from kiwi.ui.views import BaseView [as 别名]
# 或者: from kiwi.ui.views.BaseView import focus_topmost [as 别名]
from kiwi.ui.gadgets import quit_if_last

# define the class that holds our application data
class Person(Model):
    name = ""
    address = ""
    phone = ""


person = Person()

view1 = BaseView(delete_handler=quit_if_last,
                 widgets=("name", "address", "phone"),
                 gladefile="person")

# create and run a proxy interface attached to person
view1.add_proxy(person, ("name", "address", "phone"))
view1.focus_topmost()
view1.show_all()

view2 = BaseView(delete_handler=quit_if_last,
                 widgets=("name", "address", "phone"),
                 gladefile="person")

# create and run a proxy interface attached to person
view2.add_proxy(person, ("name", "address", "phone"))
view2.focus_topmost()
view2.show_all()

gtk.main()
开发者ID:barbieri,项目名称:barbieri-playground,代码行数:32,代码来源:person.py


注:本文中的kiwi.ui.views.BaseView.focus_topmost方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。