diff options
| author | Michele Calgaro <michele.calgaro@yahoo.it> | 2023-01-03 15:29:41 +0900 | 
|---|---|---|
| committer | Michele Calgaro <michele.calgaro@yahoo.it> | 2023-01-07 22:14:56 +0900 | 
| commit | 4ce11cc30df1805459a615960fdec204a975548a (patch) | |
| tree | 084f1e1fa404bdf0d082b1a58acf392b5d177326 /examples/menudemo.py | |
| parent | 065f41b4908b11278d4334e8c85150ec0fd4a9f6 (diff) | |
| download | pytde-4ce11cc3.tar.gz pytde-4ce11cc3.zip | |
Drop python2 support.
Signed-off-by: Michele Calgaro <michele.calgaro@yahoo.it>
Diffstat (limited to 'examples/menudemo.py')
| -rw-r--r-- | examples/menudemo.py | 33 | 
1 files changed, 11 insertions, 22 deletions
| diff --git a/examples/menudemo.py b/examples/menudemo.py index 460be70..33960a2 100644 --- a/examples/menudemo.py +++ b/examples/menudemo.py @@ -1,6 +1,6 @@  """  This template constructs an application with menus, toolbar and statusbar. -It uses KDE classes and methods that simplify the task of building and +It uses TDE classes and methods that simplify the task of building and  operating a GUI. It is recommended that this approach be used, rather  than the primitive approach in menuapp1.py  """ @@ -35,10 +35,6 @@ copyright holder.  """ -False = 0 -True  = not False - -  import sys  from PyTQt.qt import TQPopupMenu, SIGNAL, TQLabel, TQIconSet @@ -53,7 +49,7 @@ STATUSBAR_RIGHT  = 3  class MainWin (TDEMainWindow):      def __init__ (self, *args): -        apply (TDEMainWindow.__init__, (self,) + args) +        TDEMainWindow.__init__(self, *args)          self.initActions ()          self.initMenus () @@ -106,14 +102,6 @@ class MainWin (TDEMainWindow):          self.actionMenu.insert (KStdAction.zoomIn (self.slotZoomIn, self.actionCollection ()))          self.actionMenu.insert (KStdAction.zoomOut (self.slotZoomOut, self.actionCollection ())) -        # Doesn't work in KDE 2.1.1 -#        self.radio1Action   = TDERadioAction ("Radio 1") -#        self.radio1Action.setExclusiveGroup ("Radio") -#        self.radio2Action   = TDERadioAction ("Radio 2") -#        self.radio2Action.setExclusiveGroup ("Radio") -#        self.radio3Action   = TDERadioAction ("Radio 3") -#        self.radio3Action.setExclusiveGroup ("Radio") -      def initMenus (self):          fileMenu = TQPopupMenu (self)          self.newAction.plug (fileMenu) @@ -272,20 +260,21 @@ class MainWin (TDEMainWindow):  #-------------------- main ------------------------------------------------ -description = "A basic application template" -version     = "1.0" -aboutData   = TDEAboutData ("", "",\ +description = b"A basic application template" +version     = b"1.0" +aboutData   = TDEAboutData (b"MyApp", b"MyApp",\      version, description, TDEAboutData.License_GPL,\ -    "(C) 2003 whoever the author is") +    b"(C) 2003 whoever the author is") -aboutData.addAuthor ("author1", "whatever they did", "email@somedomain") -aboutData.addAuthor ("author2", "they did something else", "another@email.address") +aboutData.addAuthor (b"author1", b"whatever they did", b"email@somedomain") +aboutData.addAuthor (b"author2", b"they did something else", b"another@email.address")  TDECmdLineArgs.init (sys.argv, aboutData) -TDECmdLineArgs.addCmdLineOptions ([("+files", "File to open")]) +TDECmdLineArgs.addCmdLineOptions ([(b"+files", b"File to open")])  app = TDEApplication () -mainWindow = MainWin (None, "main window") +mainWindow = MainWin (None, b"main window") +mainWindow.setGeometry(100, 100, 600, 400)  mainWindow.show()  app.exec_loop() | 
