Skip to content

WindowClosedEventArgs.Window

property · WindowClosedEventArgs · cAlgo.API

DesktopCLICloud

The window the got closed

Environment behaviour

CLI — not supported. Never raised in the CLI: the events that pass it never fire there (Window.Closed).

Cloud — not supported. Never raised in the cloud: the events that pass it never fire there (Window.Closed).

Definition

public Window Window {get;}
windowClosedEventArgs.Window: Window

Returns Window

Examples

protected override void OnStart()
{
    var window = new Window { Title = "Trade Panel", Width = 300, Height = 200 };
    window.Closed += OnWindowClosed;
    window.Show();
}

private void OnWindowClosed(WindowClosedEventArgs args)
{
    Print("Window {0} closed at position ({1}, {2}), stopping", args.Window.Title, args.Window.Left, args.Window.Top);
    Stop();
}
def on_start(self):
    window = Window()
    window.Title = "Trade Panel"
    window.Width = 300
    window.Height = 200
    window.Closed += self.on_window_closed
    window.Show()

def on_window_closed(self, args):
    api.Print(f"Window {args.Window.Title} closed at position ({args.Window.Left}, {args.Window.Top}), stopping")
    api.Stop()