Package pycocoa :: Module windows :: Class Window
[frames] | no frames]

Class Window

  object --+            
           |            
bases._Type0 --+        
               |        
    bases._Type1 --+    
                   |    
        bases._Type2 --+
                       |
                      Window
Known Subclasses:

Basic window Python Type, wrapping ObjC NSWindow.

Instance Methods
 
__init__(self, title='Main', frame=None, excl=0, auto=False, **kwds)
Create a new Window.
 
close(self)
Close this window (by a click of the close button).
 
cascade(self)
Cascade window placement (from the top left screen corner).
 
front(self, focus=False)
Order this window to the front.
 
full(self, full)
Enter or exit full screen mode for this window.
 
hide(self, hide)
Hide or unhide this window.
 
limit(self, width=3840, height=4160)
Limit this window's content size.
 
zoom(self, zoom)
Toggle, zoom or un-zoom this window.
 
windowClose_(self)
Closing window callback.
 
windowCloseOK_(self)
Is it OK? to close window callback.
 
windowKey_(self, key)
Callback window becomes/resigns Key.
 
windowMain_(self, main)
Callback window becomes/resigns Main.
 
windowPrint_(self)
Print window callback.
 
windowResize_(self)
Resizing window callback.
 
windowZoomOK_(self, 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
  frame
Get this window's frame (Rect).
  isFull
Get this window's full screen state (bool).
  isHidden
Get this window's hidden state (bool).
  isKey
Get this window's Key state (bool).
  isMain
Get this window's Main state (bool).
  isVisible
Get this window's visible state (bool).
  isPrintable
Get this window's printable state (bool).
  isZoomed
Get this window's zoomed state (bool).
  NSview
Get this window's view (NSView...).
  PMview
Get this window's print view (NSView...).
  ratio
Get this window's aspect ratio as 2-tuple (width, height).

Inherited from bases._Type2: title

Inherited from bases._Type1: NSdelegate, app

Inherited from bases._Type0: NS, NSDelegate

Inherited from object: __class__

Method Details

__init__(self, title='Main', frame=None, excl=0, auto=False, **kwds)
(Constructor)

 

Create a new Window.

Parameters:
  • title - Window title (str).
  • frame - Window frame (Rect, NSRect_t, NSRect4_t, or None).
  • excl - Window styles to exclude (WindowStyle.attribute).
  • auto - Release window resource when closed (bool).
  • kwds - Optional, additional keyword arguments.
Raises:
Overrides: object.__init__

close(self)

 

Close this window (by a click of the close button).

Note: The .windowWillClose_ action is invoked iff .windowShouldClose_ returns True.

front(self, focus=False)

 

Order this window to the front.

Parameters:
  • focus - Make this window Key (bool).

full(self, full)

 

Enter or exit full screen mode for this window.

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

hide(self, hide)

 

Hide or unhide this window.

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

limit(self, width=3840, height=4160)

 

Limit this window's content size.

Parameters:
  • width - Width limit (float or int).
  • height - Height limit (float or int).

zoom(self, zoom)

 

Toggle, zoom or un-zoom this window.

Parameters:
  • zoom - Zoom or un-zoom (bool) or None to toggle.

windowCloseOK_(self)

 

Is it OK? to close window callback.

Returns:
True if OK to close, False otherwise.

windowKey_(self, key)

 

Callback window becomes/resigns Key.

Parameters:
  • key - Make or un-make Key (bool).

windowMain_(self, main)

 

Callback window becomes/resigns Main.

Parameters:
  • main - Make or un-make Main (bool).

windowZoomOK_(self, 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

frame

Get this window's frame (Rect).

Get Method:
frame(self) - Get this window's frame (Rect).
Set Method:
Read_Only(self, ignored) - Throws an AttributeError, always.

isFull

Get this window's full screen state (bool).

Get Method:
isFull(self) - Get this window's full screen state (bool).
Set Method:
Read_Only(self, ignored) - Throws an AttributeError, always.

isHidden

Get this window's hidden state (bool).

Get Method:
isHidden(self) - Get this window's hidden state (bool).
Set Method:
Read_Only(self, ignored) - Throws an AttributeError, always.

isKey

Get this window's Key state (bool).

Get Method:
isKey(self) - Get this window's Key state (bool).
Set Method:
Read_Only(self, ignored) - Throws an AttributeError, always.

isMain

Get this window's Main state (bool).

Get Method:
isMain(self) - Get this window's Main state (bool).
Set Method:
Read_Only(self, ignored) - Throws an AttributeError, always.

isVisible

Get this window's visible state (bool).

Get Method:
isVisible(self) - Get this window's visible state (bool).
Set Method:
Read_Only(self, ignored) - Throws an AttributeError, always.

isPrintable

Get this window's printable state (bool).

Get Method:
isPrintable(self) - Get this window's printable state (bool).
Set Method:
Read_Only(self, ignored) - Throws an AttributeError, always.

isZoomed

Get this window's zoomed state (bool).

Get Method:
isZoomed(self) - Get this window's zoomed state (bool).
Set Method:
Read_Only(self, ignored) - Throws an AttributeError, always.

NSview

Get this window's view (NSView...).

Get Method:
NSview(self) - Get this window's view (NSView...).
Set Method:
NSview(self, ns_view) - Set this window's view (NSView...).

PMview

Get this window's print view (NSView...).

Get Method:
PMview(self) - Get this window's print view (NSView...).
Set Method:
PMview(self, ns_view) - Set this window's print view (NSView...).

ratio

Get this window's aspect ratio as 2-tuple (width, height).

Get Method:
ratio(self) - Get this window's aspect ratio as 2-tuple (width, height).
Set Method:
ratio(self, ratio) - Set this window's aspect ratio.