From 8675da558ffbbb8b8ae70c4aa477033c1e8b4834 Mon Sep 17 00:00:00 2001 From: Ashton Fritz Date: Tue, 6 May 2025 20:05:57 -0600 Subject: [PATCH] getting-started: first-application: Updated doc to compile when copied When I found the getting-started docs and started playing around with capy, I noticed that the button example did not compile as it was missing a few things. I added the window variable that was missing along with the backend init and event loop that was referenced in the previous examples. This should now compile with when copied and align with both what the image expects and continue to build on the other examples. Signed-off-by: Ashton Fritz --- docs/getting-started/first-application.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/docs/getting-started/first-application.md b/docs/getting-started/first-application.md index eeb638d..2e786da 100644 --- a/docs/getting-started/first-application.md +++ b/docs/getting-started/first-application.md @@ -69,11 +69,15 @@ const capy = @import("capy"); pub usingnamespace capy.cross_platform; pub fn main() !void { + try capy.init(); + + var window = try capy.Window.init(); window.setPreferredSize(800, 600); try window.set( capy.button(.{ .label = "A Button" }) ); window.show(); + capy.runEventLoop(); } ```