This package contains custom tkinter widgets that might be useful.
pip install tkinterwidgets-
- Transparent background
- Control opacity
tkinterwidgets.Label(master, OPTIONS)Options
- All the options of native
tkinterLabelexceptbg/backgroundsince the background is transparent. opacity- Used to specify the opacity of the contents on a scale of0to1(where0implies transparent and1implies opaque). The default is set to1.transcolor- Used to specify the color to be used to create the transparency effect (you can imagine this as a green screen but of the specified color, make sure that the visible contents of the label do not have this color). The default is set toSystemButtonFace.
Methods
- The following have the same use as that of the corresponding methods in native
tkinterwidgetspackpack_forgetconfig/configuredestroy
- Only
packgeometry manager can be used. - Can not be treated as a
windowinCanvas.create_window()orText.window_create()or any similar usage. - Label might move outside the window when resizing past it in some cases.
from tkinter import * import tkinterwidgets as tkw root=Tk() root.config(bg='yellow') label=Label(root,text='Default Label') label.pack() trans_label=tkw.Label(root,text='tkinterwidgets Label',opacity=0.7) trans_label.pack(pady=10) root.mainloop()