fun with new objective c
Thought I'd share some of my objc experiments. if you have been playing with this new module, do share your endeavors!
https://github.com/jsbain/objc_hacks.git has my playground.
first, i have a hacked version of
objc_utils, which fixes the msgSend when return value are structs, on 32 bit machines. i also added
__dir__to ObjCClass and ObjCInstance which gets the class methods and Instance methods respectively, along with superclasses. This lets autocomplete work, and is very helpful in explorations! in retrospect i should separate out the
__dir__as a monkey patch, since my other changes might break this on 32bit machines.
i also wrote
print_objc.print_methodswhich takes a string classname, and prints all class and instance methods including type signature to the console. I'm thinking a ui based classbrowser would be neat at some point, (possibly looking up descriptions in apple docs).....but one step at a time!
Here is also some fun with objc and the ui module: attributed text inside a standard ui.Label!
Not sure if this will be feasible inside a TextView without some delegate methods....my initial experiments crashed.
The hacked module looks cool :-)
@ole can you please add
_ dir _ to the original module?
figured out how to set the typing attributes in a textview. slider sets font size dynamically.
still unable to set the attributedText directly(i.e for code highlighting) .
Worth collecting and study.