diff --git a/CNAME b/CNAME new file mode 100644 index 0000000..92f9110 --- /dev/null +++ b/CNAME @@ -0,0 +1 @@ +goki.dev \ No newline at end of file diff --git a/README.md b/README.md new file mode 100644 index 0000000..14a8291 --- /dev/null +++ b/README.md @@ -0,0 +1,3 @@ +# goki.github.io + +This is the website for GoKi ([goki.dev](https://goki.dev)) \ No newline at end of file diff --git a/content/gi/gettingstarted.md b/content/gi/gettingstarted.md index fffdaac..d80c0e2 100644 --- a/content/gi/gettingstarted.md +++ b/content/gi/gettingstarted.md @@ -17,37 +17,39 @@ _Note: this page assumes that you have already installed GoGi by completing the 1. Add the following code to your editor: - package main - - func main() { - // Run the window event loop function as the main function - gimain.Main(func() { - mainrun() - }) - } - - func mainrun() { - // Create a window called My App Window with width 1024 and height 768 - win := gi.NewMainWindow("myapp", "My App Window", 1024, 768) - // Get the viewport within our window - vp := win.WinViewport2D() - // Start a protect update on the viewport - updt := vp.UpdateStart() - // Create a standard frame within the window and make it the main widget - mfr := win.SetMainFrame() - - // Add a label to the main frame with the text "Hello, World!" - label := gi.AddNewLabel(mfr, "label", "Hello, World!") - - // End the protected update on the viewport without a signal. - // Update signals cause things to be redrawn, which is unnecessary at the start - // because it is already drawing everything new. - vp.UpdateEndNoSig(updt) - // Start the event loop that keeps the window rendering. - // This is a blocking call, and it will not return until - // the user quits the app or gi.Quit() is called - win.StartEventLoop() - } + ```go + package main + + func main() { + // Run the window event loop function as the main function + gimain.Main(func() { + mainrun() + }) + } + + func mainrun() { + // Create a window called My App Window with width 1024 and height 768 + win := gi.NewMainWindow("myapp", "My App Window", 1024, 768) + // Get the viewport within our window + vp := win.WinViewport2D() + // Start a protect update on the viewport + updt := vp.UpdateStart() + // Create a standard frame within the window and make it the main widget + mfr := win.SetMainFrame() + + // Add a label to the main frame with the text "Hello, World!" + label := gi.AddNewLabel(mfr, "label", "Hello, World!") + + // End the protected update on the viewport without a signal. + // Update signals cause things to be redrawn, which is unnecessary at the start + // because it is already drawing everything new. + vp.UpdateEndNoSig(updt) + // Start the event loop that keeps the window rendering. + // This is a blocking call, and it will not return until + // the user quits the app or gi.Quit() is called + win.StartEventLoop() + } + ``` 2. Update your dependencies by running `go mod tidy` 3. Build the code by running `go build`