S or /

SourceEnum ViewportCommand

from egui import ViewportCommand
ViewportCommand.CancelClose
ViewportCommand.Close
ViewportCommand.Focus
ViewportCommand.RequestCopy
ViewportCommand.RequestCut
ViewportCommand.RequestPaste
ViewportCommand.StartDrag

An output viewport-command from egui to the backend, e.g. to change the window title or size.

You can send a ViewportCommand to the viewport with Context.send_viewport_cmd.

See egui.viewport for how to build new viewports (native windows).

All coordinates are in logical points.

ViewportCommand is essentially a way to diff ViewportBuilders.

Only commands specific to a viewport are part of ViewportCommand. Other commands should be put in egui.OutputCommand.

Variants§

ViewportCommand.CancelClose Enum value§

ViewportCommand.Close Enum value§

ViewportCommand.Focus Enum value§

ViewportCommand.RequestCopy Enum value§

ViewportCommand.RequestCut Enum value§

ViewportCommand.RequestPaste Enum value§

ViewportCommand.StartDrag Enum value§

Methods§

@staticmethod def BeginResize(direction: ResizeDirection) -> ViewportCommand§
@staticmethod def ContentProtected(value: bool) -> ViewportCommand§
@staticmethod def CursorGrab(grab: CursorGrab) -> ViewportCommand§
@staticmethod def CursorPosition(pos: Pos2) -> ViewportCommand§
@staticmethod def CursorVisible(value: bool) -> ViewportCommand§
@staticmethod def Decorations(value: bool) -> ViewportCommand§
@staticmethod def EnableButtons(close: bool, minimized: bool, maximize: bool) -> ViewportCommand§
@staticmethod def Fullscreen(value: bool) -> ViewportCommand§
@staticmethod def IMEAllowed(allowed: bool) -> ViewportCommand§
@staticmethod def IMEPurpose(purpose: IMEPurpose) -> ViewportCommand§
@staticmethod def IMERect(rect: Rect) -> ViewportCommand§
@staticmethod def Icon(icon: Any |None) -> ViewportCommand§
@staticmethod def InnerSize(size: Vec2) -> ViewportCommand§
@staticmethod def MaxInnerSize(size: Vec2) -> ViewportCommand§
@staticmethod def Maximized(value: bool) -> ViewportCommand§
@staticmethod def MinInnerSize(size: Vec2) -> ViewportCommand§
@staticmethod def Minimized(value: bool) -> ViewportCommand§
@staticmethod def MousePassthrough(value: bool) -> ViewportCommand§
@staticmethod def OuterPosition(pos: Pos2) -> ViewportCommand§
@staticmethod def RequestUserAttention(attention_type: UserAttentionType) -> ViewportCommand§
@staticmethod def Resizable(value: bool) -> ViewportCommand§
@staticmethod def ResizeIncrements(size: Vec2 |None) -> ViewportCommand§
@staticmethod def Screenshot(user_data: UserData) -> ViewportCommand§
@staticmethod def SetMonitor(index: int) -> ViewportCommand§
@staticmethod def SetTheme(theme: SystemTheme) -> ViewportCommand§
@staticmethod def Title(title: str) -> ViewportCommand§
@staticmethod def Transparent(value: bool) -> ViewportCommand§
@staticmethod def Visible(value: bool) -> ViewportCommand§
@staticmethod def WindowLevel(level: WindowLevel) -> ViewportCommand§
Source@staticmethod def center_on_screen(ctx: Context) -> ViewportCommand |None§

Construct a command to center the viewport on the monitor, if possible.

def kind_name(self, /) -> str§
def monitor(self, /) -> int |None§
Sourcedef requires_parent_repaint(self, /) -> bool§

This command requires the parent viewport to repaint.