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


Python Window.place_row方法代码示例

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


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

示例1: main

# 需要导入模块: from GUI import Window [as 别名]
# 或者: from GUI.Window import place_row [as 别名]
def main():
    f = None
    args = sys.argv[1:]
    if args:
        fontsize = int(args[0])
        sf = StdFonts.system_font
        f = Font(sf.family, fontsize, sf.style)
        #showfont("Using font", f)
    win = Window(title = "Heights")
    if f:
        kwds = {'font': f}
    else:
        kwds = {}
    controls = [
        Label(text = "Label", **kwds),
        TextField(text = "Text", **kwds),
        CheckBox(title = "Check", **kwds),
        RadioButton(title = "Radio", **kwds),
        Slider(orient = 'h', width = 50),
        #Button(title = "Button", **kwds),
    ]
    #for ctl in controls:
    #	say("Height of %r is %s" % (ctl, ctl.height))
    win.place_row(controls, left = 10, top = 10)
    win.shrink_wrap(padding = (10, 10))
    win.show()
    run()
开发者ID:karlmatthew,项目名称:pygtk-craigslist,代码行数:29,代码来源:32-default-heights.py

示例2: test

# 需要导入模块: from GUI import Window [as 别名]
# 或者: from GUI.Window import place_row [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

示例3: __init__

# 需要导入模块: from GUI import Window [as 别名]
# 或者: from GUI.Window import place_row [as 别名]
    def __init__(self, name, **kwds):
        self.name = name
        TestScrollableDrawing.__init__(self, scrolling = 'hv', **kwds)
    
    def mouse_down(self, event):
        #self.become_target()
        TestMouseEvents.mouse_down(self, event)
    
    def report_mouse_event(self, mess):
        say("%s: %s" % (self.name, mess))


win = Window()
view1 = TestView("View 1", width = 320, height = 200)
view2 = TestScrollableView("View 2", width = 320, height = 200)
win.place_row([view1, view2], left = 20, top = 20, spacing = 20)
view2.hstretch = 1
view2.vstretch = 1
win.shrink_wrap(padding = (20, 20))
win.show()
view1.become_target()

say("""
There should be two views. The following events should be reported
in either view: mouse_down, mouse_drag, mouse_up, mouse_move.

The right-hand view should resize with the window. Check that
mouse events are still reported correctly after resizing and after
scrolling the view.
""")
开发者ID:karlmatthew,项目名称:pygtk-craigslist,代码行数:32,代码来源:33-mouse-events.py


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