如何制作自己的移动框并移除框架。
有一个窗口。但他有一个我想删除的框架。
并为移动窗口制作一个字段,但不要将其放在顶部,而是放在底部。
是否有可能做到这一点?如何?
nain.py
from tkinter import *
from tkinter import filedialog
from turtle import title
from pygame import mixer #pip install pygame
class MusicPlayer:
def __init__(self, window ):
g = 0
text = 'Pause'
window.geometry('330x110'); window.title('Это нужно убрать!'); window.resizable(0,0)
Load = Button(window, relief='flat', text = 'Load', bg = 'black', fg = 'white', width = 10, font = ('Comic', 10), command = self.load)
Play = Button(window, relief='flat', text = 'Play', bg = 'black', fg = 'white', width = 10,font = ('Comic', 10), command = self.play)
Pause = Button(window,relief='flat', text = text, bg = 'black', fg = 'white', width = 10, font = ('Comic', 10), command = self.pause)
Stop = Button(window ,relief='flat', text = 'Stop', bg = 'black', fg = 'white', width = 10, font = ('Comic', 10), command = self.stop)
Title = Label(text = 'Alis',bg = 'black', fg = 'white')
X = Button(window ,text = '×',relief='flat', bg = 'black', fg = 'white', width = 1, font = ('Times', 20), command = self.exit)
Load.place(x=0,y=20);Play.place(x=110,y=20);Pause.place(x=220,y=20);Stop.place(x=110,y=60);X.place(x=305,y=70);Title.place(x=0,y=90)
self.music_file = False
self.playing_state = False
def load(self):
self.music_file = filedialog.askopenfilename()
def play(self):
if self.music_file:
mixer.init()
mixer.music.load(self.music_file)
mixer.music.play()
def pause(self):
if not self.playing_state:
mixer.music.pause()
self.playing_state=True
self.text = 'Play'
else:
mixer.music.unpause()
self.playing_state = False
def stop(self):
mixer.music.stop()
def exit(self):
root.destroy()
root = Tk()
app= MusicPlayer(root)
root.lift()
root.wm_attributes("-topmost", True)
root.wm_attributes('-alpha',0.8)
root['bg'] = 'black'
root.mainloop()

试试这样: