Phuket2
Feb 18, 2016 - 19:01
@omz or anyone in the universe. I am trying to make a popup menu. I am just trying to position the popup, but I am going around in circles now. I have tried so many things. But does not respond as I would expect.
Bel9w is the test bed I have been playing with... Just so confused now as o have tried so many variations.
Would be grateful for any feedback
# coding: utf-8
import ui
def btn_action(sender):
print sender
f = (0,0,400, 800)
pt = tuple(sender.center)
v = ui.View(frame = f)
loc = ui.convert_point(pt, sender, None)
#loc = ui.convert_point(loc, None, v)
v.present('popover', popover_location = tuple(loc) )
if __name__ == '__main__':
f = (0,0,500,500)
v = ui.View(frame = f)
btn = ui.Button(frame = (100,100, 100, 32))
btn.border_width = .5
btn.action = btn_action
btn.title = 'hello'
v.add_subview(btn)
v.present('sheet')