I'm trying to achieve a black file dialog box (Mac OS dark mode). I'm using Tkinter filedialog module (import tkinter.filedialog
).
- Mojave (10.14.4) dark mode
- Python 3.6.8
- Tcl/Tk 8.6.8
When I open file dialog from any other app they have black background but when I open it from tkinter.filedailog
they have default white background.
Here is the image of file dialog opened by Tkinter
:
Black file dialog supported by Mojave dark mode when opened from elsewhere:
If there is any way to get the black file dialog box with Tkinter
, Please help me I really want the black dialog box.
sample.py
import tkinter.filedialog as _FD
_Master = _FD.Tk()
_Master.withdraw()
from kivy.core.window import Window as _kivy_window
class Open(_FD.Open):
def __init__(self, multiple=False, **options):
if multiple: options["multiple"]=1
super(Open, self).__init__(**options)
def show(self, **options):
s = super().show(**options)
_kivy_window.raise_window()
return s
if __name__ == "__main__":
from kivy.app import App
from kivy.uix.button import Button
_kivy_window.size = (250, 250)
class TestApp(App):
def open(self, *a):
s = Open(multiple=True)
s = s.show()
if s: print(s)
def build(self):
return Button(text='Hello World', on_release=self.open)
TestApp().run()