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

Class App

          object --+                
                   |                
internals._Objectype --+            
                       |            
        baseTypes._Type0 --+        
                           |        
            baseTypes._Type1 --+    
                               |    
                baseTypes._Type2 --+
                                   |
                                  App

Python App Type, wrapping an ObjC NSApplication.

Instance Methods
 
__init__(self, title='PyCocoa', raiser=False, **kwds)
New App.
 
activate(self, active=None, force=True)
Active or de-activate this app.
 
append(self, menu)
Add a menu to this app's menu bar.
 
full(self, full=None)
Enter or exit full screen mode for this app.
 
hide(self, hide=None)
Hide or show this app's windows.
 
hideOther(self, hide)
Hide other or show all other apps' 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.
 
menuOther_(self, item)
Callback for Hide/Show Other 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.
 
windowLast_(self, window)
Callback window becomes Key or Main.
 
windowMain_(self, window)
Callback window becomes/resigns Main.
 
windowPrint_(self, window)
Print window callback.
 
windowResize_(self, window)
Resizing window callback.
 
windowScreen_(self, window, change)
Called when window screen or screen profile changed Main.
 
windowZoomOK_(self, window, frame=None)
Is it OK? to toggle zoom window callback.

Inherited from baseTypes._Type2: __str__

Inherited from baseTypes._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).
  isActive
Get this app's active state (bool or None if unknown).
  isFull
Get this app's full screen mode or zoomed state (bool or None if unknown).
  isFullScreen
Get this app's full screen mode (bool or None if unknown).
  isHidden
Get this app's hidden state (bool or None if unknown).
  isRunning
Get this app's running state (bool or None if unknown).
  isUp
Get this app's launched state (bool).
  isVisible
Get this apps's visible state (bool or None if unknown).
  isZoomed
Get this apps's zoomed state (bool or None if unknown).
  keyWindow
Get this app's key window (Window) or None.
  lastWindow
Get this app's most recent key or main window (Window).
  mainWindow
Get this app's main window (Window) or None.
  menubar
Get this app's menu bar (MenuBar).
  raiser
Get raise errors option (bool).
  window
Get this app's window (Window) or None.

Inherited from baseTypes._Type2: title

Inherited from baseTypes._Type1: NSdelegate, app

Inherited from baseTypes._Type0: NS, NSDelegate

Inherited from internals._Objectype: typename

Inherited from object: __class__

Method Details

__init__(self, title='PyCocoa', 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__

activate(self, active=None, force=True)

 

Active or de-activate this app.

Parameters:
  • active - Activate or de-activate (bool or None).
  • force - Activate regardless of current state (bool).
Returns:
Previous isActive state (bool or None if unknown).

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=None)

 

Enter or exit full screen mode for this app.

Parameters:
  • full - Enter or exit (bool or None for unchanged).
Returns:
Full screen mode (bool or None if unknown).

hide(self, hide=None)

 

Hide or show this app's windows.

Parameters:
  • hide - Hide or show (bool or None for unchanged).
Returns:
Previous isHidden state (bool or None if unknown).

hideOther(self, hide)

 

Hide other or show all other apps' 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.

windowScreen_(self, window, change)

 

Called when window screen or screen profile changed Main.

Parameters:
  • change - True if the screen or False if the profile changed (bool).

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).
Set Method:
Read_Only(inst, value) - Throws an AttributeError, always.

isActive

Get this app's active state (bool or None if unknown).

Get Method:
isActive(self) - Get this app's active state (bool or None if unknown).
Set Method:
Read_Only(inst, value) - Throws an AttributeError, always.

isFull

Get this app's full screen mode or zoomed state (bool or None if unknown).

Get Method:
isFull(self) - Get this app's full screen mode or zoomed state (bool or None if unknown).
Set Method:
Read_Only(inst, value) - Throws an AttributeError, always.

isFullScreen

Get this app's full screen mode (bool or None if unknown).

Get Method:
isFullScreen(self) - Get this app's full screen mode (bool or None if unknown).
Set Method:
Read_Only(inst, value) - Throws an AttributeError, always.

isHidden

Get this app's hidden state (bool or None if unknown).

Get Method:
isHidden(self) - Get this app's hidden state (bool or None if unknown).
Set Method:
Read_Only(inst, value) - Throws an AttributeError, always.

isRunning

Get this app's running state (bool or None if unknown).

Get Method:
isRunning(self) - Get this app's running state (bool or None if unknown).
Set Method:
Read_Only(inst, value) - Throws an AttributeError, always.

isUp

Get this app's launched state (bool).

Get Method:
isUp(self) - Get this app's launched state (bool).
Set Method:
Read_Only(inst, value) - Throws an AttributeError, always.

isVisible

Get this apps's visible state (bool or None if unknown).

Get Method:
isVisible(self) - Get this apps's visible state (bool or None if unknown).
Set Method:
Read_Only(inst, value) - Throws an AttributeError, always.

isZoomed

Get this apps's zoomed state (bool or None if unknown).

Get Method:
isZoomed(self) - Get this apps's zoomed state (bool or None if unknown).
Set Method:
Read_Only(inst, value) - Throws an AttributeError, always.

keyWindow

Get this app's key window (Window) or None.

Get Method:
keyWindow(self) - Get this app's key window (Window) or None.
Set Method:
Read_Only(inst, value) - Throws an AttributeError, always.

lastWindow

Get this app's most recent key or main window (Window).

Get Method:
lastWindow(self) - Get this app's most recent key or main window (Window).
Set Method:
Read_Only(inst, value) - Throws an AttributeError, always.

mainWindow

Get this app's main window (Window) or None.

Get Method:
mainWindow(self) - Get this app's main window (Window) or None.
Set Method:
Read_Only(inst, value) - Throws an AttributeError, always.

menubar

Get this app's menu bar (MenuBar).

Get Method:
menubar(self) - Get this app's menu bar (MenuBar).
Set Method:
Read_Only(inst, value) - Throws an AttributeError, always.

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).

window

Get this app's window (Window) or None.

Get Method:
window(self) - Get this app's window (Window) or None.
Set Method:
window(self, window) - Re/set this app's window (Window) or None.