Fixes for MSC.app on High Sierra

This commit is contained in:
Greg Neagle
2017-06-08 18:30:56 -07:00
parent 608e7133e4
commit 0717bf764f
3 changed files with 12 additions and 4 deletions

View File

@@ -18,6 +18,9 @@
# limitations under the License.
# builtin super doesn't work with Cocoa classes in recent PyObjC releases.
from objc import super
from Foundation import *
from AppKit import *

View File

@@ -23,12 +23,12 @@ import munki
import mschtml
import msclib
import msclog
import MSCBadgedTemplateImage
import MunkiItems
from urlparse import urlparse
from AlertController import AlertController
from MSCBadgedTemplateImage import MSCBadgedTemplateImage
from objc import YES, NO, IBAction, IBOutlet, nil
from PyObjCTools import AppHelper

View File

@@ -6,8 +6,12 @@
# Created by Daniel Hazelbaker on 9/2/14.
#
# builtin super doesn't work with Cocoa classes in recent PyObjC releases.
from objc import super
from objc import YES, NO, nil
from Foundation import *
from AppKit import *
class MSCToolbarButton(NSButton):
@@ -26,13 +30,14 @@ class MSCToolbarButton(NSButton):
return view
class MSCToolbarButtonCell(NSButtonCell):
'''Subclass of NSButtonCell which properly works inside of a toolbar item
to allow clicking on the label.'''
def _hitTestForTrackMouseEvent_inRect_ofView_(self, theEvent, rect, controlView):
aPoint = controlView.superview().convertPoint_fromView_(theEvent.locationInWindow(), nil)
def _hitTestForTrackMouseEvent_inRect_ofView_(self, theEvent,
rect, controlView):
aPoint = controlView.superview().convertPoint_fromView_(
theEvent.locationInWindow(), nil)
hit = NO
for v in controlView.superview().subviews():