[MacRuby-devel] Yellow Fade Technique on NSTableView
Greetings, My application updates items periodically (and sometimes by user request) so I wanted to show the user that something had changed should they be looking, or have manually requested an update. One example is that double-clicking can cause an item to update... Once I got the code working, I thought it might be something other folks would like to use. A little extraction, and here it is: http://gist.github.com/846047 (It also shows how to set up double-click detection, which is easy, but I hadn't figured out before, and took a little searching. :/ ) The code is based off an old blog post ( http://www.bdunagan.com/2009/04/26/core-animation-on-the-mac/ ) but _heavily_ translated into Ruby-ish stylings. It might also be used as a cool example of using Core Animation in your UI; I'm sure happy with how it came out! I have to imagine that the right way to use it for real will be to make it a module, and 'include' it into delegates as needed. Hope folks enjoy! -- Morgan Schweers p.s. Please don't hesitate to let me know if you have problems with it, or if I'm making some tyro mistakes! ___ MacRuby-devel mailing list [email protected] http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel
Re: [MacRuby-devel] Yellow Fade Technique on NSTableView
Really cool sample, thx for sharing! - Matt Sent from my iPhone On Feb 27, 2011, at 1:42, Morgan Schweers wrote: > Greetings, > My application updates items periodically (and sometimes by user request) so > I wanted to show the user that something had changed should they be looking, > or have manually requested an update. One example is that double-clicking > can cause an item to update... Once I got the code working, I thought it > might be something other folks would like to use. A little extraction, and > here it is: > > http://gist.github.com/846047 > > (It also shows how to set up double-click detection, which is easy, but I > hadn't figured out before, and took a little searching. :/ ) > > The code is based off an old blog post ( > http://www.bdunagan.com/2009/04/26/core-animation-on-the-mac/ ) but _heavily_ > translated into Ruby-ish stylings. It might also be used as a cool example > of using Core Animation in your UI; I'm sure happy with how it came out! I > have to imagine that the right way to use it for real will be to make it a > module, and 'include' it into delegates as needed. > > Hope folks enjoy! > > -- Morgan Schweers > > p.s. Please don't hesitate to let me know if you have problems with it, or if > I'm making some tyro mistakes! > > ___ > MacRuby-devel mailing list > [email protected] > http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel ___ MacRuby-devel mailing list [email protected] http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel
[MacRuby-devel] Having trouble with block yielding in the Tilt gem
Hi all,
Am eagerly getting on with my app, and I'm embedding a little Sinatra app with
the aid of ControlTower. So far so good, except with template rendering.
I cannot seem to get a "layout.erb" file to play nicely with an "index.erb"
file, and have the layout successfully yield to a block given by the index
template. This seems to bear up with testing the unit tests in the Tilt gem.
Apart from nearly every test failing, the particular test for blocks yielding
correctly is:
16) Error:
test_passing_a_block_for_yield(ERBTemplateTest):
LocalJumpError: no block given
/Library/Frameworks/MacRuby.framework/Versions/0.10/usr/lib/ruby/Gems/1.9.2/gems/tilt-1.2.2/test/(__TEMPLATE__):1:in
`'
/Library/Frameworks/MacRuby.framework/Versions/0.10/usr/lib/ruby/Gems/1.9.2/gems/tilt-1.2.2/lib/tilt.rb:251:in
`evaluate_source:'
/Library/Frameworks/MacRuby.framework/Versions/0.10/usr/lib/ruby/Gems/1.9.2/gems/tilt-1.2.2/lib/tilt.rb:186:in
`cached_evaluate:'
/Library/Frameworks/MacRuby.framework/Versions/0.10/usr/lib/ruby/Gems/1.9.2/gems/tilt-1.2.2/lib/tilt.rb:169:in
`evaluate:'
/Library/Frameworks/MacRuby.framework/Versions/0.10/usr/lib/ruby/Gems/1.9.2/gems/tilt-1.2.2/lib/tilt.rb:118:in
`render'
/Library/Frameworks/MacRuby.framework/Versions/0.10/usr/lib/ruby/Gems/1.9.2/gems/tilt-1.2.2/test/tilt_erbtemplate_test.rb:58:in
`block'
And the code for the test is:
test "passing a block for yield" do
template = Tilt::ERBTemplate.new { 'Hey <%= yield %>!' }
assert_equal "Hey Joe!", template.render { 'Joe' }
end
I can try to reduce this test case down to something manageable, but I wanted
to have a quick check with the the wisdom of the list as to what might cause
this.
Thanks,
Nick
___
MacRuby-devel mailing list
[email protected]
http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel
