本文整理匯總了Python中AppKit.NSBundle.alloc方法的典型用法代碼示例。如果您正苦於以下問題:Python NSBundle.alloc方法的具體用法?Python NSBundle.alloc怎麽用?Python NSBundle.alloc使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類AppKit.NSBundle
的用法示例。
在下文中一共展示了NSBundle.alloc方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: _init_popover
# 需要導入模塊: from AppKit import NSBundle [as 別名]
# 或者: from AppKit.NSBundle import alloc [as 別名]
def _init_popover(self):
print 'init popover'
#import pdb; pdb.set_trace()
rect = NSMakeRect(0, 0, 40, 40)
self.button = NSButton.alloc().initWithFrame_(rect)
self.button.setImage_(self._app['_icon_nsimage'])
self.button.setAction_('mycallback:')
#self.button.setTransparent_(True)
self.button.setBordered_(False)
self.button.setTitle_('W')
self.button.setButtonType_(AppKit.NSMomentaryChangeButton)
print 'BUTTON ', self.nsstatusitem.action
#rect2 = NSMakeRect(0, 0, 100, 100)
self.popover = NSPopover.alloc().init()
#myBundle = NSBundle bundleWithPath:@"/Library/MyBundle.bundle"]
myBundle = NSBundle.alloc().initWithPath_("/Users/pfitzsimmons/repos/webchiver/app/webchiver.bundle")
#view_controller = NSViewController.alloc().initWithNibName_bundle_('SnippetPopoverViewController.nib', myBundle)
view_controller = PopViewController.alloc().init()
#self.popover.setContentViewController_(view_controller)
#self.nsstatusitem.setAction_('mycallback:')
self.nsstatusitem.setView_(self.button)
#import pdb; pdb.set_trace()
rect3 = NSMakeRect(500, 500, 600, 600)
self.window = MyWindow.alloc().initWithContentRect_styleMask_backing_defer_(
rect3,
AppKit.NSBorderlessWindowMask,
#AppKit.NSTexturedBackgroundWindowMask,
NSBackingStoreBuffered,
True
)
self.window.setOpaque_(False)