GUI_Complexity_end_tab3_multiple_notebooks.py 文件源码

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

项目:Python-GUI-Programming-Cookbook-Second-Edition 作者: PacktPublishing 项目源码 文件源码
def notebook_callback(event):
    clear_display_area()

    current_notebook = str(event.widget)
    tab_no = str(event.widget.index("current") + 1)   

    if current_notebook.endswith('notebook'):
        active_notebook = 'Notebook 1'
    elif current_notebook.endswith('notebook2'):
        active_notebook = 'Notebook 2'
    else:
        active_notebook = ''

    if active_notebook is 'Notebook 1':  
        if   tab_no == '1': display_tab1()
        elif tab_no == '2': display_tab2()
        elif tab_no == '3': display_tab3()
        else: display_button(active_notebook, tab_no)
    else:
        display_button(active_notebook, tab_no)


#-----------------------------------------------------------
#  Create GUI
#-----------------------------------------------------------
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号