class10_Frame 框架
最终运行效果图(程序见序号2):
#!/usr/bin/env python # -*- coding:utf-8 -*- # ------------------------------------------------------------ # # 参考资料: # 用 python 和 tkinter 做简单的窗口视窗 - 网易云课堂 # https://study.163.com/course/courseLearn.htm?courseId=1003216011#/learn/video?lessonId=1003650349&courseId=1003216011 # # python:tkinter实现定时更换图片 - CSDN博客 # https://blog.csdn.net/ztchun/article/details/69524485 # # GUI Programming with Python: Buttons in Tkinter # https://www.python-course.eu/tkinter_buttons.php # ------------------------------------------------------------ # ******************** class10_Frame 框架 ******************* # ******************** class10_Frame 框架 ******************* # =====>>>>>>内容概览 # =====>>>>>>内容概览 ''' # ------------------------------------------------------------ # # 1、生成一个框架 # ------------------------------------------------------------ # ------------------------------------------------------------ # # 2、生成多个框架 # ------------------------------------------------------------ '''
# ------------------------------------------------分割线------------------------------------------------- # ------------------------------------------------分割线------------------------------------------------- # ------------------------------------------------分割线-------------------------------------------------
# ------------------------------------------------分割线------------------------------------------------- ''' # ------------------------------------------------------------ # # 1、生成一个框架 # ------------------------------------------------------------ ''' # # import tkinter as tk # # window = tk.Tk() # window.title('class10_Frame') # window.geometry('400x300') # # # 生成一个框架 # fm = tk.Frame(window) # fm.pack() # # 在 fm 的基础上生成一个按钮 # b1 = tk.Button(window, text='【fm】', fg='dark blue') # b1.pack() # # # window.mainloop() # ------------------------------------------------分割线------------------------------------------------- ''' # ------------------------------------------------------------ # # 2、生成多个框架 # ------------------------------------------------------------ ''' import tkinter as tk window = tk.Tk() window.title('class10_Frame') window.geometry('400x300') # 生成一个框架 fm = tk.Frame(window) fm.pack() # 在 fm 的基础上生成一个按钮 b1 = tk.Label(fm, text='【fm】', fg='dark blue') b1.pack() # 生成左侧框架 fm_l = tk.Frame(fm) fm_l.pack(side='left') # 放在上面框架的左侧 tk.Label(fm_l, text='fm_l').pack() # 生成右侧侧框架 fm_r = tk.Frame(fm) fm_r.pack(side='right') # 放在上面框架的左侧 tk.Label(fm_r, text='fm_r').pack() window.mainloop()
最终运行效果图(程序见序号2):
转载请注明出处。https://www.cnblogs.com/jyfootprint/p/9457346.html