- import objc
- import _uicaboodle
- from objc import YES, NO, NULL, nil
- objc.loadBundle('UIKit', globals(), '/System/Library/Frameworks/UIKit.framework')
- UIApplication = objc.lookUpClass('UIApplication')
- UITable = objc.lookUpClass('UITable')
- UIWindow = objc.lookUpClass('UIWindow')
- UIHardware = objc.lookUpClass('UIHardware')
- UIView = objc.lookUpClass('UIView')
- UINavigationBar = objc.lookUpClass('UINavigationBar')
- UINavigationItem = objc.lookUpClass('UINavigationItem')
- UIPreferencesTable = objc.lookUpClass('UIPreferencesTable')
- UIPreferencesTextTableCell = objc.lookUpClass('UIPreferencesTextTableCell')
- UIPreferencesTableCell = objc.lookUpClass('UIPreferencesTableCell')
- UISectionList = objc.lookUpClass("UISectionList")
- UIImageAndTextTableCell = objc.lookUpClass("UIImageAndTextTableCell")
- class PYApplication(UIApplication):
- def applicationDidFinishLaunching_(self, unused):
- frame = UIHardware.fullScreenApplicationContentRect()
- self.window = UIWindow.alloc().initWithFrame_(frame)
- self.view = UIView.alloc().initWithFrame_(self.window.bounds())
- self.window.setContentView_(self.view)
- self.window.orderFront_(self)
- self.window.makeKey_(self)
- self.window._setHidden_(NO)
- navsize = UINavigationBar.defaultSize()
- navrect = ((0, 0), navsize)
- self.navbar = UINavigationBar.alloc().initWithFrame_(navrect)
- self.view.addSubview_(self.navbar)
- self.navbar.setBarStyle_(1)
- self.navbar.setDelegate_(self)
- navitem = UINavigationItem.alloc().initWithTitle_(u"Network Information")
- self.navbar.pushNavigationItem_(navitem)
- bounds = self.view.bounds()
- tblrect = ((0, navsize[1]), (bounds[1][0], bounds[1][1] - navsize[1]))
- self.secList = UISectionList.alloc().initWithFrame_(tblrect)
- self.secList.setDataSource_(self)
- self.secList.reloadData()
- col = UITableColumn.alloc().initWithTitle_identifier_width_(u"Name", u"name", 320.0)
- table = self.secList.table()
- table.setSeparatorStyle_(1)
- table.addTableColumn_(col)
- self.view.addSubview_(self.secList)
- def numberOfSectionsInSectionList_(self, sectionList):
- print u"numberOfSectionsInSectionList_", sectionList
- return 0
- def sectionList_titleForSection_(self, sectionList, section):
- print u"sectionList_titleForSection_", sectionList, section
- return u"Title"
- def sectionList_rowForSection_(self, sectionList, section):
- print u"sectionList_rowForSection_", sectionList, section
- return 0
- def numberOfRowsInTable_(self, table):
- print u"numberOfRowsInTable_", table
- return 0
- def table_cellForRow_column_(self, table, row, column):
- print u"table_cellForRow_column_", table, row, column
- cell = UIImageAndTextTableCell.alloc.init()
- cell.setTitle_(u"Test " + row)
- return cell
- def respondsToSelector_(self, selector):
- responds = dir(self).count(selector.replace(":", "_")) > 0
- if not responds:
- print selector
- return responds
- _uicaboodle.UIApplicationMain(['NetInfo'], PYApplication)
You must be logged in to paste new items to the PasteBin
