uicontainer.py 文件源码

python
阅读 19 收藏 0 点赞 0 评论 0

项目:pythonista-scripts 作者: khilnani 项目源码 文件源码
def addbut(sender,toview):
        root=sender
        while root.superview:
            root=root.superview
        #add a button to parent view
        import random,string
        if root['switch'].value:
            w=random.randrange(30,110)
            h=random.randrange(20,75)
        else:
            w=40
            h=40
        title=string.ascii_letters[random.randint(0,26)]
        for v in toview:
            b=ui.Button(frame=(0,0,w,h),bg_color=(.8,.8,.8))
            b.border_width=1
            b.border_color=(0,0,0)
            b.corner_radius=10
            b.title=title
            b.action=lambda sender:addbut(sender,toview)
            v.add_subview(b)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号