ajstarks / giocanvas Goto Github PK
View Code? Open in Web Editor NEWCanvas API built with Gio
License: Other
Canvas API built with Gio
License: Other
I wonder if we should also have all the demos load in a web page too ?
Just a good test harness like the one you have now for desktop.
A simple index page that is just a page of links, that then call each demos index web page.
I think it can be scripted like your bc.sh approach...
Did a checkout on master, but build is broken due to dependencies.
Do you want to fix or should i have a go ??
all: init build run
init:
cd play && go mod init
build:
## desk
cd play && go build -o $(PWD)/bin/play
run:
open $(PWD)/bin/play
i get:
cd /Users/apple/workspace/go/src/github.com/ajstarks/giocanvas/play && go build -o /Users/apple/workspace/go/src/codeberg.org/gerard.webb/junk/sdk/gui/gio/ajstarks-giocanvas/bin/play
go: finding module for package gioui.org/io/key
go: finding module for package gioui.org/unit
go: finding module for package gioui.org/f32
go: finding module for package gioui.org/app
go: finding module for package github.com/ajstarks/giocanvas
go: finding module for package gioui.org/io/system
go: found gioui.org/app in gioui.org v0.0.0-20200630184602-223f8fd40ae4
go: found github.com/ajstarks/giocanvas in github.com/ajstarks/giocanvas v0.0.0-20200630185103-0ffc0a4d0f72
can't load package: package github.com/ajstarks/giocanvas/play: ambiguous import: found package github.com/ajstarks/giocanvas/play in multiple modules:
github.com/ajstarks/giocanvas/play (/Users/apple/workspace/go/src/github.com/ajstarks/giocanvas/play)
github.com/ajstarks/giocanvas v0.0.0-20200630185103-0ffc0a4d0f72 (/Users/apple/workspace/go/pkg/mod/github.com/ajstarks/[email protected]/play)
make: *** [build] Error 1
Thanks for the package. It looks very good.
I was tweaking with it when i found some issues with the arcline method. There are various of them and since i am not a go dev or am comfortable with it. And i also am not experienced with this package.
All of this to say that i am not even sure if they are really issues at all.
So i created a repo with my doubts.
They can be resumed to:
Note:
Maybe I should have created separate issues for all of them, but they seem minor issue and seem to be related. So i though that they could all be solved in one go ๐ถ.
Sorry I'm rather new to gioui so apologises if this is a stupib question, but how do I utilise the lib with an existing gioui app?
My app builds in what looks like a fairly standard way, I create a set of widgets , buttons, labels etc... and add them to a list and layout etc. These then get applied to the Frame in the FrameEvent
How do I add a canvas to an app, the play example show how to create a canvas in response to the FrameEvent with the canvas returning a context
$ go run github.com/ajstarks/giocanvas/hello
go: finding module for package github.com/ajstarks/giocanvas/hello
go: found github.com/ajstarks/giocanvas/hello in github.com/ajstarks/giocanvas v0.0.0-20200531170401-8df5478cf848
go: finding module for package gioui.org/app
go: finding module for package gioui.org/op
go: finding module for package gioui.org/f32
go: finding module for package gioui.org/layout
go: finding module for package gioui.org/text
go: finding module for package gioui.org/font/gofont
go: finding module for package gioui.org/widget/material
go: finding module for package gioui.org/op/paint
go: finding module for package gioui.org/io/system
go: finding module for package gioui.org/op/clip
go: finding module for package gioui.org/unit
go: found gioui.org/app in gioui.org v0.0.0-20200531112915-23c2d44b8cfe
# github.com/ajstarks/giocanvas
../../go/pkg/mod/github.com/ajstarks/[email protected]/giocanvas.go:218:12: cannot use c.Context (type *layout.Context) as type layout.Context in argument to l.Layout
Thank you so much for creating this library.
The new resize works well. Been experimenting with it and it works fine.
I would like to see discus 2 further options:
It never resizes, but instead allows zoom and scroll bars.
Use cases are many. My use case is needing to CAD like layouts.
When you make the window smaller it pushes things over and does not rescale things. It's more like how GIOUI layout itself works.
The bottom scroll and right scroll bars appear appear as needed.
Uses cases are when you want App like behaviour
I wrote had some code to allow resizing with all the slides of the deck shown as a continuous vertical stack, as well as horizontal resizing.
It worked, BUT, but perf was terrible. After you get to the 10th slide things got slow and blocking...
But last week i realised an elegant way to fix it which i think is worthwhile and would like to propose.
Basically there are 2 viewing modes.
Make it more like how most PDF viewers work, with each slide ( of the whole deck ) as a mini thumbnail on the left pane and a single slide on the right pane. As you click the on the left pane, your loading a new slide and all is good, and the horizontal reising is fine in terms of performance. This avoids the perf problems because there is only deck at a time. The thumbnails are PNGS, so its fine to have a ton of them on the left pane.
If you want the continuous vertical stacking of the slides in a deck with resizing, then we need to do the faked continuous scrolling trick.
Basically we have the terms Screen space versus Model space:
The easy way to do this is to dynamically alter the XML of each slide as the user scrolls. Any slide not in Screen Space ( ie visible ) has no XML inside it. Most importantly the respective deck's size is kept, so that we don't mess up the scrolling bar.
As the user scrolls vertically we put the real XML back in for which ever slide (s) are n Screen space.
A deck with 500 pages is possible with no performance issues.
Technique 2 impacts how we do Technique 1 too. In Technique 1 the left pane with hundreds of Slides can use the same trick. SO we dont have to convert to PNG thumbnails. We can show the real vector format.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.