Commits

Ronald Oussoren committed 695147e

Use runEventLoop in examples

Comments (0)

Files changed (4)

pyobjc/Examples/TableModel/TableModel.py

 from Foundation import NSObject
 from AppKit import NSApplicationMain, NSTableDataSource, NSTableViewDelegate
-from PyObjCTools import NibClassBuilder
+from PyObjCTools import NibClassBuilder, AppHelper
 from objc import selector
 import sys
 
         print "shouldSelectRow_", rowIndex
         return (rowIndex % 2)
 
-sys.exit(NSApplicationMain(sys.argv))
+AppHelper.runEventLoop()

pyobjc/Examples/TableModel2/TableModel.py

 import sys
 import os.path
 import AppKit
-from PyObjCTools import NibClassBuilder
+from PyObjCTools import NibClassBuilder, AppHelper
 
 sys.path.insert(0, os.path.join(sys.path[0], "pyobjc"))
 
         print "tableView:shouldSelectRow:", aRow
         return 1
 
-sys.exit(AppKit.NSApplicationMain(sys.argv))
+AppHelper.runEventLoop()

pyobjc/Examples/Todo/main.py

 import objc
 from AppKit import *
 from PyObjCTools.NibClassBuilder import extractClasses
+from PyObjCTools import AppHelper
 
 extractClasses('MainMenu')
 extractClasses('ToDoDocument')
 import ToDoItem
 import TodoAppDelegate
 
-NSApplicationMain(sys.argv)
+AppHelper.runEventLoop()

pyobjc/Examples/iClass/main.py

 """
 import time
 from AppKit import NSApplicationMain
-from PyObjCTools import NibClassBuilder
+from PyObjCTools import NibClassBuilder, AppHelper
 from Foundation import NSBundle
 import sys
 import os
 
 import datasource
 
-NSApplicationMain(sys.argv)
+AppHelper.runEventLoop()
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.