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

Class Window

          object --+                
                   |                
internals._Objectype --+            
                       |            
        baseTypes._Type0 --+        
                           |        
            baseTypes._Type1 --+    
                               |    
                baseTypes._Type2 --+
                                   |
                                  Window
Known Subclasses:

Basic window Python Type, wrapping ObjC NSWindow.

Instance Methods
 
__init__(self, title='Main', screen=None, fraction=0.5, 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)
Callback Is it OK to close window?
 
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.
 
windowScreen_(self, change)
Called window when screen or screen profile changed Main.
 
windowZoomOK_(self, frame=None)
Callback Is it OK to zoom window?

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
  alpha
Get this window's alpha value (float).
  frame
Get this window's frame (Rect).
  isBuiltIn
Is this window's screen built-in (bool or None if unknown)?
  isExternal
Is this window's screen external (bool or None if unknown)?
  isFull
Get this window's full screen mode or zoomed state (bool or None if unknown).
  isFullScreen
Get this window's full screen mode (bool or None if unknown).
  isHidden
Get this window's hidden state (bool).
  isKey
Get this window's Key state (bool).
  isMain
Get this window's Main state (bool).
  isPrintable
Get this window's printable state (bool).
  isVisible
Get this window's visible state (bool).
  isZoomed
Get this window's zoomed state (bool).
  NSview
Get this window's view (NSView...).
  opaque
Get this window's opaque setting (bool).
  PMview
Get this window's print view (NSView...).
  ratio
Get this window's contents' aspect ratio (2-tuple (w, h)).
  screen
Get the screen of this window (Screen) or None if this window is off-screen.
  transparent
Has this window been made transparent (bool)?
  transparentTitlebar
Is this window's title bar transparent (bool)?

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='Main', screen=None, fraction=0.5, frame=None, excl=0, auto=False, **kwds)
(Constructor)

 

Create a new Window.

Parameters:
  • title - Window title (str).
  • screen - The screen to place the window on (int) or None for the current one. Use screen=0 for the built-in screen or screen=1 for the first external monitor, etc.
  • fraction - Window size as fraction of the screen (float), defining the window frame.
  • frame - The window's origin and content size (Rect, NSRect_t, NSRect4_t), overriding fraction.
  • 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 - Use True to zoom, False to un-zoom or None to toggle.

windowCloseOK_(self)

 

Callback Is it OK to close window?

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

windowScreen_(self, change)

 

Called window when screen or screen profile changed Main.

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

Note: Typically, changing screen involves 2 callback invokations, once for the profile and once for the screen.

windowZoomOK_(self, frame=None)

 

Callback Is it OK to zoom window?

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

Property Details

alpha

Get this window's alpha value (float).

Get Method:
alpha(self) - Get this window's alpha value (float).
Set Method:
alpha(self, alpha) - Set this window's alpha value (float, 0.0..1.0).

frame

Get this window's frame (Rect).

Get Method:
frame(self) - Get this window's frame (Rect).
Set Method:
frame(self, frame) - Set the frame of this window (Rect, NSRect_t, NSRect4_t, or None).

isBuiltIn

Is this window's screen built-in (bool or None if unknown)?

Get Method:
isBuiltIn(self) - Is this window's screen built-in (bool or None if unknown)?
Set Method:
Read_Only(inst, value) - Throws an AttributeError, always.

isExternal

Is this window's screen external (bool or None if unknown)?

Get Method:
isExternal(self) - Is this window's screen external (bool or None if unknown)?
Set Method:
Read_Only(inst, value) - Throws an AttributeError, always.

isFull

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

Get Method:
isFull(self) - Get this window'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 window's full screen mode (bool or None if unknown).

Get Method:
isFullScreen(self) - Get this window's full screen mode (bool or None if unknown).
Set Method:
Read_Only(inst, value) - 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(inst, value) - 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(inst, value) - 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(inst, value) - 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(inst, value) - 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(inst, value) - 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(inst, value) - 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...).

opaque

Get this window's opaque setting (bool).

Get Method:
opaque(self) - Get this window's opaque setting (bool).
Set Method:
opaque(self, opaque) - Make this window opaque or not (bool).

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 contents' aspect ratio (2-tuple (w, h)).

Get Method:
ratio(self) - Get this window's contents' aspect ratio (2-tuple (w, h)).
Set Method:
ratio(self, ratio) - Set this window's contents' aspect ratio.

screen

Get the screen of this window (Screen) or None if this window is off-screen.

Get Method:
screen(self) - Get the screen of this window (Screen) or None if this window is off-screen.
Set Method:
screen(self, screen) - Move this window to an other screen.

transparent

Has this window been made transparent (bool)?

Get Method:
transparent(self) - Has this window been made transparent (bool)?
Set Method:
transparent(self, transparent) - Make this window transparent or undo (bool).

transparentTitlebar

Is this window's title bar transparent (bool)?

Get Method:
transparentTitlebar(self) - Is this window's title bar transparent (bool)?
Set Method:
transparentTitlebar(self, transparent) - Make this window title bar transparent or undo (bool).