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


Python Window.place_column方法代码示例

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


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

示例1: test

# 需要导入模块: from GUI import Window [as 别名]
# 或者: from GUI.Window import place_column [as 别名]
def test():
    win = Window(title = "Exceptions", size = (200, 100))
    but1 = Button("ApplicationError", action = raise_application_error)
    but2 = Button("Exception", action = raise_exception)
    win.place_column([but1, but2], left = 20, top = 20)
    win.shrink_wrap(padding = (20, 20))
    win.show()
    application().run()
开发者ID:karlmatthew,项目名称:pygtk-craigslist,代码行数:10,代码来源:18-exceptions.py

示例2: test

# 需要导入模块: from GUI import Window [as 别名]
# 或者: from GUI.Window import place_column [as 别名]
def test():
    starter = Button("Start", action = start_task)
    stopper = Button("Stop", action = stop_task)
    win = Window(title = "Tasks")
    win.place_column([starter, stopper], left = 20, top = 20, spacing = 20)
    win.shrink_wrap(padding = (20, 20))
    win.show()
    application().run()
开发者ID:karlmatthew,项目名称:pygtk-craigslist,代码行数:10,代码来源:24-task.py

示例3: test

# 需要导入模块: from GUI import Window [as 别名]
# 或者: from GUI.Window import place_column [as 别名]
def test():
    def select():
        i = group.value
        name = cursor_names[i]
        say("Selecting cursor no. %d (%s)" % (i, name))
        cursor = getattr(StdCursors, name)
        say("...", cursor)
        view.cursor = cursor
    win = Window(title = "Std Cursors")
    view = TestArea(size = (100, 100))
    win.place(view, left = 20, top = 20)
    group = RadioGroup(action = select)
    for i, name in enumerate(cursor_names):
        group.add_item(RadioButton(title = name, value = i))
    win.place_column(group, left = view + 20, top = 20, spacing = 0)
    win.shrink_wrap((20, 20))
    win.show()
    application().run()
开发者ID:karlmatthew,项目名称:pygtk-craigslist,代码行数:20,代码来源:28-std-cursors.py

示例4: test

# 需要导入模块: from GUI import Window [as 别名]
# 或者: from GUI.Window import place_column [as 别名]
def test(orient, pos, pad):
    win = Window(title = "%s Sliders" % orient.upper(), position = pos,
        auto_position = False)
    sliders = []
    if 1:
        #say("Creating slider 1")
        sl1 = sl2 = sl3 = None
        sl1 = Slider(orient = orient, max_value = 100)
        sl1.action = slid(sl1, orient, 1)
        sliders.append(sl1)
    if 1:
        #say("Creating slider 2")
        sl2 = Slider(orient = orient, max_value = 100, ticks = 6, live = False)
        sl2.value = 50
        sl2.action = slid(sl2, orient, 2)
        sliders.append(sl2)
    if 1:
        #say("Creating slider 3")
        sl3 = Slider(orient = orient, max_value = 100, ticks = 6, discrete = True)
        sl3.value = 100
        sl3.action = slid(sl3, orient, 3)
        sliders.append(sl3)
    #say("Created sliders")
    if orient == 'h':
        win.place_column(sliders, left = 20, top = 20, spacing = 20, sticky = 'ew')
        if sl2:
            sl2.vstretch = True
        if sl3:
            sl3.vmove = True
    else:
        win.place_row(sliders, left = 20, top = 20, spacing = 20, sticky = 'ns')
        if sl2:
            sl2.hstretch = True
        if sl3:
            sl3.hmove = True
    #say("Placed sliders")
    win.shrink_wrap()
    win.show()
开发者ID:karlmatthew,项目名称:pygtk-craigslist,代码行数:40,代码来源:29-slider.py

示例5: Button

# 需要导入模块: from GUI import Window [as 别名]
# 或者: from GUI.Window import place_column [as 别名]
    rb.append(RadioButton(kind.capitalize(), value=kind, group=rg))
rg.set_value("stop")
pb = [
    Button(title="Alert", action=do_alert),
    Button(title="Alert2", action=do_alert2),
    Button(title="Alert3", action=do_alert3),
]
pb2 = [
    Button("Note Alert", action=do_note_alert),
    Button("Stop Alert", action=do_stop_alert),
    Button("Ask", action=do_ask),
    Button("Confirm", action=do_confirm),
    Button("Ask or Cancel", action=do_ask_or_cancel),
    Button("Confirm or Cancel", action=do_confirm_or_cancel),
]
win.place_column(pb, left=20, top=20)
win.place_column(rb, left=pb[2] + 20, top=20)
win.place_column(pb2, left=rb[1].right + 20, top=20)
win.size = (pb2[-1].right + 20, pb2[-1].bottom + 20)
win.show()

instructions = """
This lets you play around with the various standard dialog functions.
Consult the documentation for details of how they should behave. Check
that appropriate icons are displayed for the different flavours according
to platform conventions.
"""

say(instructions)
application().run()
开发者ID:rceballos98,项目名称:hapticJacket,代码行数:32,代码来源:17-alerts.py


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