Skip to content

Commit

Permalink
added readme and cname back
Browse files Browse the repository at this point in the history
  • Loading branch information
kkoreilly committed Jun 23, 2023
1 parent cf12ea3 commit 7975f24
Show file tree
Hide file tree
Showing 3 changed files with 37 additions and 31 deletions.
1 change: 1 addition & 0 deletions CNAME
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
goki.dev
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# goki.github.io

This is the website for GoKi ([goki.dev](https://goki.dev))
64 changes: 33 additions & 31 deletions content/gi/gettingstarted.md
Original file line number Diff line number Diff line change
Expand Up @@ -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`
Expand Down

0 comments on commit 7975f24

Please sign in to comment.