Skip to content

Window.LocationChanged

event · Window · cAlgo.API

DesktopCLICloud

This event gets triggered when window location changes

Environment behaviour

CLI — not supported. Never shown: Show, Hide and Close send nothing; IsVisible stays false and window events never fire.

Cloud — not supported. Never shown: Show, Hide and Close send nothing; IsVisible stays false and window events never fire.

Definition

public event Action<WindowLocationChangedEventArgs> LocationChanged;
window.LocationChanged += handler  # handler(obj: WindowLocationChangedEventArgs)

Examples

var window = new Window { Title = "Movable", Width = 300, Height = 200 };
window.LocationChanged += args => Print("Window moved to {0}, {1}", args.Window.Left, args.Window.Top);
window.Show();
def on_start(self):
    window = Window()
    window.Title = "Movable"
    window.LocationChanged += self.on_location_changed
    window.Show()

def on_location_changed(self, args):
    api.Print(f"Window moved to {args.Window.Left}, {args.Window.Top}")