Full-screen Python TKinter or wxPython window, but stay below all windows?

I want to create a full-screen panel that visually blocks access to everything on the screen (desktop, menu, Unity panel, etc. in Ubuntu (11.10)), but remains below the open application windows.

This is mainly in order to make the child a laptop proof. I want the child (4 years old) to have access to some selected applications, i.e. gcompris, a children's game, tux math, etc., but not quite for other applications and settings. Something like a custom desktop bar + launcher without any hacks, without access to files, etc.

I want the panel to contain some buttons that would launch other applications (using subprocess.call), but the panel itself should remain under something that was launched from it, or simplify the task so that it remains under any open full-screen games and each open window (even if the panel is focused).

Python tkinter fullscreen overrideredirect (True) would be ideal (with a password-protected close button), if not for the fact that it does not allow other applications to appear above it, and I'm not sure that you can do this at the bottom of everything.

Any idea how to change this behavior, if possible, or any other tools that would allow me to do this in python or otherwise?

Edit: additional information:

, overrideredirect (True). () , overrideredirect (True), . :

from tkinter import *

def btn1_click():app.quit();app.destroy()
def btn2_click():app.lower()    
def handler():
    if tkinter.messagebox.askyesno("Quit?", "Are you sure you want to quit?"):
        app.quit();app.destroy()

app = Tk()
app.title("Testing...")
app.geometry('300x100+200+100')
#app.overrideredirect(True) 
#app.lower()

b1 = Button(app, text = "Exit!", width = 10, command = btn1_click);b1.pack()
b2 = Button(app, text = "Lower", width = 10, command = btn2_click);b2.pack()
app.protocol("WM_DELETE_WINDOW", handler)
app.mainloop()

, , "" , app.overrideredirect(True) , .

... , , :

>>>help(tkinter)
...
     |  overrideredirect = wm_overrideredirect(self, boolean=None)
     |      Instruct the window manager to ignore this widget
     |      if BOOLEAN is given with 1. Return the current value if None
     |      is given.
...

, , , wm - ... hypcrracy:)

, wm ?

. - wxPython

, Boa Constructor. app.lower() Tkinter, - wxPython. - Gedit , 2 , 2 , , Ubuntu.

def OnButton3Button(self, event):
    subprocess.call("gedit") #opens gedit above the Frame
    time.sleep(2) #waits for 2 seconds
    self.Raise() #brings the Frame to the top
    time.sleep(2) #waits for another 2 seconds
    self.Lower() #should Lower the Frame to the bottom, but it doesn't

Lower(), , :.

def OnFrame1Activate(self, event):
    self.ShowFullScreen(True)

def OnFrame1EnterWindow(self, event):
    self.Lower()

, , , .

+5
1

pygame . , -1 1, , , .

import pygame, time, datetime, ctypes
from pygame.locals import *
from ctypes import windll

pygame.init()
set_window_pos = windll.user32.SetWindowPos
monitorsize = ctypes.windll.user32
resolution_X = monitorsize.GetSystemMetrics(0)
resolution_Y = monitorsize.GetSystemMetrics(1)

screen = pygame.display.set_mode((255, 242), pygame.NOFRAME)
set_window_pos(pygame.display.get_wm_info()['window'], -1, (resolution_X - 255), 50, 0, 0, 0x0001)

FULLSCREEN

screen = pygame.display.set_mode((800, 350), FULLSCREEN) # this works in linux
+2

All Articles