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.
 
cascade(self)
Cascade window placement (from the top left screen corner).
 
close(self)
Close this window (by a click of the close button).
 
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.
 
windowCloseOK_(self)
Is it OK? to close window callback.
 
windowClose_(self)
Closing 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.
 
zoom(self, zoom)
Toggle, zoom or un-zoom this window.

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
  NSview
Get this window's NS view (NSView...).
  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).
  isZoomed
Get this window's zoomed state (bool).
  ratio
Get this window's aspect ratio as 2-tuple (width, height).

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

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.

zoom(self, zoom)

 

Toggle, zoom or un-zoom this window.

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

Property Details

NSview

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

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

frame

Get this window's frame (Rect).

Get Method:
frame(self) - Get this window's frame (Rect).

isFull

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

Get Method:
isFull(self) - Get this window's full screen state (bool).

isHidden

Get this window's hidden state (bool).

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

isKey

Get this window's Key state (bool).

Get Method:
isKey(self) - Get this window's Key state (bool).

isMain

Get this window's Main state (bool).

Get Method:
isMain(self) - Get this window's Main state (bool).

isVisible

Get this window's visible state (bool).

Get Method:
isVisible(self) - Get this window's visible state (bool).

isZoomed

Get this window's zoomed state (bool).

Get Method:
isZoomed(self) - Get this window's zoomed state (bool).

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.