Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

border <view> not working on osx #81

Closed
pvinis opened this issue Mar 19, 2015 · 12 comments
Closed

border <view> not working on osx #81

pvinis opened this issue Mar 19, 2015 · 12 comments

Comments

@pvinis
Copy link

pvinis commented Mar 19, 2015

i have an NSView* view and i try to border it but i get this.
(lldb) border view
error: use of undeclared identifier 'UIColor'
error: 1 errors parsing expression

@kastiglione
Copy link
Contributor

Thanks for the report. Can you run the below command from your app's lldb console and let me know what the output is?

script print lldb.debugger.GetSelectedTarget().GetTriple()

@pvinis
Copy link
Author

pvinis commented Mar 19, 2015

this.
x86_64h-apple-macosx

@pvinis
Copy link
Author

pvinis commented Mar 19, 2015

i actually changed the border function to use NSColor instead of UIColor and its ok now, but i thought it should choose by itself. maybe i have to change everything UI* to NS*?

@kastiglione
Copy link
Contributor

When did you install or last updated Chisel? We should support this arch as of January 5th, see #69.

@kastiglione
Copy link
Contributor

Here's the code that chooses whether to use UIColor or NSColor:

def run(self, args, options):
colorClassName = 'UIColor'
isMac = runtimeHelpers.isMacintoshArch()
if isMac:
colorClassName = 'NSColor'
layer = viewHelpers.convertToLayer(args[0])
lldb.debugger.HandleCommand('expr (void)[%s setBorderWidth:(CGFloat)%s]' % (layer, options.width))
lldb.debugger.HandleCommand('expr (void)[%s setBorderColor:(CGColorRef)[(id)[%s %sColor] CGColor]]' % (layer, colorClassName, options.color))
lldb.debugger.HandleCommand('caflush')

@pvinis
Copy link
Author

pvinis commented Mar 19, 2015

i installed it with brew.
% brew info chisel
chisel: stable 1.1.0
https://github.com/facebook/chisel
/usr/local/Cellar/chisel/1.1.0 (18 files, 112K) *
Built from source
From: https://github.com/Homebrew/homebrew/blob/master/Library/Formula/chisel.rb
==> Caveats
Add the following line to ~/.lldbinit to load chisel when Xcode launches:
command script import /usr/local/opt/chisel/libexec/fblldb.py

@pvinis
Copy link
Author

pvinis commented Mar 19, 2015

oh.. i dont have that code.. mine was [UIColor ....
is the version in brew that old?

@kastiglione
Copy link
Contributor

Oh! We need to submit an update to homebrew. In the meantime, you might want to try installing from git, which should be pretty straightforward.

@pvinis
Copy link
Author

pvinis commented Mar 19, 2015

yep. i will do that. thanks. will it also work for UIWindow stuff etc?

@kastiglione
Copy link
Contributor

It should, but I'm not entirely sure. The Mac support was provided by @kolinkrewinkel in #45. Please do file any issues you run into and we can look at fixes.

@pvinis
Copy link
Author

pvinis commented Mar 19, 2015

thanks again.

@kastiglione
Copy link
Contributor

You're welcome! Thanks for reporting.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants