wid_specgram.py 文件源码

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

项目:PyFusionGUI 作者: SyntaxVoid 项目源码 文件源码
def mybut(text, dummy, xl, yb, xw=0, yh=0, axisbg=None, color=0.85, fun=None, bspace=0.005):
    """ create axes and populate button with text, automatically adjusting
    xw if not given.  Has a side effect on xl. (button_layout_cursor)
    dummy is for if and when I can place these on an obect rather than using pylab
    """
    if axisbg==None: axisbg='lightgoldenrodyellow'

    global button_layout_cursor
    if xw==0: xw=0.015*(len(text)+1)
    if yh==0: yh=0.05
##    thisax=fig.add_axes([xl, yb, xw, yh], axisbg=axisbg) fundamentally wrong
    thisax=pl.axes([xl, yb, xw, yh], axisbg=axisbg)
    thisbut=Button(thisax, text)
    thisbut.on_clicked(fun)
    button_layout_cursor += xw+bspace
    return(thisbut)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号