File: katepart.py

package info (click to toggle)
pykde4 4%3A4.14.0-1
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 30,864 kB
  • ctags: 18,431
  • sloc: python: 2,063; cpp: 327; makefile: 52; sh: 5
file content (43 lines) | stat: -rw-r--r-- 1,199 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
#!/usr/bin/env python

import sys

from PyKDE4.kdecore import *
from PyKDE4.kdeui import *
from PyKDE4.kparts import *

from PyQt4.QtGui import QLabel

class MainWindow (KMainWindow):
    def __init__ (self):
        KMainWindow.__init__(self)

        self.resize(640, 480)

        factory = KLibLoader.self().factory("katepart")
        part = factory.create(self, "KatePart")
        self.setCentralWidget(part.widget())

#--------------- main ------------------
if __name__ == '__main__':

    appName     = "katepart_example"
    catalog     = ""
    programName = ki18n("Kate Part Example")
    version     = "1.0"
    description = ki18n("Example loading a Kate Part")
    license     = KAboutData.License_GPL
    copyright   = ki18n("(c) 2009 Canonical Ltd")
    text        = ki18n("none")
    homePage    = "www.kubuntu.org"
    bugEmail    = "jriddell@ubuntu.com"
    
    aboutData   = KAboutData(appName, catalog, programName, version, description,
                                license, copyright, text, homePage, bugEmail)
            
    KCmdLineArgs.init(sys.argv, aboutData)
        
    app = KApplication()
    mainWindow = MainWindow()
    mainWindow.show()
    app.exec_()