From 1511afc4e2921e198c5536deb655232e373f8fb1 Mon Sep 17 00:00:00 2001 From: Andreas Kling Date: Mon, 11 Feb 2019 06:09:54 +0100 Subject: [PATCH] LibGUI: Add GWindow::move_to(). --- Applications/Terminal/main.cpp | 2 ++ LibGUI/GWindow.h | 3 +++ 2 files changed, 5 insertions(+) diff --git a/Applications/Terminal/main.cpp b/Applications/Terminal/main.cpp index c7ad546c8e..9de32b14c5 100644 --- a/Applications/Terminal/main.cpp +++ b/Applications/Terminal/main.cpp @@ -71,6 +71,8 @@ int main(int, char**) Terminal terminal(ptm_fd); window->set_main_widget(&terminal); + window->move_to(300, 300); + GNotifier ptm_notifier(ptm_fd, GNotifier::Read); ptm_notifier.on_ready_to_read = [&terminal] (GNotifier& notifier) { byte buffer[BUFSIZ]; diff --git a/LibGUI/GWindow.h b/LibGUI/GWindow.h index f7d82e1bfd..f959226596 100644 --- a/LibGUI/GWindow.h +++ b/LibGUI/GWindow.h @@ -32,6 +32,9 @@ public: Point position() const { return rect().location(); } + void move_to(int x, int y) { move_to({ x, y }); } + void move_to(const Point& point) { set_rect({ point, size() }); } + virtual void event(GEvent&) override; bool is_visible() const;