rubymotion-community / sugarcube

Some sugar for your cocoa. RubyMotion helpers.
Other
422 stars 66 forks source link

undefined method `nscolor' for :white:Symbol #197

Closed superplussed closed 9 years ago

superplussed commented 9 years ago

I have sugarcube included in my Gemfile like so:

gem 'sugarcube', require: [
    'sugarcube-ui',
    'sugarcube-repl'
]

And I can verify that I have the repl correctly loaded by running the "tree" command and seeing output. But in my button_style method, I get the above error for code that looks like:

class MainWindowLayout < MK::WindowLayout
    ...
    def button_style
        title 'Press it!'
        size_to_fit
        background_color :white.nscolor
     end

The .nscolor method is taken from the docs, so I'm not sure what the issue is. Any ideas?

colinta commented 9 years ago

That's dev strange! I'll try this tonight when I get home

On Mar 22, 2015, at 11:42 AM, Jeremy Smith notifications@github.com wrote:

I have sugarcube included in my Gemfile like so:

gem 'sugarcube', require: [ 'sugarcube-ui', 'sugarcube-repl' ]

And I can verify that I have the repl correctly loaded by running the "tree" command and seeing output. But in my button_style method, I get the above error for code that looks like:

class MainWindowLayout < MK::WindowLayout ... def button_style title 'Press it!' size_to_fit background_color :white.nscolor end

The .nscolor method is taken from the docs, so I'm not sure what the issue is. Any ideas?

\ Reply to this email directly or view it on GitHub.

colinta commented 9 years ago

Oh right, the color additions are in the sugarcube-color package.

The sweet-kit gem is a good reference for what files to include:

lib/sweet-kit.rb
require 'sugarcube'
require 'sugarcube-ui'
require 'sugarcube-color'
require 'sugarcube-constants'