Skip to content

Commit 7975f24

Browse files
committed
added readme and cname back
1 parent cf12ea3 commit 7975f24

File tree

3 files changed

+37
-31
lines changed

3 files changed

+37
-31
lines changed

CNAME

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
goki.dev

README.md

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# goki.github.io
2+
3+
This is the website for GoKi ([goki.dev](https://goki.dev))

content/gi/gettingstarted.md

+33-31
Original file line numberDiff line numberDiff line change
@@ -17,37 +17,39 @@ _Note: this page assumes that you have already installed GoGi by completing the
1717

1818
1. Add the following code to your editor:
1919

20-
package main
21-
22-
func main() {
23-
// Run the window event loop function as the main function
24-
gimain.Main(func() {
25-
mainrun()
26-
})
27-
}
28-
29-
func mainrun() {
30-
// Create a window called My App Window with width 1024 and height 768
31-
win := gi.NewMainWindow("myapp", "My App Window", 1024, 768)
32-
// Get the viewport within our window
33-
vp := win.WinViewport2D()
34-
// Start a protect update on the viewport
35-
updt := vp.UpdateStart()
36-
// Create a standard frame within the window and make it the main widget
37-
mfr := win.SetMainFrame()
38-
39-
// Add a label to the main frame with the text "Hello, World!"
40-
label := gi.AddNewLabel(mfr, "label", "Hello, World!")
41-
42-
// End the protected update on the viewport without a signal.
43-
// Update signals cause things to be redrawn, which is unnecessary at the start
44-
// because it is already drawing everything new.
45-
vp.UpdateEndNoSig(updt)
46-
// Start the event loop that keeps the window rendering.
47-
// This is a blocking call, and it will not return until
48-
// the user quits the app or gi.Quit() is called
49-
win.StartEventLoop()
50-
}
20+
```go
21+
package main
22+
23+
func main() {
24+
// Run the window event loop function as the main function
25+
gimain.Main(func() {
26+
mainrun()
27+
})
28+
}
29+
30+
func mainrun() {
31+
// Create a window called My App Window with width 1024 and height 768
32+
win := gi.NewMainWindow("myapp", "My App Window", 1024, 768)
33+
// Get the viewport within our window
34+
vp := win.WinViewport2D()
35+
// Start a protect update on the viewport
36+
updt := vp.UpdateStart()
37+
// Create a standard frame within the window and make it the main widget
38+
mfr := win.SetMainFrame()
39+
40+
// Add a label to the main frame with the text "Hello, World!"
41+
label := gi.AddNewLabel(mfr, "label", "Hello, World!")
42+
43+
// End the protected update on the viewport without a signal.
44+
// Update signals cause things to be redrawn, which is unnecessary at the start
45+
// because it is already drawing everything new.
46+
vp.UpdateEndNoSig(updt)
47+
// Start the event loop that keeps the window rendering.
48+
// This is a blocking call, and it will not return until
49+
// the user quits the app or gi.Quit() is called
50+
win.StartEventLoop()
51+
}
52+
```
5153

5254
2. Update your dependencies by running `go mod tidy`
5355
3. Build the code by running `go build`

0 commit comments

Comments
 (0)