Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
top level window
#1
I need to write a code to test a device
but I need my top level window always be at full display, can't be minimized, can't be re-sized
can't be closed
is that possible?
regards
Reply
#2
What you're describing is typically called "kiosk mode". It's commonly used in libraries, or at restaurants for placing orders/displaying menus. If your app is web based, you can simply pass the --kiosk flag to chromium. https://www.danpurdy.co.uk/web-developme...-tutorial/

If you're not web-based, it's also possible. But the flags you need to use will obviously be different depending on which gui toolkit you use.
Reply
#3
Basic example for PyQt5. You can also replace the image background by a solid color with QtGui.QPalette.

#!/usr/bin/python3
import sys
from PyQt5 import QtCore, QtGui, QtWidgets

class Main(QtWidgets.QMainWindow):
    def __init__(self):
        super().__init__()
        desktop = app.desktop().screenGeometry()
        pixmap = QtGui.QPixmap('background.png')
        pixmap = pixmap.scaled(desktop.width(), desktop.height())
        self.splash = QtWidgets.QSplashScreen(pixmap)
        self.splash.setWindowFlags(QtCore.Qt.WindowStaysOnTopHint | QtCore.Qt.FramelessWindowHint)
        self.splash.setCursor(QtCore.Qt.BlankCursor)
        self.splash.showFullScreen()


if __name__== '__main__':
    app = QtWidgets.QApplication([])
    gui = Main()
    sys.exit(app.exec_())
Reply
#4
(Oct-15-2018, 07:44 PM)nilamo Wrote: What you're describing is typically called "kiosk mode". It's commonly used in libraries, or at restaurants for placing orders/displaying menus. If your app is web based, you can simply pass the --kiosk flag to chromium. https://www.danpurdy.co.uk/web-developme...-tutorial/

If you're not web-based, it's also possible. But the flags you need to use will obviously be different depending on which gui toolkit you use.

> I was out of the country, will check this kiosk mode and let you know my progress.
thanks for your help
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Interaction between Matplotlib window, Python prompt and TKinter window NorbertMoussy 3 490 Mar-17-2024, 09:37 AM
Last Post: deanhystad
  tkinter window and turtle window error 1885 3 6,716 Nov-02-2019, 12:18 PM
Last Post: 1885
  [Tkinter] Top Level Window - from tkinter import * francisco_neves2020 6 4,164 Apr-23-2019, 09:27 PM
Last Post: francisco_neves2020
  [Tkinter] How to determine the stack order or topmost top-level window dan 7 10,695 Jan-24-2018, 05:18 AM
Last Post: dan
  update a variable in parent window after closing its toplevel window gray 5 9,082 Mar-20-2017, 10:35 PM
Last Post: Larz60+

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020