Welcome!
This is the community forum for my apps Pythonista and Editorial.
For individual support questions, you can also send an email. If you have a very short question or just want to say hello — I'm @olemoritz on Twitter.
Button thing?
-
How would I create a button on-screen that changes color when you tap it? Like, a square that starts white with a black border then changes to a square that’s black with a white border?
-
@Bumbo-Cactoni like this?
import ui v = ui.View() v.background_color = 'gray' def tapped(sender): sender.background_color = ['black','white'][sender.flag] sender.border_color = ['black','white'][1-sender.flag] sender.flag = 1-sender.flag b = ui.Button() b.frame = (10,10,100,32) b.title = 'button' b.border_width = 1 b.flag = 0 b.action = tapped v.add_subview(b) tapped(b) v.present('fullscreen')
-
@cvp
That was exactly what I needed!
Thank you!