ttk

get rid of white border around option menu

我怕爱的太早我们不能终老 提交于 2020-08-27 02:18:16
问题 I'm trying to get rid of the white border around the OptionMenu . What I tried I changed the colour to red, but there is still a white border around it. Can anyone help? Here's the code: from tkinter import * import tkinter as tk from tkinter import ttk root = tk.Tk() root.geometry('500x500') var = StringVar() option = ttk.OptionMenu(root,var,'1','2','3') option["menu"].config(bg="red") option.pack() root.mainloop() Also, is there a way to change the colour of the OptionMenu trigger box (In

get rid of white border around option menu

倖福魔咒の 提交于 2020-08-27 02:18:07
问题 I'm trying to get rid of the white border around the OptionMenu . What I tried I changed the colour to red, but there is still a white border around it. Can anyone help? Here's the code: from tkinter import * import tkinter as tk from tkinter import ttk root = tk.Tk() root.geometry('500x500') var = StringVar() option = ttk.OptionMenu(root,var,'1','2','3') option["menu"].config(bg="red") option.pack() root.mainloop() Also, is there a way to change the colour of the OptionMenu trigger box (In

How do I hide the entire tab bar in a tkinter ttk.Notebook widget?

送分小仙女□ 提交于 2020-07-22 21:36:41
问题 How do I hide the tab bar in a ttk Notebook widget? I don't want to hide the frame that belongs to the tab. I just want to remove the tab bar from sight, even where it's not at the top of the screen (for more than one purpose). Anyway, it would be nice for fullscreen mode. 回答1: from the help on tkinter.ttk.Style: layout(self, style, layoutspec=None) Define the widget layout for given style. If layoutspec is omitted, return the layout specification for given style. layoutspec is expected to be

How to install awdark theme into ttk python

末鹿安然 提交于 2020-07-19 06:45:47
问题 I want to have the awdark ttk theme for my app, but I can't figure out how to install it. I found source files here https://sourceforge.net/projects/tcl-awthemes/ but I don't know where to put any of the files. Any help would be much appreciated. I'm on windows 10, python3.8.3 64bit. 回答1: You can load the themes by executing a few tcl commands: Tell tcl where to find awthemes root.tk.eval(""" set base_theme_dir /path/to/downloaded/theme/awthemes-9.2.2/ package ifneeded awthemes 9.2.2 \ [list

How to change the foreground color of ttk.Button when its state is active?

扶醉桌前 提交于 2020-07-09 12:41:05
问题 I have a ttk.Button which color I want to change. I did it in the following way: Style().configure('gray.TButton', foreground='black', background='gray') backButton = Button(self.bottomFrame, text="Back", command=lambda: controller.ShowFrame("StartPage"), style='gray.TButton') backButton.pack(side='left') And it works fine (screenshot): But if this widget in the active mode (mouse cursor within it) it looks bad. Background becomes white so text becomes invisible. Question : How to change text

How to change the foreground color of ttk.Button when its state is active?

匆匆过客 提交于 2020-07-09 12:39:05
问题 I have a ttk.Button which color I want to change. I did it in the following way: Style().configure('gray.TButton', foreground='black', background='gray') backButton = Button(self.bottomFrame, text="Back", command=lambda: controller.ShowFrame("StartPage"), style='gray.TButton') backButton.pack(side='left') And it works fine (screenshot): But if this widget in the active mode (mouse cursor within it) it looks bad. Background becomes white so text becomes invisible. Question : How to change text