File tree 1 file changed +6
-7
lines changed
1 file changed +6
-7
lines changed Original file line number Diff line number Diff line change 1
1
# coding: utf-8
2
- import objc
3
- reload ( objc )
4
- from objc import *
2
+
3
+
4
+ from objc_util import *
5
5
import ui ,console
6
6
7
7
@@ -12,19 +12,18 @@ def get_toolbar(view):
12
12
#get main editor toolbar, by recursively walking the view
13
13
sv = view .subviews ()
14
14
15
- for i in range (sv .count ()- 1 ):
16
- v = sv .objectAtIndex_ (ns (i ))
15
+ for v in sv :
17
16
if v ._get_objc_classname ()== 'OMTabViewToolbar' :
18
17
return v
19
18
tb = get_toolbar (v )
20
19
if tb :
21
- return tb
20
+ return tb
22
21
23
22
tb = get_toolbar (main_view )
24
23
execbtn = ui .Button (frame = (tb .size ().width - tb .rightItemsWidth ()- 40 ,22 ,40 ,40 ))
25
24
execbtn .flex = 'R'
26
25
execbtn .image = ui .Image .named ('iow:ios7_play_32' )
27
- execbtn_obj = ObjCInstance (execbtn . _objc_ptr )
26
+ execbtn_obj = ObjCInstance (execbtn )
28
27
tb .addSubview_ (execbtn_obj )
29
28
30
29
def run_script (sender ):
You can’t perform that action at this time.
0 commit comments