Skip to content

Update examples #10

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions examples/app-launcher/spago.lock
Original file line number Diff line number Diff line change
Expand Up @@ -552,7 +552,7 @@ workspace:
extra_packages:
ags-bindings:
git: https://github.com/postsolar/purescript-ags-bindings.git
ref: 52185fac7caae70d5483fb2d33408ac365bfd2d5
ref: a9d2ef3bda754374f1aef96a862678b0dec32ece
packages:
aff:
type: registry
Expand All @@ -579,7 +579,7 @@ packages:
ags-bindings:
type: git
url: https://github.com/postsolar/purescript-ags-bindings.git
rev: 52185fac7caae70d5483fb2d33408ac365bfd2d5
rev: a9d2ef3bda754374f1aef96a862678b0dec32ece
dependencies:
- aff
- console
Expand Down
3 changes: 2 additions & 1 deletion examples/app-launcher/spago.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,5 @@ workspace:
extra_packages:
ags-bindings:
git: https://github.com/postsolar/purescript-ags-bindings.git
ref: 52185fac7caae70d5483fb2d33408ac365bfd2d5
ref: a9d2ef3bda754374f1aef96a862678b0dec32ece

20 changes: 9 additions & 11 deletions examples/app-launcher/src/Main.purs
Original file line number Diff line number Diff line change
Expand Up @@ -64,14 +64,12 @@ appList = do
apps ∷ Widget
apps =
Widget.scrollable
-- Since many widget properties accept either a "raw" value or a binding for
-- that value, it's necessary to wrap them usin `Untagged.Union.asOneOf`.
{ child: asOneOf $
{ child:
Widget.box
-- We use the function `appEntry` declared below and pass it the binding to
-- the search query to construct an array of widgets each representing
-- a particular application.
{ children: asOneOf $
{ children:
let
appWidgets ∷ Array Widget
appWidgets = appEntry currQuery <$> allApps
Expand All @@ -85,7 +83,7 @@ appList = do
}

entryBox = Widget.entry
{ hexpand: asOneOf true
{ hexpand: true
, css: "margin-bottom: 5px;"
-- When the search query is accepted with the Enter key,
-- we get the value of the variable of the applications,
Expand All @@ -111,7 +109,7 @@ appList = do
pure $ Widget.box
{ vertical: true
, css: "margin: 10px;"
, children: asOneOf [ entryBox, apps ]
, children: [ entryBox, apps ]
}

appEntry ∷ Binding String → Applications.Application → Widget
Expand All @@ -128,15 +126,15 @@ appEntry currQuery app =
}

label = Widget.label
{ className: asOneOf "appTitle"
, label: asOneOf name
{ className: "appTitle"
, label: name
, xalign: 0.0
, vpack: "center"
, truncate: "end"
}

buttonChild = Widget.box
{ children: asOneOf [ icon, label ]
{ children: [ icon, label ]
, spacing: 5.0
}

Expand All @@ -158,10 +156,10 @@ appEntry currQuery app =

in
Widget.button
{ child: asOneOf buttonChild
{ child: buttonChild
, onClicked: do
Applications.launchApp app
App.quit
, visible: asOneOf visible
, visible
}

25 changes: 21 additions & 4 deletions examples/simple-bar/spago.lock
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
workspace:
packages:
ags-config:
ags-bindings-example-simple-bar:
path: ./
dependencies:
- ags-bindings
Expand All @@ -10,12 +10,12 @@ workspace:
- formatters
- now
- prelude
- record-studio
- yoga-json
test_dependencies: []
build_plan:
- aff
- ags-bindings
- arraybuffer-types
- arrays
- assert
- bifunctors
Expand Down Expand Up @@ -82,6 +82,7 @@ workspace:
- unsafe-coerce
- untagged-union
- variant
- web-encoding
- yoga-json
- yoga-tree
package_set:
Expand Down Expand Up @@ -567,7 +568,7 @@ workspace:
extra_packages:
ags-bindings:
git: https://github.com/postsolar/purescript-ags-bindings.git
ref: 05ecdd265dd95441faaf963f9ac815daf616c4de
ref: a9d2ef3bda754374f1aef96a862678b0dec32ece
yoga-json:
git: https://github.com/rowtype-yoga/purescript-yoga-json.git
ref: da7fd729964a9aafa65ec81918bddc1dec12d692
Expand Down Expand Up @@ -629,7 +630,7 @@ packages:
ags-bindings:
type: git
url: https://github.com/postsolar/purescript-ags-bindings.git
rev: 05ecdd265dd95441faaf963f9ac815daf616c4de
rev: a9d2ef3bda754374f1aef96a862678b0dec32ece
dependencies:
- aff
- console
Expand All @@ -640,7 +641,14 @@ packages:
- nullable
- prelude
- record
- record-studio
- untagged-union
- web-encoding
arraybuffer-types:
type: registry
version: 3.0.2
integrity: sha256-mQKokysYVkooS4uXbO+yovmV/s8b138Ws3zQvOwIHRA=
dependencies: []
arrays:
type: registry
version: 7.3.0
Expand Down Expand Up @@ -1356,6 +1364,15 @@ packages:
- record
- tuples
- unsafe-coerce
web-encoding:
type: registry
version: 3.0.0
integrity: sha256-lqvbj4Rw9mqgSnKx5vSdeNz4vTGxuRQI/PdSK9+kmk0=
dependencies:
- arraybuffer-types
- effect
- newtype
- prelude
yoga-json:
type: git
url: https://github.com/rowtype-yoga/purescript-yoga-json.git
Expand Down
4 changes: 2 additions & 2 deletions examples/simple-bar/spago.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
package:
name: ags-bindings-example-simple-bar
name: simple-bar
dependencies:
- ags-bindings
- console
Expand All @@ -18,7 +18,7 @@ workspace:
extra_packages:
ags-bindings:
git: https://github.com/postsolar/purescript-ags-bindings.git
ref: 05ecdd265dd95441faaf963f9ac815daf616c4de
ref: a9d2ef3bda754374f1aef96a862678b0dec32ece
yoga-json:
git: https://github.com/rowtype-yoga/purescript-yoga-json.git
ref: da7fd729964a9aafa65ec81918bddc1dec12d692
Expand Down
Loading