Code Monkey home page Code Monkey logo

Comments (11)

Jacalz avatar Jacalz commented on July 19, 2024

I hope the video will be enough.

No. Please always add example code so we can replicate the issue.

from fyne.

andydotxyz avatar andydotxyz commented on July 19, 2024

It is possible that there is a delay in painting so when you ask for the image to display it does not happen immediately.
Are you by any chance writing the image to be white and reusing it?

Important note is that when you call Refresh it is not actually painting to canvas, it is queueing the change to be reflected in next redraw - which will happen asynchronously.

from fyne.

bob-anderson-ok avatar bob-anderson-ok commented on July 19, 2024

andydotxyz:

I read a file and then write the content to the image. I do not explictly Refresh although I have done so as a test, but the flashes remained.

Jaclz:

I'll put together a demo package - all the code, plus a file to 'play'. Do I just drop that in this box?

from fyne.

bob-anderson-ok avatar bob-anderson-ok commented on July 19, 2024

demo-fits-folder.zip
main.zip

from fyne.

bob-anderson-ok avatar bob-anderson-ok commented on July 19, 2024

I changed the theme to dark and now it flashes black. With white theme it flashes white.

from fyne.

bob-anderson-ok avatar bob-anderson-ok commented on July 19, 2024

I went to go.mod and updated all available modules as image was mentioned in two of them. Sadly, now I get:

fyne.io/fyne/v2/internal/painter

..\pkg\mod\fyne.io\fyne\[email protected]\internal\painter\font.go:209:65: out.LineBounds.LineHeight undefined (type shaping.Bounds has no field or method LineHeight)

Where do I go from here?

from fyne.

bob-anderson-ok avatar bob-anderson-ok commented on July 19, 2024

I was trying to build a simple demo of the flashing. Now I can't use Fyne at all because of the above error. I do not know enough to be able to rollback to something that does work.

from fyne.

bob-anderson-ok avatar bob-anderson-ok commented on July 19, 2024

I have built a simple demo that repeatedly shows the same image using the same mechanisms that are in my "video player".

It does not "flash", so I'm closing this thread.

I got Fyne to work again in my demo program by NOT accepting any of the updates shown to be available in go.mod

I'm new to Golang and probably haven't learned that updates come with risks. Plus, there's the old maxim: If it's not broken, don't fix it. I should have followed it, but the presence of references to image in two of the updates seduced me.

from fyne.

andydotxyz avatar andydotxyz commented on July 19, 2024

I went to go.mod and updated all available modules as image was mentioned in two of them. Sadly, now I get:

fyne.io/fyne/v2/internal/painter

..\pkg\mod\fyne.io\fyne\[email protected]\internal\painter\font.go:209:65: out.LineBounds.LineHeight undefined (type shaping.Bounds has no field or method LineHeight)

Where do I go from here?

You can always upgrade Fyne safely but it looks like you upgraded all dependencies and sadly one library we use pushed a breaking change.

In the future you can do just a single library upgrade like "go get fyne.io/fyne/v2@latest" to avoid this.

We are preparing an update to fyne that hides the go-text breakage but I've been too busy to release it the last week sorry.

from fyne.

bob-anderson-ok avatar bob-anderson-ok commented on July 19, 2024

from fyne.

andydotxyz avatar andydotxyz commented on July 19, 2024

Ah. File operations are slow and expensive compared to the graphical operations, so perhaps it was blanking the image when load started and what you were seeing was the delay in load time.
You workaround seems sensible, though you may need to move that to a worker goroutine for larger directories.

from fyne.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.