Skip to content

Commit

Permalink
add links to blog and github
Browse files Browse the repository at this point in the history
  • Loading branch information
kkoreilly committed Jul 14, 2024
1 parent 240125d commit 3b1ed54
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,11 @@ import (
"cogentcore.org/core/core"
"cogentcore.org/core/events"
"cogentcore.org/core/htmlcore"
"cogentcore.org/core/icons"
"cogentcore.org/core/pages"
"cogentcore.org/core/styles"
"cogentcore.org/core/styles/units"
"cogentcore.org/core/tree"
)

//go:embed name.png
Expand All @@ -26,6 +28,20 @@ func main() {
b := core.NewBody("Cogent Core")
pg := pages.NewPage(b).SetContent(content)
b.AddAppBar(pg.MakeToolbar)
b.AddAppBar(func(p *tree.Plan) {
tree.Add(p, func(w *core.Button) {
w.SetText("Blog").SetIcon(icons.RssFeed)
w.OnClick(func(e events.Event) {
pg.Context.OpenURL("/blog")
})
})
tree.Add(p, func(w *core.Button) {
w.SetText("GitHub").SetIcon(icons.GitHub)

Check failure on line 39 in main.go

View workflow job for this annotation

GitHub Actions / build

undefined: icons.GitHub
w.OnClick(func(e events.Event) {
pg.Context.OpenURL("https://github.com/cogentcore")
})
})
})

htmlcore.ElementHandlers["home-page"] = func(ctx *htmlcore.Context) bool {
frame := core.NewFrame(ctx.BlockParent)
Expand Down

0 comments on commit 3b1ed54

Please sign in to comment.