I am having problems trying to display a default tkinter askyesno dialog on top of my main window, which has no borders( I am using overrideredirect(1)
). Having a borderless window is a must in my case.
The dialog always opens behind the main window. Creating a custom dialog, also borderless seems to work, but I am wandering if there is a way to make the default askYesNo dialog appear on top of a borderless window. I am running the code on Raspbian (a version of Debian).
The python code is attached below:
from Tkinter import *
from tkMessageBox import *
def imageLabelPressed():
print("Call button pressed")
selected = lb.get(whichSelected())
if (askyesno("Call", "Do you want to call %s?" % (selected) )):
print("Call started")
else:
print("Cancel call")
win = Tk()
win.geometry('800x480')
backgroundImg = PhotoImage(file = "background.png")
backgroundLabel = Label(win, image = backgroundImg)
backgroundLabel.place(x=0, y=0, relwidth=1, relheight=1)
lb=Listbox(win, height=9)
lb.pack(side = LEFT, fill = BOTH, expand = 1)
callImage = PhotoImage(file = "callButton.png")
dButt = Label(win, text = "Some text", relief = FLAT, highlightthickness = 0, border = 0, image = callImage)
dButt.bind("<Button-1>", imageLabelPressed)
dButt.pack()
win.overrideredirect(1)
mainloop()
Thanks!