librelist archives

« back to archive

flow.remove() is private now?

flow.remove() is private now?

From:
Daniel Heath
Date:
2010-03-16 @ 12:15
Hi all,

I'm working on a shoes app, and getting an interesting issue.

I have an element I want to get rid of. If I call element.hide, it
goes away, sort of.
If I call element.remove, I get an exception complaining about a private method.

Has anyone else seen this?

If you need code it's at git://github.com/DanielHeath/Darkblade.git

The call that appears to be failing is: View/Specializations.rb : 78
From the app -> add a specialization, then remove it.

Thanks,

Daniel

Re: [shoes] flow.remove() is private now?

From:
Satoshi Asakawa
Date:
2010-03-16 @ 16:10
Hi Daniel,

I did `git clone` your repo and ran `darkblade.rb` with my latest
Shoes-0.r1380 on my Windows XP laptop. I got an error you mentioned.

I replaced line 78, View/Specializations.rb, like this:

     #@displays.remove remover.parent
     @displays.delete remover.parent

Then it worked with no errors. But I'm not sure this is what you want to
do...

Hope this helps,
ashbb

ps. If you run the following snippet, you'll see this error: private method
`remove' called for [1,2,3,4,5]:Array

Shoes.app do
  begin
    a = [1,2,3,4,5]
    a.remove 2
  rescue => e
    para e
  end
end

Re: [shoes] flow.remove() is private now?

From:
Devyn Cairns
Date:
2010-03-16 @ 22:18
No, he actually wanted to remove the flow from the display. Make it go
bye-bye :P

On Tue, Mar 16, 2010 at 9:10 AM, Satoshi Asakawa <ashbbb@gmail.com> wrote:

> Hi Daniel,
>
> I did `git clone` your repo and ran `darkblade.rb` with my latest
> Shoes-0.r1380 on my Windows XP laptop. I got an error you mentioned.
>
> I replaced line 78, View/Specializations.rb, like this:
>
>      #@displays.remove remover.parent
>      @displays.delete remover.parent
>
> Then it worked with no errors. But I'm not sure this is what you want to
> do...
>
> Hope this helps,
> ashbb
>
> ps. If you run the following snippet, you'll see this error: private method
> `remove' called for [1,2,3,4,5]:Array
>
> Shoes.app do
>   begin
>     a = [1,2,3,4,5]
>     a.remove 2
>   rescue => e
>     para e
>   end
> end
>
>
>


-- 
   ~devyn

Re: [shoes] flow.remove() is private now?

From:
Daniel Heath
Date:
2010-03-16 @ 22:43
According to the shoes manual, there is a method called 'remove' (it's
listed alongside 'hide', so I assume it should be available in objects
that implement hide)

On Wed, Mar 17, 2010 at 9:18 AM, Devyn Cairns <devyn.cairns@gmail.com> wrote:
> No, he actually wanted to remove the flow from the display. Make it go
> bye-bye :P
>
> On Tue, Mar 16, 2010 at 9:10 AM, Satoshi Asakawa <ashbbb@gmail.com> wrote:
>>
>> Hi Daniel,
>>
>> I did `git clone` your repo and ran `darkblade.rb` with my latest
>> Shoes-0.r1380 on my Windows XP laptop. I got an error you mentioned.
>>
>> I replaced line 78, View/Specializations.rb, like this:
>>
>>      #@displays.remove remover.parent
>>      @displays.delete remover.parent
>>
>> Then it worked with no errors. But I'm not sure this is what you want to
>> do...
>>
>> Hope this helps,
>> ashbb
>>
>> ps. If you run the following snippet, you'll see this error: private
>> method `remove' called for [1,2,3,4,5]:Array
>>
>> Shoes.app do
>>   begin
>>     a = [1,2,3,4,5]
>>     a.remove 2
>>   rescue => e
>>     para e
>>   end
>> end
>>
>>
>
>
>
> --
>    ~devyn
>

Re: [shoes] flow.remove() is private now?

From:
Satoshi Asakawa
Date:
2010-03-17 @ 15:22
Hi Daniel,

> there is a method called 'remove' (it's listed alongside 'hide'
Yes.

> so I assume it should be available in objects that implement hide)
Oh, I see.
But no, remove() does not belong to Object class.
It's just one of common methods shared by every little element in Shoes.

http://shoes.heroku.com/manual/Common.html

Regards,
ashbb

Re: [shoes] flow.remove() is private now?

From:
Daniel Heath
Date:
2010-03-17 @ 20:09
...duh...

Thanks guys. Don't know how I didn't see that.

On Thu, Mar 18, 2010 at 2:22 AM, Satoshi Asakawa <ashbbb@gmail.com> wrote:
> Hi Daniel,
>
>> there is a method called 'remove' (it's listed alongside 'hide'
> Yes.
>
>> so I assume it should be available in objects that implement hide)
> Oh, I see.
> But no, remove() does not belong to Object class.
> It's just one of common methods shared by every little element in Shoes.
>
> http://shoes.heroku.com/manual/Common.html
>
> Regards,
> ashbb
>

Re: [shoes] flow.remove() is private now?

From:
Satoshi Asakawa
Date:
2010-03-17 @ 15:21
Hi devyn,

Look at one more step. You can find the following. ;-)

    remover.parent.remove()

He's also added this line to remove the flow from the display.

`@displays` is just an array. Elements (flows in this case) are stored in
@displays.

Regards,
ashbb