Package pycocoa :: Module apps :: Class App
[frames] | no frames]

Class App

  object --+            
           |            
bases._Type0 --+        
               |        
    bases._Type1 --+    
                   |    
        bases._Type2 --+
                       |
                      App

Python App Type, wrapping an ObjC NSApplication.

Instance Methods
 
__init__(self, title='PyCocao', raiser=False, **kwds)
New App.
 
append(self, menu)
Add a menu to this app's menu bar.
 
full(self, full)
Enter or exit full screen mode for this app.
 
hide(self, hide)
Hide or show this app's main window.
 
hideOther(self, hide)
Hide other or show all apps's windows.
 
run(self, timeout=None)
Run this app (never returns).
 
terminate(self)
Terminate this app (never returns).
 
appLaunched_(self, app)
Callback, the app launched and is up.
 
menuFullScreen_(self, item)
Callback for Full Screen menu item.
 
menuHide_(self, item)
Callback for Hide menu item.
 
menuHideOthers_(self, item)
Callback for Hide Other menu item.
 
menuShowAll_(self, item)
Callback for Show All menu item.
 
menuTerminate_(self, item)
Callback for Quit menu item.
 
windowClose_(self, window)
Closing window callback.
 
windowCloseOK_(self, window)
Is it OK? to close window callback.
 
windowKey_(self, window)
Callback window becomes/resigns Key.
 
windowMain_(self, window)
Callback window becomes/resigns Main.
 
windowPrint_(self, window)
Print window callback.
 
windowResize_(self, window)
Resizing window callback.
 
windowZoomOK_(self, window, frame=None)
Is it OK? to toggle zoom window callback.

Inherited from bases._Type2: __str__

Inherited from bases._Type0: __repr__, type2strepr

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __setattr__, __sizeof__, __subclasshook__

Properties
  badge
Get this app's dock tile/badge (Tile).
  isHidden
Get this app's hidden state (bool).
  isRunning
Get this app's running state (bool).
  isUp
Get this app's launched state (bool).
  keyWindow
Get this app's key window (Window).
  mainWindow
Get this app's main window (Window).
  menubar
Get this app's menu bar (MenuBar).
  raiser
Get raise errors option (bool).

Inherited from bases._Type2: tag, title

Inherited from bases._Type1: NSdelegate, app

Inherited from bases._Type0: NS

Inherited from object: __class__

Method Details

__init__(self, title='PyCocao', raiser=False, **kwds)
(Constructor)

 

New App.

Parameters:
  • title - App name or title ((str)).
  • raiser - Throw exceptions for silent errors (bool).
  • kwds - Optional, additional keyword arguments.
Raises:
  • RuntimeError - Duplicate Apps.
Overrides: object.__init__

append(self, menu)

 

Add a menu to this app's menu bar.

Parameters:
  • menu - The menu to add (Menu).

Note: The first menu item of the bar menu is provided by default.

full(self, full)

 

Enter or exit full screen mode for this app.

Parameters:
  • full - Enter or exit (bool).

hide(self, hide)

 

Hide or show this app's main window.

Parameters:
  • hide - Hide or show (bool).

hideOther(self, hide)

 

Hide other or show all apps's windows.

Parameters:
  • hide - Hide or show (bool).

run(self, timeout=None)

 

Run this app (never returns).

Parameters:
  • timeout - Run time limit in seconds (float).

Note: Although run never returns, any Python threads started earlier continue to run concurrently.

windowCloseOK_(self, window)

 

Is it OK? to close window callback.

Returns:
True if OK to close, False otherwise.

windowZoomOK_(self, window, frame=None)

 

Is it OK? to toggle zoom window callback.

Parameters:
  • frame - The frame to zoom to (Rect).
Returns:
True if OK to toggle, False otherwise.

Property Details

badge

Get this app's dock tile/badge (Tile).

Get Method:
badge(self) - Get this app's dock tile/badge (Tile).

isHidden

Get this app's hidden state (bool).

Get Method:
isHidden(self) - Get this app's hidden state (bool).

isRunning

Get this app's running state (bool).

Get Method:
isRunning(self) - Get this app's running state (bool).

isUp

Get this app's launched state (bool).

Get Method:
isUp(self) - Get this app's launched state (bool).

keyWindow

Get this app's key window (Window).

Get Method:
keyWindow(self) - Get this app's key window (Window).

mainWindow

Get this app's main window (Window).

Get Method:
mainWindow(self) - Get this app's main window (Window).

menubar

Get this app's menu bar (MenuBar).

Get Method:
menubar(self) - Get this app's menu bar (MenuBar).

raiser

Get raise errors option (bool).

Get Method:
raiser(self) - Get raise errors option (bool).
Set Method:
raiser(self, raiser) - Set the raise errors option (bool).