Can I get access to the NewOverlayContainer() func? #4631
Replies: 4 comments 2 replies
-
If you want a tappable image, it is a lot better to just make a widget out of it and make that widget extend the fyne.Tappable interface. See https://pkg.go.dev/fyne.io/x/[email protected]/wrapper#MakeTappable for example (looking at the code might also be useful). |
Beta Was this translation helpful? Give feedback.
-
See also https://github.com/dweymouth/supersonic/blob/785e651dd64b5edc690fcae3b4f24168ccc1cff3/ui/widgets/tappablewrappers.go#L53 for a TappableImage implementation as a custom widget. In contrast to the MakeTappable implementation, this tappable image can easily be further extended to add additional functionality (hoverable, etc) |
Beta Was this translation helpful? Give feedback.
-
The MakeTappable func sounds like the answer, but what package is it in? wrapper.MakeTappable() fails. What would work? |
Beta Was this translation helpful? Give feedback.
-
Please be more complete. Exactly what entry do I make in go.mod? |
Beta Was this translation helpful? Give feedback.
-
Checklist
Is your feature request related to a problem?
I display images in a canvas object. I want to be able to capture mouse clicks on the image. That is possible for widgets, but not a canvas. The overlay container seems to provide the exact functionality I need: it's a tappable widget containing a CanvasObject. The overlay (I gather) can be transparent, so the image can be seen, but as the overlay is a widget, it can be tappable. That is likely to provide the functionality I'm looking for.
Is it possible to construct a solution with the existing API?
I've looked but found only the NewOverlayContainer(), but it's an 'internal' function.
Describe the solution you'd like to see.
Can I take some of 'internal' code and put it in my program? I assume there's danger here and the 'internal' status is a "dragons lurk here' sign.
Beta Was this translation helpful? Give feedback.
All reactions