euporie.console.app.Window

class euporie.console.app.Window(content: UIControl | None = None, width: AnyDimension = None, height: AnyDimension = None, z_index: int | None = None, dont_extend_width: FilterOrBool = False, dont_extend_height: FilterOrBool = False, ignore_content_width: FilterOrBool = False, ignore_content_height: FilterOrBool = False, left_margins: Sequence[Margin] | None = None, right_margins: Sequence[Margin] | None = None, scroll_offsets: ScrollOffsets | None = None, allow_scroll_beyond_bottom: FilterOrBool = False, wrap_lines: FilterOrBool = False, get_vertical_scroll: Callable[[Window], int] | None = None, get_horizontal_scroll: Callable[[Window], int] | None = None, always_hide_cursor: FilterOrBool = False, cursorline: FilterOrBool = False, cursorcolumn: FilterOrBool = False, colorcolumns: None | list[ColorColumn] | Callable[[], list[ColorColumn]] = None, align: WindowAlign | Callable[[], WindowAlign] = WindowAlign.LEFT, style: str | Callable[[], str] = '', char: None | str | Callable[[], str] = None, get_line_prefix: GetLinePrefixCallable | None = None)

Container that holds a control.

Parameters:
  • contentUIControl instance.

  • widthDimension instance or callable.

  • heightDimension instance or callable.

  • z_index – When specified, this can be used to bring element in front of floating elements.

  • dont_extend_width – When True, don’t take up more width then the preferred width reported by the control.

  • dont_extend_height – When True, don’t take up more width then the preferred height reported by the control.

  • ignore_content_width – A bool or Filter instance. Ignore the UIContent width when calculating the dimensions.

  • ignore_content_height – A bool or Filter instance. Ignore the UIContent height when calculating the dimensions.

  • left_margins – A list of Margin instance to be displayed on the left. For instance: NumberedMargin can be one of them in order to show line numbers.

  • right_margins – Like left_margins, but on the other side.

  • scroll_offsetsScrollOffsets instance, representing the preferred amount of lines/columns to be always visible before/after the cursor. When both top and bottom are a very high number, the cursor will be centered vertically most of the time.

  • allow_scroll_beyond_bottom – A bool or Filter instance. When True, allow scrolling so far, that the top part of the content is not visible anymore, while there is still empty space available at the bottom of the window. In the Vi editor for instance, this is possible. You will see tildes while the top part of the body is hidden.

  • wrap_lines – A bool or Filter instance. When True, don’t scroll horizontally, but wrap lines instead.

  • get_vertical_scroll – Callable that takes this window instance as input and returns a preferred vertical scroll. (When this is None, the scroll is only determined by the last and current cursor position.)

  • get_horizontal_scroll – Callable that takes this window instance as input and returns a preferred vertical scroll.

  • always_hide_cursor – A bool or Filter instance. When True, never display the cursor, even when the user control specifies a cursor position.

  • cursorline – A bool or Filter instance. When True, display a cursorline.

  • cursorcolumn – A bool or Filter instance. When True, display a cursorcolumn.

  • colorcolumns – A list of ColorColumn instances that describe the columns to be highlighted, or a callable that returns such a list.

  • alignWindowAlign value or callable that returns an WindowAlign value. alignment of content.

  • style – A style string. Style to be applied to all the cells in this window. (This can be a callable that returns a string.)

  • char – (string) Character to be used for filling the background. This can also be a callable that returns a character.

  • get_line_prefix – None or a callable that returns formatted text to be inserted before a line. It takes a line number (int) and a wrap_count and returns formatted text. This can be used for implementation of line continuations, things like Vim “breakindent” and so on.