pycocoa.windows

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

# Module windows

Types AutoResize, Window, MediaWindow, Screen, WindowStyle, wrapping ObjC `NSWindow`, etc.

Version: 25.04.03

Classes
| AutoResizeError `AutoResize` option error.
| Window Basic window Python Type, wrapping ObjC `NSWindow`.
| WindowError Window error.
| WindowStyleError Window style error.
| MediaWindow Media window Python Type, wrapping ObjC `NSWindow/NSView`.
| TextWindow Scrollable text window Python Type, wrapping ObjC `NSWindow/NSView`.

Functions
autoResizes(*options) Return a combination of auto resize options, specified by name. |
windowStyles(*styles) Return a combination of window styles, specified by name. |
ns2Window(ns) Get the Window instance for an ObjC `NSWindow` or `NSNotification` instance. |

Variables
| __all__ = `_ALL_LAZY.windows`
| AutoResize = `AutoResize.HeightSizable=16 or 1<`...`` AutoResize options (`mask`, wrapping `NSAutoresizingMaskOptions`).
| BezelStyle = `BezelStyle.Circular`...`` Bezel style constants (`int`).
| Border = `Border.Bezel`...`` Border type constants (`int`).
| WindowStyle = `WindowStyle.Closable`...`` Window style constants (`mask`).
| NSWindowDelegate = `<ObjCDelegate(_NSWindowDelegate of 0x600000`...``
| AutoResize.HeightSizable 0x10
| AutoResize.MaxXMargin 0x4
| AutoResize.MaxYMargin 0x20
| AutoResize.MinXMargin 0x1
| AutoResize.MinYMargin 0x8
| AutoResize.NotSizable 0x0
| AutoResize.Sizable 0x12
| AutoResize.WidthSizable 0x2
| BezelStyle.Circular 7
| BezelStyle.Disclosure 5
| BezelStyle.HelpButton 9
| BezelStyle.Inline 15
| BezelStyle.Recessed 13
| BezelStyle.RegularSquare 2
| BezelStyle.RoundRect 12
| BezelStyle.Rounded 1
| BezelStyle.RoundedDisclosure 14
| BezelStyle.ShadowlessSquare 6
| BezelStyle.SmallSquare 10
| BezelStyle.TexturedRounded 11
| BezelStyle.TexturedSquare 8
| Border.Bezel 2
| Border.Groove 3
| Border.Line 1
| Border.No 0
| WindowStyle.Closable 0x2
| WindowStyle.Miniaturizable 0x4
| WindowStyle.Resizable 0x8
| WindowStyle.Titled 0x1
| WindowStyle.Typical 0xf
| WindowStyle.Utility 0x10

Function Details

### autoResizes(*options) |
Return a combination of auto resize options, specified by name. Parameters: `options` - Option names (all positional), case-insensitive. Returns: Combined options (AutoResizes `mask`). Raises: `AutoResizeError` - One or more options are invalid.

### windowStyles(*styles) |
Return a combination of window styles, specified by name. Parameters: `styles` - Style names (all positional), case-insensitive. Returns: Combined styles (WindowStyles `mask`). Raises: `WindowStyleError` - One or more styles are invalid.

### ns2Window(ns) |
Get the Window instance for an ObjC `NSWindow` or `NSNotification` instance. Parameters: `ns` - The ObjC instance (`NS...`). Returns: The window instance (Window). Raises: `AttributeError` - Unexpected ns type. `RuntimeError` - Window mismatch. `TypeError` - Invalid ns type.

Variables Details

  ### AutoResize AutoResize options (`mask`, wrapping `NSAutoresizingMaskOptions`). Value:
      AutoResize.HeightSizable=16 or 1<<4,
                .MaxXMargin=4 or 1<<2,
                .MaxYMargin=32 or 2<<4,
                .MinXMargin=1,
                .MinYMargin=8 or 2<<2,
                .NotSizable=0,
                .Sizable=18,
                .WidthSizable=2

  ### BezelStyle Bezel style constants (`int`). Value:
      BezelStyle.Circular=7,
                .Disclosure=5,
                .HelpButton=9,
                .Inline=15,
                .Recessed=13,
                .RegularSquare=2,
                .Rounded=1,
                .RoundedDisclosure=14,
      ...

  ### Border Border type constants (`int`). Value:
      Border.Bezel=2,
            .Groove=3,
            .Line=1,
            .No=0

  ### WindowStyle Window style constants (`mask`). Value:
      WindowStyle.Closable=2,
                 .Miniaturizable=4 or 1<<2,
                 .Resizable=8 or 2<<2,
                 .Titled=1,
                 .Typical=15,
                 .Utility=16 or 1<<4

  ### NSWindowDelegate Value:
      <ObjCDelegate(_NSWindowDelegate of 0x600000262cd0) at 0x7fe8201827d0>