Skip to content

Instantly share code, notes, and snippets.

@alessaba
Created January 17, 2016 16:36
Show Gist options
  • Save alessaba/d10a47b318c0a6db0d21 to your computer and use it in GitHub Desktop.
Save alessaba/d10a47b318c0a6db0d21 to your computer and use it in GitHub Desktop.
NewRightButton.py
# coding: utf-8
from objc_util import *
from ui import Button
def btnaction(sender):
print 'Hello'
toolbar=UIApplication.sharedApplication().keyWindow().rootViewController().childViewControllers()[1].view()
btn=ui.Button(frame=(toolbar.size().width - 152 - 40,22,40,40))
btn.flex='R'
btn.action = btnaction
btn.image=ui.Image.named('iow:ios7_play_32')
objcbutton=ObjCInstance(btn) # This is the same button as before
toolbar.addSubview_(objcbutton)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment