What I’m trying to do:
I have several “buttons” on a form in the form of links to make a semi-calculator. Each link has an image on it, and each image is a nicely made png. Looks great!
However, on a few of the “buttons” I’d like the png image to change depending on circumstances that the user enters. So I’ve stored a few png’s in a data table, and load them when the form initialises:
self.a = app_tables.temp_counts.get(uid='1')['picture']
self.b = app_tables.temp_counts.get(uid='2')['picture']
What I’ve tried and what’s not working:
Well, everything is working but there’s a second delay after the link is tapped, the image goes blank, then the new image appears as it should:
def change_button(self,**event_args):
if self.test:
self.image_4.source = self.a
else:
self.image_4.source = self.b
self.test = not self.test
I’m pretty sure it’s because self.a and self.b are still LazyMedia or whatever - a link to the table which downloads every time the link is tapped. Is there a way to store the image on the browser/client-side so it’s ready to go immediately?
Thanks!
Bruce