Skip to content

Commit

Permalink
updated to latest rye ryegen, small examples improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
refaktor committed Nov 30, 2024
1 parent fba5cb4 commit 17ed494
Show file tree
Hide file tree
Showing 6 changed files with 135 additions and 109 deletions.
2 changes: 1 addition & 1 deletion examples/hello.rye
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ do\in fyne {
|set-content v-box [
lab1
separator
labela
lab2
sld1
ent1
btn1
Expand Down
1 change: 1 addition & 0 deletions examples/list_gastown.rye
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ do\in fyne {
with win {
.set-content lst ,
.set-title "Gastown games players" ,
.resize size 200.0 180.0 ,
.show-and-run
}
}
Expand Down
12 changes: 8 additions & 4 deletions examples/progress-clock/data-ctx.rye
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,16 @@ Data: context {
started: false
}

sessions: ref spreadsheet { "type" "minutes" "title" }
sessions: ref spreadsheet { "type" "minutes" "title" "percentage" }
{
"work" 45 "spravi mobi na play"
"work" 25 "reši bug uporabnici @popsi!!!"
; "work" 45 "spravi mobi na play" 70
}

work-sessions?: does { sessions |deref |where-equal "type" "work" }
add-sessions!: does { sessions .add-rows! { "work" 34 "this is magic" } }
add-current-work-session!: does { sessions .add-rows! [ "work" Work/current-minutes Work/current-title to-integer 100 * Work/current-progress? ] }

save-all: does { sessions .to-bson |write* %sessions.spr.bson }
load-all: does { read\bytes %sessions.spr.bson |^fix { save-all } |from-bson |ref |change! 'sessions }

Leisure: context {
from: 15
Expand All @@ -31,4 +33,6 @@ Data: context {
current-minutes: 0
started: false
}

load-all
}
22 changes: 14 additions & 8 deletions examples/progress-clock/work-tab.rye
Original file line number Diff line number Diff line change
Expand Up @@ -9,16 +9,27 @@ show-add-work-form: fn { hb } { .objects! [ v-box [
nil
nil
label "named"
button "Add" closure { } { Data/Work/start! to-integer minw .text? titlw .text? , hb .show-stop-form , Data/add-sessions! }
button "Add" closure { } { Data/Work/start! to-integer minw .text? titlw .text? , hb .show-stop-form }
[ titlw: entry ]
]
] }


show-stop-form: fn { hb } { .objects! [
button "Stop session" closure { } { Data/Work/stop! }
button "Stop session" closure { } { Data/add-current-work-session! , Data/save-all , Data/Work/stop! , hbw .show-toolbar , work-list .refresh }
] }

show-toolbar: fn { hb } { .objects! [
button "Start session" does { hbw .show-add-work-form }
] }

work-list: list does { length? Data/work-sessions? }
does { h-box [ label "title" label "minutes" label "percent" ] }
fn { i box } { set! box .objects? { title minutes percent }
minutes .set-text to-string 1 <- i <- Data/work-sessions?
title .set-text 2 <- i <- Data/work-sessions?
percent .set-text concat to-string 3 <- i <- Data/work-sessions? "%" }

work-cont: border
v-box [
label "Today [hours]"
Expand All @@ -29,15 +40,10 @@ v-box [
]
nil nil nil
[
wrk-lst: list does { length? Data/work-sessions? }
does { h-box [ label "title" label "minutes" ] }
fn { i box } { set! box .objects? { title minutes }
minutes .set-text to-string 1 <- i <- Data/work-sessions?
title .set-text 2 <- i <- Data/work-sessions? }
work-list
]

update-work-tab: fn { Data } {
; enter-console "GOGO"
if Data/Work/started {
Data/Work/current-progress? |set-value* pw
lw .set-text Data/Work/current-title
Expand Down
64 changes: 37 additions & 27 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ go 1.23.0
require (
fyne.io/fyne/v2 v2.4.4
github.com/jwalton/go-supportscolor v1.2.0
github.com/refaktor/rye v0.0.25-0.20241008135859-3e401118b002
github.com/refaktor/ryegen v0.1.1-0.20241009014844-8c047bebf475
github.com/refaktor/rye v0.0.32
github.com/refaktor/ryegen v0.1.0
github.com/webview/webview_go v0.0.0-20230901181450-5a14030a9070
)

Expand All @@ -22,20 +22,21 @@ require (
github.com/BurntSushi/toml v1.4.0 // indirect
github.com/RoaringBitmap/roaring v1.9.3 // indirect
github.com/anmitsu/go-shlex v0.0.0-20200514113438-38f4b401e2be // indirect
github.com/aws/aws-sdk-go-v2 v1.31.0 // indirect
github.com/aws/aws-sdk-go-v2/config v1.27.39 // indirect
github.com/aws/aws-sdk-go-v2/credentials v1.17.37 // indirect
github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.16.14 // indirect
github.com/aws/aws-sdk-go-v2/internal/configsources v1.3.18 // indirect
github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.6.18 // indirect
github.com/atotto/clipboard v0.1.4 // indirect
github.com/aws/aws-sdk-go-v2 v1.32.3 // indirect
github.com/aws/aws-sdk-go-v2/config v1.28.1 // indirect
github.com/aws/aws-sdk-go-v2/credentials v1.17.42 // indirect
github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.16.18 // indirect
github.com/aws/aws-sdk-go-v2/internal/configsources v1.3.22 // indirect
github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.6.22 // indirect
github.com/aws/aws-sdk-go-v2/internal/ini v1.8.1 // indirect
github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.11.5 // indirect
github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.11.20 // indirect
github.com/aws/aws-sdk-go-v2/service/ses v1.27.3 // indirect
github.com/aws/aws-sdk-go-v2/service/sso v1.23.3 // indirect
github.com/aws/aws-sdk-go-v2/service/ssooidc v1.27.3 // indirect
github.com/aws/aws-sdk-go-v2/service/sts v1.31.3 // indirect
github.com/aws/smithy-go v1.21.0 // indirect
github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.12.0 // indirect
github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.12.3 // indirect
github.com/aws/aws-sdk-go-v2/service/ses v1.28.3 // indirect
github.com/aws/aws-sdk-go-v2/service/sso v1.24.3 // indirect
github.com/aws/aws-sdk-go-v2/service/ssooidc v1.28.3 // indirect
github.com/aws/aws-sdk-go-v2/service/sts v1.32.3 // indirect
github.com/aws/smithy-go v1.22.0 // indirect
github.com/bitfield/script v0.23.0 // indirect
github.com/bits-and-blooms/bitset v1.12.0 // indirect
github.com/blevesearch/bleve/v2 v2.4.2 // indirect
Expand All @@ -56,11 +57,11 @@ require (
github.com/blevesearch/zapx/v14 v14.3.10 // indirect
github.com/blevesearch/zapx/v15 v15.3.13 // indirect
github.com/blevesearch/zapx/v16 v16.1.5 // indirect
github.com/cszczepaniak/keyboard v0.1.0 // indirect
github.com/davecgh/go-spew v1.1.1 // indirect
github.com/drewlanenga/govector v0.0.0-20220726163947-b958ac08bc93 // indirect
github.com/eiannone/keyboard v0.0.0-20220611211555-0d226195f203 // indirect
github.com/fredbi/uri v1.0.0 // indirect
github.com/fsnotify/fsnotify v1.7.0 // indirect
github.com/fsnotify/fsnotify v1.8.0 // indirect
github.com/fyne-io/gl-js v0.0.0-20220119005834-d2da28d9ccfe // indirect
github.com/fyne-io/glfw-js v0.0.0-20220120001248-ee7290d23504 // indirect
github.com/fyne-io/image v0.0.0-20220602074514-4956b0afb3d2 // indirect
Expand All @@ -83,10 +84,13 @@ require (
github.com/gopherjs/gopherjs v1.17.2 // indirect
github.com/gorilla/securecookie v1.1.2 // indirect
github.com/gorilla/sessions v1.4.0 // indirect
github.com/hashicorp/errwrap v1.0.0 // indirect
github.com/hashicorp/go-multierror v1.1.1 // indirect
github.com/iancoleman/strcase v0.3.0 // indirect
github.com/itchyny/gojq v0.12.13 // indirect
github.com/itchyny/timefmt-go v0.1.5 // indirect
github.com/jinzhu/copier v0.4.0 // indirect
github.com/jlaffaye/ftp v0.2.0 // indirect
github.com/jmespath/go-jmespath v0.4.0 // indirect
github.com/json-iterator/go v1.1.11 // indirect
github.com/jsummers/gobmp v0.0.0-20151104160322-e2ba15ffa76e // indirect
Expand All @@ -98,19 +102,22 @@ require (
github.com/mattn/go-colorable v0.1.13 // indirect
github.com/mattn/go-isatty v0.0.20 // indirect
github.com/mattn/go-runewidth v0.0.16 // indirect
github.com/mattn/go-sqlite3 v1.14.23 // indirect
github.com/mattn/go-sqlite3 v1.14.24 // indirect
github.com/mhale/smtpd v0.8.3 // indirect
github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421 // indirect
github.com/modern-go/reflect2 v1.0.1 // indirect
github.com/mohae/deepcopy v0.0.0-20170929034955-c48cc78d4826 // indirect
github.com/mrz1836/postmark v1.6.5 // indirect
github.com/mschoch/smat v0.2.0 // indirect
github.com/olekukonko/tablewriter v0.0.5 // indirect
github.com/pkg/term v1.2.0-beta.2.0.20211217091447-1a4a3b719465 // indirect
github.com/pmezard/go-difflib v1.0.0 // indirect
github.com/power-devops/perfstat v0.0.0-20210106213030-5aafc221ea8c // indirect
github.com/refaktor/go-peg v0.0.0-20220116201714-31e3dfa8dc7d // indirect
github.com/richardlehane/mscfb v1.0.4 // indirect
github.com/richardlehane/msoleps v1.0.4 // indirect
github.com/rivo/uniseg v0.4.4 // indirect
github.com/sashabaranov/go-openai v1.31.0 // indirect
github.com/sashabaranov/go-openai v1.32.5 // indirect
github.com/shirou/gopsutil/v3 v3.24.5 // indirect
github.com/shoenig/go-m1cpu v0.1.6 // indirect
github.com/srwiley/oksvg v0.0.0-20221011165216-be6e8873101c // indirect
Expand All @@ -123,19 +130,22 @@ require (
github.com/tklauser/numcpus v0.7.0 // indirect
github.com/valyala/bytebufferpool v1.0.0 // indirect
github.com/valyala/fasttemplate v1.2.2 // indirect
github.com/xuri/efp v0.0.0-20240408161823-9ad904a10d6d // indirect
github.com/xuri/excelize/v2 v2.9.0 // indirect
github.com/xuri/nfp v0.0.0-20240318013403-ab9948c2c4a7 // indirect
github.com/yuin/goldmark v1.5.5 // indirect
github.com/yusufpapurcu/wmi v1.2.4 // indirect
go.etcd.io/bbolt v1.3.7 // indirect
go.mongodb.org/mongo-driver v1.17.0 // indirect
golang.org/x/crypto v0.27.0 // indirect
golang.org/x/image v0.12.0 // indirect
go.mongodb.org/mongo-driver v1.17.1 // indirect
golang.org/x/crypto v0.28.0 // indirect
golang.org/x/image v0.18.0 // indirect
golang.org/x/mobile v0.0.0-20230922142353-e2f452493d57 // indirect
golang.org/x/mod v0.21.0 // indirect
golang.org/x/net v0.29.0 // indirect
golang.org/x/sync v0.8.0 // indirect
golang.org/x/sys v0.25.0 // indirect
golang.org/x/term v0.24.0 // indirect
golang.org/x/text v0.18.0 // indirect
golang.org/x/net v0.30.0 // indirect
golang.org/x/sync v0.9.0 // indirect
golang.org/x/sys v0.27.0 // indirect
golang.org/x/term v0.26.0 // indirect
golang.org/x/text v0.20.0 // indirect
google.golang.org/protobuf v1.33.0 // indirect
gopkg.in/alexcesaro/quotedprintable.v3 v3.0.0-20150716171945-2caba252f4dc // indirect
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c // indirect
Expand Down
Loading

0 comments on commit 17ed494

Please sign in to comment.