Replies: 1 comment
-
Yes, there's an easier way - stop trying to make a fish ride a bicycle. What you are asking for is a case of "you're doing it wrong". A canvas isn't a mechanism for working around the fact that Toga doesn't provide arbitrary theming of widgets; trying to build buttons (or any other widget) on a canvas is the wrong approach to solve the problem. Toga is v0.3. There are lots of features still missing. If you find a missing feature, the solution to that problem is to implement that feature, not work out how you can use gaffa tape and string to use the existing (also incomplete) features to approximate 75% of the feature that is missing. If missing feature here is "icon buttons" (as I suspect it is), I can guarantee you that the actual fix using native widgets will be substantially less code than trying to cobble together an icon button using a canvas - and will be substantially more reliable to boot. |
Beta Was this translation helpful? Give feedback.
-
Navigation icons such as arrows or a home icon can be placed on a canvas to provide user interaction via the
on_press
callback.Is there a simple way to change the icon (or icon color) when the icon is clicked upon?
One way would be to redraw the icon on the canvas, accessing it using the objects passed by the callback function.
Is there an easier / simpler way?
Beta Was this translation helpful? Give feedback.
All reactions