fyne-io / examples Goto Github PK
View Code? Open in Web Editor NEWExamples apps using the Fyne toolkit
License: Other
Examples apps using the Fyne toolkit
License: Other
Title. Right now I'm just doing this:
go func() {
for true {
myWindow.Refresh()
time.Sleep(time.Second/60)
}
}()
运行 'go build github.com/fyne-io/examples/bugs' 时出错: Cannot run program "C:\Users\chenchao\AppData\Local\JetBrains\GoLand2023.1\tmp\GoLand___go_build_github_com_fyne_io_examples_bugs.exe" (in directory "C:\workspace\project\examples"): CreateProcess error=216, 该版本的 %1 与你运行的 Windows 版本不兼容。请查看计算机的系统信息,然后联系软件发布者
windows version is incompatible
my windows version info as follows:
版本 Windows 11 专业版
版本 22H2
安装日期 2022/11/25
操作系统版本 22621.1702
体验 Windows Feature Experience Pack 1000.22641.1000.0
go build main.go
is ok, but ./main
failed to run with error:
# ./main
GLFW: An uncaught error has occurred: PlatformError: X11: RandR gamma ramp support seems broken
GLFW: Please report this bug in the Go package immediately.
2019/01/25 16:41:09 PlatformError: X11: RandR monitor support seems broken
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x0 pc=0x5e6542]
goroutine 1 [running, locked to thread]:
fyne.io/fyne/vendor/github.com/go-gl/glfw/v3.2/glfw.(*Window).MakeContextCurrent(0x0)
/root/go/src/fyne.io/fyne/vendor/github.com/go-gl/glfw/v3.2/glfw/context.go:16 +0x22
fyne.io/fyne/driver/gl.(*gLDriver).CreateWindow.func1()
/root/go/src/fyne.io/fyne/driver/gl/window.go:469 +0x11c
fyne.io/fyne/driver/gl.runOnMain(0xc00008d530)
/root/go/src/fyne.io/fyne/driver/gl/loop.go:31 +0xac
fyne.io/fyne/driver/gl.(*gLDriver).CreateWindow(0xc00000c8a0, 0x8f6d70, 0x8, 0xc00008d500, 0xc0000a5ca8)
/root/go/src/fyne.io/fyne/driver/gl/window.go:454 +0x99
fyne.io/fyne/app.(*fyneApp).NewWindow(0xc0000666c0, 0x8f6d70, 0x8, 0xc0000a5cc8, 0x10)
/root/go/src/fyne.io/fyne/app/app.go:33 +0x47
main.welcome(0x971e80, 0xc0000666c0)
/root/go/src/github.com/fyne-io/examples/main.go:24 +0x5e
main.main()
/root/go/src/github.com/fyne-io/examples/main.go:63 +0x53b
OS: same error with CentOS 7, Ubuntu 16.04.4 LTS
RandR related packages for CentOS:
# rpm -qa|grep -i randr
libXrandr-1.5.1-2.el7.x86_64
libXrandr-devel-1.5.1-2.el7.x86_64
RandR related packages for Ubuntu:
# dpkg -l|grep -i randr
ii libxcb-randr0:amd64 1.11.1-1ubuntu1 amd64 X C Binding, randr extension
ii libxcb-randr0-dev:amd64 1.11.1-1ubuntu1 amd64 X C Binding, randr extension, development files
ii libxrandr-dev:amd64 2:1.5.0-1 amd64 X11 RandR extension library (development headers)
ii libxrandr2:amd64 2:1.5.0-1 amd64 X11 RandR extension library
ii x11proto-randr-dev 1.5.0-1 all X11 RandR extension wire protocol
can you make a login screen which can take username and password from the screen
As discussed on Slack fyne Gophers I have two examples of widgets that I would like to add to the fyne-io/examples project.
It was suggested that the clock widget should be added to fyne-x but both widgets were written as examples for other devs to base their widgets off so I think fyne-io/examples is a better fit.
The code is currently here! https://github.com/stuartdd2/fyne-widget-example
I have read the guide to creating pull requests (via a black-hole when I clicked rebase!).
I need to create a branch. I assume that is a branch off fyne-io/examples development, which I cannot do.
I have used git for years but only in the context of a large corporation that hosted it's own managed instance so I am a little out of my depth. This is the first time I plan to contributed to public github repositories so I need a little assistance to get started. I hope to continue contributing to this and other projects in the future.
I think I need to have access to create the branch.
Can you help?
Hi. Please add go modules support for easier compilation. Thank you in advance.
I obtain this result:
../../../../go/pkg/mod/github.com/fyne-io/[email protected]/bugs/button.go:34:10: assignment mismatch: 1 variable but fyne.CurrentApp().Driver().RenderedTextSize returns 2 values
What could I do?
..\vendor\fyne.io\fyne\internal\painter\gl\gl_core.go:11:2: cannot find package "." in:
c:\Go\src\github.com\go-gl\gl\v3.2-core\gl
..\vendor\fyne.io\fyne\internal\driver\glfw\clipboard.go:6:2: cannot find package "." in:
c:\Go\src\github.com\go-gl\glfw\v3.3\glfw
Hi, im trying to run the examples however im getting an error.
First i install fyne with go get -u fyne.io/fyne
, no errors.
Then i proceed to go get -u github.com/fyne-io/examples
which fails with the following error:
# fyne.io/fyne/vendor/github.com/go-gl/glfw/v3.2/glfw
cc1.exe: sorry, unimplemented: 64-bit mode not compiled in
# fyne.io/fyne/vendor/github.com/go-gl/gl/v3.2-core/gl
cc1.exe: sorry, unimplemented: 64-bit mode not compiled in
gcc:
> gcc --version
gcc.exe (i686-posix-dwarf-rev0, Built by MinGW-W64 project) 8.1.0
Copyright (C) 2018 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
Windows 10
Solitaire package for this repository (and fyne-io/desktop repository) seem to have similar problems as this pull request.
So I think it should be fixed similarly. I think that improving and stabilizing the score of the report will make more people interested in this great library.
And, if necessary, I'd like to create pull request.
can not display chinese characters yet
Something that pulls web data, updates in the background and potentially nice image features...
fractal/main.go:100:8: window.SetPadded undefined (type fyne.Window has no field or method SetPadded)
solitaire/game.go:103:3: w.SetPadded undefined (type fyne.Window has no field or method SetPadded)
OpenSuse Leap 42.3, after installing EFL + evas1
in go/src/github.com/fyne-io/examples>
go build .
RESULT:
bugs/board.go:184: undefined: strings.Builder
bugs/button.go:52: cannot use b.button (type *bugButton) as type fyne.CanvasObject in argument to canvas.Refresh:
*bugButton does not implement fyne.CanvasObject (missing Position method)
bugs/button.go:127: cannot use bugRenderer literal (type *bugRenderer) as type fyne.WidgetRenderer in return argument:
*bugRenderer does not implement fyne.WidgetRenderer (missing BackgroundColor method)
bugs/main.go:73: cannot use g.renderer (type *gameRenderer) as type fyne.WidgetRenderer in return argument:
*gameRenderer does not implement fyne.WidgetRenderer (missing BackgroundColor method)
bugs/main.go:108: impossible type assertion:
*bugButton does not implement fyne.CanvasObject (missing Position method)
bugs/main.go:177: cannot use newButton("", code, func literal) (type *bugButton) as type fyne.CanvasObject in append:
*bugButton does not implement fyne.CanvasObject (missing Position method)
bugs/main.go:232: cannot use game (type *game) as type fyne.CanvasObject in argument to game.window.SetContent:
*game does not implement fyne.CanvasObject (missing Position method)
life/main.go:195: cannot use g.renderer (type *gameRenderer) as type fyne.WidgetRenderer in return argument:
*gameRenderer does not implement fyne.WidgetRenderer (missing BackgroundColor method)
life/main.go:323: cannot use game (type *game) as type fyne.CanvasObject in argument to window.SetContent:
*game does not implement fyne.CanvasObject (missing Position method)
solitaire/game.go:103: cannot use NewTable(game) (type *Table) as type fyne.CanvasObject in argument to w.SetContent:
*Table does not implement fyne.CanvasObject (missing Position method)
solitaire/render.go:111: cannot use t.table (type *Table) as type fyne.CanvasObject in argument to canvas.Refresh:
*Table does not implement fyne.CanvasObject (missing Position method)
solitaire/table.go:72: cannot use t.renderer (type *tableRender) as type fyne.WidgetRenderer in return argument:
*tableRender does not implement fyne.WidgetRenderer (missing BackgroundColor method)
solitaire/table.go:76: card.baseObject.Position.X undefined (type func() fyne.Position has no field or method X)
solitaire/table.go:76: card.baseObject.Position.Y undefined (type func() fyne.Position has no field or method Y)
solitaire/table.go:80: card.baseObject.Position.X undefined (type func() fyne.Position has no field or method X)
solitaire/table.go:80: card.baseObject.Size.Width undefined (type func() fyne.Size has no field or method Width)
solitaire/table.go:80: card.baseObject.Position.Y undefined (type func() fyne.Position has no field or method Y)
solitaire/table.go:80: card.baseObject.Size.Height undefined (type func() fyne.Size has no field or method Height)
../fyne/driver/efl/canvas.go:38: cannot use &x (type *C.int) as type *C.Evas_Coord in argument to func literal
../fyne/driver/efl/canvas.go:38: cannot use &y (type *C.int) as type *C.Evas_Coord in argument to func literal
../fyne/driver/efl/canvas.go:275: cannot use &oldWidth (type *C.int) as type *C.Evas_Coord in argument to func literal
../fyne/driver/efl/canvas.go:275: cannot use &oldHeight (type *C.int) as type *C.Evas_Coord in argument to func literal
../fyne/driver/efl/canvas.go:501: undefined: math.Round
I am puzzled especially by undefined math. Round and undefined strings.Builder. It's possible that I am mising something obvious; but after spending some half an hour on this (mostly on installing EFL), I am not motivated enough to try any more ideas
OSX on M1 Max with golang 19.2
Error:
goroutine 31 [GC worker (idle)]:
runtime.gopark(0x1e7872e39245b?, 0x1?, 0x6e?, 0x9a?, 0x0?)
/opt/homebrew/Cellar/go/1.19.2/libexec/src/runtime/proc.go:363 +0xd6 fp=0xc0004dc750 sp=0xc0004dc730 pc=0x10003aad6
runtime.gcBgMarkWorker()
/opt/homebrew/Cellar/go/1.19.2/libexec/src/runtime/mgc.go:1235 +0xf1 fp=0xc0004dc7e0 sp=0xc0004dc750 pc=0x10001e8f1
runtime.goexit()
/opt/homebrew/Cellar/go/1.19.2/libexec/src/runtime/asm_amd64.s:1594 +0x1 fp=0xc0004dc7e8 sp=0xc0004dc7e0 pc=0x1000682a1
created by runtime.gcBgMarkStartWorkers
/opt/homebrew/Cellar/go/1.19.2/libexec/src/runtime/mgc.go:1159 +0x25
goroutine 6 [chan receive]:
runtime.gopark(0xc0004dcea8?, 0x1006086c0?, 0x4?, 0x0?, 0xc0001aac44?)
/opt/homebrew/Cellar/go/1.19.2/libexec/src/runtime/proc.go:363 +0xd6 fp=0xc0004dce70 sp=0xc0004dce50 pc=0x10003aad6
runtime.chanrecv(0xc0001a8d20, 0x0, 0x1)
/opt/homebrew/Cellar/go/1.19.2/libexec/src/runtime/chan.go:583 +0x49b fp=0xc0004dcf00 sp=0xc0004dce70 pc=0x100009dbb
runtime.chanrecv1(0xc0001be780?, 0xc0001a8cc0?)
/opt/homebrew/Cellar/go/1.19.2/libexec/src/runtime/chan.go:442 +0x18 fp=0xc0004dcf28 sp=0xc0004dcf00 pc=0x1000098b8
fyne.io/fyne/v2/internal/animation.(*Runner).runAnimations.func1()
/Users/moo/go/pkg/mod/fyne.io/fyne/[email protected]/internal/animation/runner.go:69 +0x4f fp=0xc0004dcfe0 sp=0xc0004dcf28 pc=0x100413a2f
runtime.goexit()
/opt/homebrew/Cellar/go/1.19.2/libexec/src/runtime/asm_amd64.s:1594 +0x1 fp=0xc0004dcfe8 sp=0xc0004dcfe0 pc=0x1000682a1
created by fyne.io/fyne/v2/internal/animation.(*Runner).runAnimations
In this function:
func (c *clockLayout) rotate(hand fyne.CanvasObject, middle fyne.Position, facePosition float64, offset, length int) {
rotation := math.Pi * 2 / 60 * float64(facePosition)
x2 := int(float64(length) * math.Sin(rotation))
y2 := int(float64(-length) * math.Cos(rotation))
offX := 0
offY := 0
if offset > 0 {
offX += int(float64(offset) * math.Sin(rotation))
offY += int(float64(-offset) * math.Cos(rotation))
}
hand.Move(fyne.NewPos(middle.X+offX, middle.Y+offY))
hand.Resize(fyne.NewSize(x2, y2))
}
It will be better if using facePosition
instead of float64(facePosition)
since facePosition
is already float64
as an input.
Steps to reproduce:
Run example (debug binary) on MacOS 12.4 with M1 processor. Select "Clock" example. Resize main window.
Expected behaviour:
Smooth resizing
Actual behaviour:
Very, very slow resizing. Sometimes even crashes during resizing.
Example crash (there are different versions):
Exception has occurred: fatal error
"unexpected signal during runtime execution"
Stack:
8 0x0000000104ae20cc in C._cgo_2a3a38a27560_Cfunc_glowDrawArrays
at /tmp/go-build/cgo-gcc-prolog:3697
11 0x00000001048b3cc8 in github.com/go-gl/gl/v3.2-core/gl._Cfunc_glowDrawArrays
at _cgo_gotypes.go:6459
12 0x00000001048b61f8 in github.com/go-gl/gl/v3.2-core/gl.DrawArrays
at /Users/maygames/go/pkg/mod/github.com/go-gl/[email protected]/v3.2-core/gl/package.go:9557
13 0x00000001048dbb54 in fyne.io/fyne/v2/internal/painter/gl.(*glPainter).glDrawTexture
at /Users/maygames/go/pkg/mod/fyne.io/fyne/[email protected]/internal/painter/gl/gl_core.go:331
14 0x00000001048d78ac in fyne.io/fyne/v2/internal/painter/gl.(*glPainter).drawTextureWithDetails
at /Users/maygames/go/pkg/mod/fyne.io/fyne/[email protected]/internal/painter/gl/draw.go:30
15 0x00000001048d83fc in fyne.io/fyne/v2/internal/painter/gl.(*glPainter).drawText
at /Users/maygames/go/pkg/mod/fyne.io/fyne/[email protected]/internal/painter/gl/draw.go:84
16 0x00000001048d88c4 in fyne.io/fyne/v2/internal/painter/gl.(*glPainter).drawObject
at /Users/maygames/go/pkg/mod/fyne.io/fyne/[email protected]/internal/painter/gl/draw.go:103
17 0x00000001048dc178 in fyne.io/fyne/v2/internal/painter/gl.(*glPainter).Paint
at /Users/maygames/go/pkg/mod/fyne.io/fyne/[email protected]/internal/painter/gl/painter.go:69
18 0x0000000104a765b0 in fyne.io/fyne/v2/internal/driver/glfw.(*glCanvas).paint.func1
at /Users/maygames/go/pkg/mod/fyne.io/fyne/[email protected]/internal/driver/glfw/canvas.go:279
19 0x00000001048df414 in fyne.io/fyne/v2/internal/driver/common.(*Canvas).walkTree.func1
at /Users/maygames/go/pkg/mod/fyne.io/fyne/[email protected]/internal/driver/common/canvas.go:418
20 0x00000001047e4360 in fyne.io/fyne/v2/internal/driver.walkObjectTree
at /Users/maygames/go/pkg/mod/fyne.io/fyne/[email protected]/internal/driver/util.go:169
21 0x00000001047e47fc in fyne.io/fyne/v2/internal/driver.walkObjectTree.func1
at /Users/maygames/go/pkg/mod/fyne.io/fyne/[email protected]/internal/driver/util.go:176
22 0x00000001047e45e4 in fyne.io/fyne/v2/internal/driver.walkObjectTree
at /Users/maygames/go/pkg/mod/fyne.io/fyne/[email protected]/internal/driver/util.go:190
23 0x00000001047e47fc in fyne.io/fyne/v2/internal/driver.walkObjectTree.func1
at /Users/maygames/go/pkg/mod/fyne.io/fyne/[email protected]/internal/driver/util.go:176
24 0x00000001047e45e4 in fyne.io/fyne/v2/internal/driver.walkObjectTree
at /Users/maygames/go/pkg/mod/fyne.io/fyne/[email protected]/internal/driver/util.go:190
25 0x00000001047e47fc in fyne.io/fyne/v2/internal/driver.walkObjectTree.func1
at /Users/maygames/go/pkg/mod/fyne.io/fyne/[email protected]/internal/driver/util.go:176
26 0x00000001047e45e4 in fyne.io/fyne/v2/internal/driver.walkObjectTree
at /Users/maygames/go/pkg/mod/fyne.io/fyne/[email protected]/internal/driver/util.go:190
27 0x00000001047e47fc in fyne.io/fyne/v2/internal/driver.walkObjectTree.func1
at /Users/maygames/go/pkg/mod/fyne.io/fyne/[email protected]/internal/driver/util.go:176
28 0x00000001047e45e4 in fyne.io/fyne/v2/internal/driver.walkObjectTree
at /Users/maygames/go/pkg/mod/fyne.io/fyne/[email protected]/internal/driver/util.go:190
29 0x00000001047e47fc in fyne.io/fyne/v2/internal/driver.walkObjectTree.func1
at /Users/maygames/go/pkg/mod/fyne.io/fyne/[email protected]/internal/driver/util.go:176
30 0x00000001047e45e4 in fyne.io/fyne/v2/internal/driver.walkObjectTree
at /Users/maygames/go/pkg/mod/fyne.io/fyne/[email protected]/internal/driver/util.go:190
31 0x00000001047e47fc in fyne.io/fyne/v2/internal/driver.walkObjectTree.func1
at /Users/maygames/go/pkg/mod/fyne.io/fyne/[email protected]/internal/driver/util.go:176
32 0x00000001047e45e4 in fyne.io/fyne/v2/internal/driver.walkObjectTree
at /Users/maygames/go/pkg/mod/fyne.io/fyne/[email protected]/internal/driver/util.go:190
33 0x00000001047e47fc in fyne.io/fyne/v2/internal/driver.walkObjectTree.func1
at /Users/maygames/go/pkg/mod/fyne.io/fyne/[email protected]/internal/driver/util.go:176
34 0x00000001047e45e4 in fyne.io/fyne/v2/internal/driver.walkObjectTree
at /Users/maygames/go/pkg/mod/fyne.io/fyne/[email protected]/internal/driver/util.go:190
35 0x00000001047e4040 in fyne.io/fyne/v2/internal/driver.WalkVisibleObjectTree
at /Users/maygames/go/pkg/mod/fyne.io/fyne/[email protected]/internal/driver/util.go:134
36 0x00000001048dee48 in fyne.io/fyne/v2/internal/driver/common.(*Canvas).walkTree
at /Users/maygames/go/pkg/mod/fyne.io/fyne/[email protected]/internal/driver/common/canvas.go:439
37 0x00000001048de734 in fyne.io/fyne/v2/internal/driver/common.(*Canvas).WalkTrees
at /Users/maygames/go/pkg/mod/fyne.io/fyne/[email protected]/internal/driver/common/canvas.go:351
38 0x0000000104a76294 in fyne.io/fyne/v2/internal/driver/glfw.(*glCanvas).paint
at /Users/maygames/go/pkg/mod/fyne.io/fyne/[email protected]/internal/driver/glfw/canvas.go:293
39 0x0000000104a78b60 in fyne.io/fyne/v2/internal/driver/glfw.(*gLDriver).repaintWindow.func1
at /Users/maygames/go/pkg/mod/fyne.io/fyne/[email protected]/internal/driver/glfw/loop.go:174
40 0x0000000104a84e94 in fyne.io/fyne/v2/internal/driver/glfw.(*window).RunWithContext
at /Users/maygames/go/pkg/mod/fyne.io/fyne/[email protected]/internal/driver/glfw/window.go:1329
41 0x0000000104a78a70 in fyne.io/fyne/v2/internal/driver/glfw.(*gLDriver).repaintWindow
at /Users/maygames/go/pkg/mod/fyne.io/fyne/[email protected]/internal/driver/glfw/loop.go:165
42 0x0000000104a79264 in fyne.io/fyne/v2/internal/driver/glfw.(*gLDriver).startDrawThread.func1
at /Users/maygames/go/pkg/mod/fyne.io/fyne/[email protected]/internal/driver/glfw/loop.go:228
Howdy all y'all,
I'm looking for suggestions to determine what is wrong. I've used fyne-cross to build an executable for Windows and run it on my Windows 10 VM only to find that it does not run. I've found no events tied to it in the event viewer. And I get no error message.
I thought I was doing pretty good here...
Any suggestions you have to determine what's going it is very much appreciated,
Dale
During debugging of the game of life, found that memory allocation looks OK, but there is a definite leak in the stack usage.
See #10 for findings.
Currently investigating - might take a weekend to sort this one out.
hello
I would like to be able to draw a bounding box around an object in an image. Desktop.
How do I go about getting the mouse events from a canvas that has an image in it?
Is it possible to layer a canvas on top of another canvas with opacity?
Thanks
Hi, Is this like flutter?
Can I make Android app with you, is there any example or guide.
Thanks
Where can I find the source code for fyne_demo? I can find it in explorer but where is it online?
Hi Guys,
Trying to run the examples and have hit an issue.
I've simply done a git clone into a pretty much new machine. Have managed to run fyne_demo OK, but when I try and run main.go from this repo I'm getting
./main.go:36:12: undefined: resourceIconPng
I can see that it exists in data.go, but for some reason isn't getting picked up by the looks of things.
Peter.
Howdy all y'all,
I like that I'm able to fyne-cross examples and make distribution-ready executables for other platforms. But, I was sad to find that Solitaire is larger than the screen on some devices and in some situations. Is there some already baked-in capability where I can reduce the resolution of Solitaire during run-time or shift the screen so that I can get to the missing part of the display? If not, I think I might face this problem with programs I build with fyne, how do you suggest I handle the situation?
XKCD has a similar problem with some IDs (see ID=482.)
I look forward to hearing from y'all,
Dale
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.