I have pygame and tkinter windows in a program running Python on raspberry Pi. when tkinter opens one or more windows, the pygame window is then obviously sent to back (covered by the tkinter windows) How can I bring the pygame window to front programatically (from a menu in tkinter), so that it would show on top of all other windows again? The pygame window is open and updated all the time...
I tried a short subroutine:
import pygame
def subroutine():
pygame.display.quit()
pygame.set_mode(...)
return
it worked in bringing up the pygame screen to front, but when calling from tkinter to open one of the windows, Python simply closes everything (including the open source program) and leaves only the Shell and stops.
if I DO NOT call the subroutine, everything seems to be working normal, i.e. I open the same windows repeatedly from tkinter and everything works...
This is very surprising...
I am not sure if I should post the program, because it is rather long (4000 lines).
The subroutine which crashes is this one:
from tkinter import Tk
def show_Flight_A():
global Flight_A,Inflight_Main_SCR,Inflight_Main_TTL
try:
Flight_A.destroy()
except:
pass
Flight_A=Tk()
Flight_A.geometry(Inflight_Main_SCR)
Flight_A.title(Inflight_Main_TTL )
Flight_A_Init()
Flight_A.overrideredirect(True)
Flight_A.update()
return