77import time
88import objc
99
10- from Foundation import *
11- from AppKit import *
10+ from ..lib .cocoa import *
1211
1312from .editor import OutputTextView , EditorView
1413from .widgets import DashboardController , ExportSheet
@@ -114,14 +113,14 @@ def _refresh(self):
114113# `file's owner' in PlotDeviceDocument.xib
115114class ScriptController (NSWindowController ):
116115 # main document window
117- graphicsView = objc . IBOutlet ()
118- outputView = objc . IBOutlet ()
119- editorView = objc . IBOutlet ()
120- statusView = objc . IBOutlet ()
116+ graphicsView = IBOutlet ()
117+ outputView = IBOutlet ()
118+ editorView = IBOutlet ()
119+ statusView = IBOutlet ()
121120
122121 # auxiliary windows
123- dashboardController = objc . IBOutlet ()
124- exportSheet = objc . IBOutlet ()
122+ dashboardController = IBOutlet ()
123+ exportSheet = IBOutlet ()
125124
126125 ## Properties
127126
@@ -301,14 +300,14 @@ def shouldCloseDocument(self):
301300 # Running the script in the main window
302301 #
303302
304- @objc . IBAction
303+ @IBAction
305304 def runScript_ (self , sender ):
306305 # listens for cmd-r
307306 if self .vm .session :
308307 return NSBeep ()
309308 self .runScript ()
310309
311- @objc . IBAction
310+ @IBAction
312311 def runFullscreen_ (self , sender ):
313312 # listens for cmd-shift-r
314313 if not self .fullScreen :
@@ -456,13 +455,13 @@ def _ui_state(self):
456455 #
457456 # Exporting to file(s)
458457 #
459- @objc . IBAction
458+ @IBAction
460459 def exportAsImage_ (self , sender ):
461460 if self .vm .session :
462461 return NSBeep ()
463462 self .exportSheet .beginExport ('image' )
464463
465- @objc . IBAction
464+ @IBAction
466465 def exportAsMovie_ (self , sender ):
467466 if self .vm .session :
468467 return NSBeep ()
@@ -514,7 +513,7 @@ def exportStatus(self, event):
514513 #
515514 # Interrupting the run
516515 #
517- @objc . IBAction
516+ @IBAction
518517 def stopScript_ (self , sender = None ):
519518 # catch command-period
520519 if self .vm .session :
@@ -583,14 +582,14 @@ def crash(self):
583582 #
584583 # Pasteboards
585584 #
586- @objc . IBAction
585+ @IBAction
587586 def copyImageAsPDF_ (self , sender ):
588587 pboard = NSPasteboard .generalPasteboard ()
589588 # graphicsView implements the pboard delegate method to provide the data
590589 pboard .declareTypes_owner_ ([NSPDFPboardType ,NSPostScriptPboardType ,NSTIFFPboardType ], self .graphicsView )
591590
592591
593- @objc . IBAction
592+ @IBAction
594593 def printDocument_ (self , sender ):
595594 op = NSPrintOperation .printOperationWithView_printInfo_ (self .graphicsView , self .printInfo ())
596595 op .runOperationModalForWindow_delegate_didRunSelector_contextInfo_ (
@@ -607,22 +606,22 @@ def printOperationDidRun_success_contextInfo_(self, op, success, info):
607606 #
608607 # Zoom commands, forwarding to the graphics view.
609608 #
610- @objc . IBAction
609+ @IBAction
611610 def zoomIn_ (self , sender ):
612611 if self .fullScreen is not None : return
613612 self .graphicsView .zoomIn_ (sender )
614613
615- @objc . IBAction
614+ @IBAction
616615 def zoomOut_ (self , sender ):
617616 if self .fullScreen is not None : return
618617 self .graphicsView .zoomOut_ (sender )
619618
620- @objc . IBAction
619+ @IBAction
621620 def zoomToTag_ (self , sender ):
622621 if self .fullScreen is not None : return
623622 self .graphicsView .zoomTo_ (sender .tag () / 100.0 )
624623
625- @objc . IBAction
624+ @IBAction
626625 def zoomToFit_ (self , sender ):
627626 if self .fullScreen is not None : return
628627 self .graphicsView .zoomToFit_ (sender )
0 commit comments