[PyKDE] KSystemTray and window closing

Sok Ann Yap ysa_arsenal at yahoo.com
Fri Aug 29 02:18:00 BST 2003


Hi there,

May I know how to keep my application from quitting when I close
the main window? The desired result is to let the application to
stay in the system tray and not taking any space in the taskbar.

Here's the code:

from qt import *
from kdecore import *
from kdeui import *
import sys

class MyApp(KUniqueApplication):
    def __init__(self, *args):
        KUniqueApplication.__init__(self, *args)
        self.win = KMainWindow()
        self.tray = KSystemTray(self.win)
        self.win.show()
        self.tray.show()
        
about = KAboutData("test", "Test", "0.1")
KCmdLineArgs.init(sys.argv, about)
app = MyApp()
app.exec_loop()

Thanks!
sayap

__________________________________
Do you Yahoo!?
Yahoo! SiteBuilder - Free, easy-to-use web site design software
http://sitebuilder.yahoo.com




More information about the PyQt mailing list