Source code for mmf.utils.mac
r"""Some tools for Mac OS X."""
__all__ = ['get_screen_info', 'has_appkit']
has_appkit = False
try:
from AppKit import NSScreen
from mmf.objects import Container
[docs] def get_screen_info():
r"""Return a list of the current screens."""
screens = []
for i, s in enumerate(NSScreen.screens()):
frame = s.frame()
screens.append(
Container(x=frame.origin.x,
y=frame.origin.y,
w=frame.size.width,
h=frame.size.height))
return screens
has_appkit = True
except ImportError, err:
def _get_screen_info_NO_SCREEN():
r"""No AppKit... no screen info."""
return []
get_screen_info = _get_screen_info_NO_SCREEN