[MacRuby-devel] Constant definitions

2011-05-24 Thread Robert Rice
Hi Fans:

What changed on 5/19/2011?

I haven't been able to use the nightly builds since 5/18/2011. Constant 
definitions stopped working and I get an uninitialized constant xxx (NameError) 
message wherever my code tries to reference a constant defined in the same 
class.

Thanks,
Bob Rice

___
MacRuby-devel mailing list
[email protected]
http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel


[MacRuby-devel] How do I add a background image in xcode4/macruby

2011-05-24 Thread [email protected]
Hi All - I'm new to MacRuby so please be gentle!

I am trying to add a background image to my app. I drag an 'image view' over to 
the window, but none of the options in any of the utilities drawers allows me 
to specify an image (which is what seems I need to do - according to various 
youtube vids... although they are for the iphone).

I'd also like to set a splash screen - again have watched youtube videos but 
they all seem to be for the iPhone (and so adding a 'Default.png' image and 
'sleep 5' doesn't work).

Any help appreciate - and sorry to be such a nube.
___
MacRuby-devel mailing list
[email protected]
http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel


Re: [MacRuby-devel] How do I add a background image in xcode4/macruby

2011-05-24 Thread [email protected]
Just a quick note to say I've got the background image working - it was as 
simple as dragging it from the media drawer (after being copied to the 
resources folder) duh!


On 24 May 2011, at 16:46, [email protected] wrote:

> Hi All - I'm new to MacRuby so please be gentle!
> 
> I am trying to add a background image to my app. I drag an 'image view' over 
> to the window, but none of the options in any of the utilities drawers allows 
> me to specify an image (which is what seems I need to do - according to 
> various youtube vids... although they are for the iphone).
> 
> I'd also like to set a splash screen - again have watched youtube videos but 
> they all seem to be for the iPhone (and so adding a 'Default.png' image and 
> 'sleep 5' doesn't work).
> 
> Any help appreciate - and sorry to be such a nube.
> ___
> 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


Re: [MacRuby-devel] Constant definitions

2011-05-24 Thread Laurent Sansonetti
Hi Bob,

https://github.com/MacRuby/MacRuby/commit/68ac3fcaf1041ef9b25fb3bc940a47f41505b7e5
 happened. This fixes bugs but also introduces others. We have tickets covering 
the new bugs and Kouji-san is working on them. 

https://www.macruby.org/trac/ticket/1292
https://www.macruby.org/trac/ticket/1288
https://www.macruby.org/trac/ticket/1285

Laurent

On May 24, 2011, at 8:46 AM, Robert Rice wrote:

> Hi Fans:
> 
> What changed on 5/19/2011?
> 
> I haven't been able to use the nightly builds since 5/18/2011. Constant 
> definitions stopped working and I get an uninitialized constant xxx 
> (NameError) message wherever my code tries to reference a constant defined in 
> the same class.
> 
> Thanks,
> Bob Rice
> 
> ___
> 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] Dynamic refresh in a view - xcode 4 / MacRuby

2011-05-24 Thread [email protected]
I have a label that I have set to blank, and after a user clicks 'go' I 
generate a random word or number and use:

self.label.stringValue = "some_word"

to update the view.

However, I would like to show 200 or so random words in quick succession before 
the final one is shown - just because it's too plain at the moment. 
Alternatively, I'd be happy with showing an animated graphic in its place - 
which is replaced by the final random word after a few seconds.

I've tried things like:

100.times do
 num = rand(40)
 self.label.stringValue = num
 sleep 1
end

But it doesn't work. I've also (after googling) tried .reloadData but to no 
avail as well.

Any ideas on how to achieve this? Or pointers on how to add animations to my 
window/views?
___
MacRuby-devel mailing list
[email protected]
http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel


Re: [MacRuby-devel] Constant definitions

2011-05-24 Thread Robert Rice
Thanks Laurent:

You may want to remove the bad files from the daily download page.

Bob Rice


On May 24, 2011, at 4:51 PM, Laurent Sansonetti wrote:

> Hi Bob,
> 
> https://github.com/MacRuby/MacRuby/commit/68ac3fcaf1041ef9b25fb3bc940a47f41505b7e5
>  happened. This fixes bugs but also introduces others. We have tickets 
> covering the new bugs and Kouji-san is working on them. 
> 
> https://www.macruby.org/trac/ticket/1292
> https://www.macruby.org/trac/ticket/1288
> https://www.macruby.org/trac/ticket/1285
> 
> Laurent
> 
> On May 24, 2011, at 8:46 AM, Robert Rice wrote:
> 
>> Hi Fans:
>> 
>> What changed on 5/19/2011?
>> 
>> I haven't been able to use the nightly builds since 5/18/2011. Constant 
>> definitions stopped working and I get an uninitialized constant xxx 
>> (NameError) message wherever my code tries to reference a constant defined 
>> in the same class.
>> 
>> Thanks,
>> Bob Rice
>> 
>> ___
>> 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 mailing list
[email protected]
http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel


Re: [MacRuby-devel] Dynamic refresh in a view - xcode 4 / MacRuby

2011-05-24 Thread Laurent Sansonetti
Hi,

It doesn't work because you're (probably) blocking the main thread,
which is responsible for drawing. What you want to do instead is
scheduling a timer inside the main run loop. Look at the NSTimer
class. Also, don't forget to force the view to be redrawn, by using
the setNeedsDisplay: method.

HTH
Laurent

On Tue, May 24, 2011 at 5:06 PM, [email protected]  wrote:
> I have a label that I have set to blank, and after a user clicks 'go' I 
> generate a random word or number and use:
>
> self.label.stringValue = "some_word"
>
> to update the view.
>
> However, I would like to show 200 or so random words in quick succession 
> before the final one is shown - just because it's too plain at the moment. 
> Alternatively, I'd be happy with showing an animated graphic in its place - 
> which is replaced by the final random word after a few seconds.
>
> I've tried things like:
>
> 100.times do
>  num = rand(40)
>  self.label.stringValue = num
>  sleep 1
> end
>
> But it doesn't work. I've also (after googling) tried .reloadData but to no 
> avail as well.
>
> Any ideas on how to achieve this? Or pointers on how to add animations to my 
> window/views?
> ___
> 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


Re: [MacRuby-devel] Dynamic refresh in a view - xcode 4 / MacRuby

2011-05-24 Thread Thomas R. Koll
Laurent is right and and I think best would be for you to use a NSTimer.

def drawWord
  if !next_word
self.timer.invalidate
return
  end
  self.label.stringValue = next_word
  self.setNeedsDisplay true
end

def next_word
  ...
end

self.timer = NSTimer.scheduledTimerWithTimeInterval( 1/20.0,
  target:self, selector:"drawWord:", userInfo:nil, repeats:true)



Am 25.05.2011 um 02:06 schrieb [email protected]:

> I have a label that I have set to blank, and after a user clicks 'go' I 
> generate a random word or number and use:
> 
> self.label.stringValue = "some_word"
> 
> to update the view.
> 
> However, I would like to show 200 or so random words in quick succession 
> before the final one is shown - just because it's too plain at the moment. 
> Alternatively, I'd be happy with showing an animated graphic in its place - 
> which is replaced by the final random word after a few seconds.
> 
> I've tried things like:
> 
> 100.times do
> num = rand(40)
> self.label.stringValue = num
> sleep 1
> end
> 
> But it doesn't work. I've also (after googling) tried .reloadData but to no 
> avail as well.
> 
> Any ideas on how to achieve this? Or pointers on how to add animations to my 
> window/views?


--
Thomas R. "TomK32" Koll, Ruby/Rails freelancer
http://ananasblau.com | http://github.com/TomK32




___
MacRuby-devel mailing list
[email protected]
http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel