python tkinter中的锚点(anchor)问题

简介: python tkinter中的锚点(anchor)问题
tkinter中anchor参数

(注意,参数的英文都是小写)

字母 方位
n
s
w 西
e
center 中心
nw 西北
ne 东北
sw 西南
se 东南



from tkinter import *
from tkinter import messagebox as box



def main_menu():
    window = Tk()
    window.title('Juke Box')
    window.geometry('800x480')
    window.configure(background = 'black')

    label = Label(window, text = 'Juke-Box', fg = 'light green', bg = 'black', font = (None, 30), height = 2)
    label.pack(side = TOP)

    Jam = Button(window, text = 'The Jam', width = 25, height = 2)
    Jam.pack(pady = 10, padx = 25, anchor = 'n')

    Roses = Button(window, text = 'The Stone Roses', width = 25, height = 2)
    Roses.pack(pady = 10, padx = 25, anchor = 'w')

    Smiths = Button(window, text = 'The Smiths', width = 25, height = 2)
    Smiths.pack(pady = 10, padx = 25, anchor = 'w')

    Wedding = Button(window, text = 'The Wedding Pressent', width = 25, height = 2)
    Wedding.pack(pady = 10, padx = 25, anchor = 'w')

    Blondie = Button(window, text = 'Blondie', width = 25, height = 2)
    Blondie.pack(pady = 10, padx = 25, anchor = 'w')

    Clash = Button(window, text = 'Clash', width = 25, height = 2)
    Clash.pack(pady = 10, padx = 25, anchor = 'w')

    Madness = Button(window, text = 'Madness', width = 25, height = 2)
    Madness.pack(pady = 10, padx = 25, anchor = 'n')

    Pistols = Button(window, text = 'The Sex Pistols', width = 25, height = 2)
    Pistols.pack(pady = 10, padx = 25, anchor = 'n')

    window.mainloop()



main_menu()

相关文章
|
4月前
|
Python
python tkinter 界面倒计时(用于监督页面返回)
python tkinter 界面倒计时(用于监督页面返回)
python tkinter 界面倒计时(用于监督页面返回)
|
1天前
|
前端开发 Python
python之【Tkinter模块】
python之【Tkinter模块】
11 5
|
1月前
|
Python
python tkinter 实现简易秒表计时器
python tkinter 实现简易秒表计时器
43 1
|
1月前
|
数据可视化 文件存储 Python
【python】python基于tkinter的学生成绩管理系统(源码+数据文件)【独一无二】(二)
【python】python基于tkinter的学生成绩管理系统(源码+数据文件)【独一无二】(二)
|
4月前
|
Python
python tkinter 最简洁的计算器按钮排列
python tkinter 最简洁的计算器按钮排列
44 0
|
1月前
|
存储 数据可视化 Python
【python】python tkinter 计算器GUI版本(模仿windows计算器 源码)【独一无二】
【python】python tkinter 计算器GUI版本(模仿windows计算器 源码)【独一无二】
|
2月前
|
Python
在Python中,`tkinter`是一个用于创建图形用户界面(GUI)的标准库。
在Python中,`tkinter`是一个用于创建图形用户界面(GUI)的标准库。
|
1月前
|
存储 数据可视化 数据挖掘
【Python】Tkinter电器销售有限公司销售数据分析(源码)【独一无二】
【Python】Tkinter电器销售有限公司销售数据分析(源码)【独一无二】
|
1月前
|
存储 数据可视化 UED
【Python】Tkinter超市商品选购系统 [简易版] (源码)【独一无二】
【Python】Tkinter超市商品选购系统 [简易版] (源码)【独一无二】
|
1月前
|
存储 Python
【python】python基于tkinter的学生成绩管理系统(源码+数据文件)【独一无二】(一)
【python】python基于tkinter的学生成绩管理系统(源码+数据文件)【独一无二】(一)