summaryrefslogtreecommitdiffstats
path: root/superkaramba/examples/openCloseTheme/1.py
blob: fa659e0e16213cdbc79b151e3bddb307fca49712 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
import dcop
import dcopext
import karamba
from qt import TQString, QCString

def closeTheme(theme):
    dc = dcop.DCOPClient()
    dc.attach()
    dc.registerAs('sk_script')
    apps = dc.registeredApplications()
    for app in apps:
        s = str(app)
        if s[:12] == 'superkaramba':
            d = dcopext.DCOPApp(s, dc)
            d.KarambaIface.closeTheme(theme)

def initWidget(widget):
    karamba.openTheme('2.theme')

def widgetClicked(widget, x, y, button):
    closeTheme('1')