Re: [Fxruby-users] Re: A couple of questions
Status: Inactive
Brought to you by:
lyle
|
From: Lyle J. <jl...@cf...> - 2003-08-22 19:47:59
|
kel...@so... wrote:
> Yup! I've added the line "icon.create if !icon.created?" before I set
> the icon and it now works as expected.
It is always safe (and cheap) to call FXIcon#create, even if the icon
has already been created, so you can drop the "if !icon.created?" part
if you wish.
As an aside, one of the things I love about Ruby's expressiveness is
that you could just as well have written that line:
icon.create unless icon.created?
Sometimes I think 'unless' is one of my favorite Ruby keywords ;)
Cheers,
Lyle
|