NFLmusic库文件
This commit is contained in:
21
nflmusic/label_button.py
Normal file
21
nflmusic/label_button.py
Normal file
@ -0,0 +1,21 @@
|
||||
from tkinter import Label, ttk
|
||||
|
||||
Button = ttk.Button
|
||||
Label = ttk.Label
|
||||
|
||||
class LabelButton:
|
||||
def __init__(self, pack_box, label, button, command):
|
||||
self.pack_box = pack_box
|
||||
self.label_text = label
|
||||
self.button_text = button
|
||||
self.click_event = command
|
||||
self.button = Button(self.pack_box, text=self.button_text, command=command, style='info.Link.TButton')
|
||||
self.label = Label(self.pack_box, text=self.label_text)
|
||||
|
||||
def place(self, button, label):
|
||||
self.button.place(x=button[0], y=button[1])
|
||||
self.label.place(x=label[0], y=label[1])
|
||||
|
||||
def place_forget(self):
|
||||
self.button.place_forget()
|
||||
self.label.place_forget()
|
Reference in New Issue
Block a user