python - How to get a widget position inside it's layout in Kivy? -
i have gridlayout , added image widgets on after adding of images want draw rectangle in each image using canvas couldn't because don't know exact image widgets positions on gridlayout.
code: http://paste.ofcode.org/3bdp9yhjrcrzmsztbu9hqp4 http://paste.ofcode.org/3az3gx4fxzr9dlhe2ami97c
in last line of python code : rectangle(pos = (child.x - 2.4, child.y + 467), size = (70, 70)) how draw rectangle in child(my method not good^),
also why gridlayout not coming in center after setting it's pos_hint = {"center_x" : .5}?
if understand question right, try use such methods to_local()
, to_parent()
, to_widget()
, to_window()
. try substract position of gridlayout widgets' positions.
Comments
Post a Comment