Webmaster4o
Jan 10, 2016 - 17:38
The console prompt seems to have a dark grey caret. It's fine for the included themes, but almost impossible to see in my custom theme. Therefore, for my first use of objc_util, I have turned it the same color as the caret in the main editor view. Before and after:


It's a major improvement with my theme. In the first example, you can see the cursor just barely if you have great eyesight and zoom in a lot.
This is the code, which I put in my pythonsita_startup.py
from objc_util import *
#Thanks to @JonB, he posted similar code a while back
def filter_subviews_by_class(view,objcclasstext=None):
matching_svs=[]
sv=view.subviews()
if sv is None:
return matching_svs
for v in sv:
if objcclasstext and objcclasstext in v._get_objc_classname():
matching_svs.append(v)
matching_svs.extend(
filter_subviews_by_class(v,objcclasstext))
return matching_svs
w=ObjCClass('UIApplication').sharedApplication().keyWindow()
main_view=w.rootViewController().view()
console_prompt=filter_subviews_by_class(main_view,'PA2PromptTextField')[0]
console_prompt.tintColor=ObjCClass('UIColor').colorWithRed_green_blue_alpha_(0.47, 0.67, 0.71, 1.0)