librelist archives

« back to archive

Hey, need help!

Hey, need help!

From:
Gosu Coder
Date:
2014-04-07 @ 17:12
Hey Guys,
I need help with the following code:

Shoes.app do
    # Hacking out quick code to see how stacks and flows work
    flow :height => "90%", :width => "100%" do
        background "#FF716E" #pink

        # Create a new stack
        stack :margin => 2, :height => "20%", :width => "100%" do
            background "#93A2FF"
            title "TO DO APP"
        end

        # Create another stack, navigation bar
        stack :margin => 2, :height => "100%", :width => "30%" do
            background "#91FFA0"
            para "Nav Bar..."
        end

        # Create another stack, the main body
        @body = stack :margin => 2, :height => "100%", :width => "70%" do
            background gray
            @notes = flow
        end

    end #stack

    flow :margin => 2, :height => "10%", :width => "100%" do
        background white
        @e = edit_line :width => 400
        button "+" do
            @notes.append do
                para @e.text

                button "x" do
                 ##### I need help here
                ##### I want this note to be removed
                end
            end
        end
    end
end

  So the problem is I want to remove the current "To do item" after the "x"
button is pressed, but don't have any idea how. I went through the samples,
and they use links. I don't want to use links, I want to use buttons.
  In the near future I want to make more apps, and having buttons would be
better. I am also newish to programming, but hopefully can understand the
solutions you guys throw out.

Re: [shoes] Hey, need help!

From:
Sebastjan Hribar
Date:
2014-04-07 @ 20:42
Hi and welcome:)

have the button run this:
@notes.clear {@e.text}

worked for me on green_shoes.

regards,
seba

On 07. 04. 2014 19:12, Gosu Coder wrote:
> Hey Guys,
> I need help with the following code:
>
> Shoes.app do
>     # Hacking out quick code to see how stacks and flows work
>     flow :height => "90%", :width => "100%" do
>         background "#FF716E" #pink
>
>         # Create a new stack
>         stack :margin => 2, :height => "20%", :width => "100%" do
>             background "#93A2FF"
>             title "TO DO APP"
>         end
>
>         # Create another stack, navigation bar
>         stack :margin => 2, :height => "100%", :width => "30%" do
>             background "#91FFA0"
>             para "Nav Bar..."
>         end
>
>         # Create another stack, the main body
>         @body = stack :margin => 2, :height => "100%", :width => "70%" do
>             background gray
>             @notes = flow
>         end
>
>     end #stack
>
>     flow :margin => 2, :height => "10%", :width => "100%" do
>         background white
>         @e = edit_line :width => 400
>         button "+" do
>             @notes.append do
>                 para @e.text
>
>                 button "x" do
> ##### I need help here
> ##### I want this note to be removed
> end
>             end
>         end
>     end
> end
>
>   So the problem is I want to remove the current "To do item" after 
> the "x" button is pressed, but don't have any idea how. I went through 
> the samples, and they use links. I don't want to use links, I want to 
> use buttons.
>   In the near future I want to make more apps, and having buttons 
> would be better. I am also newish to programming, but hopefully can 
> understand the solutions you guys throw out.

Re: [shoes] Hey, need help!

From:
Sebastjan Hribar
Date:
2014-04-07 @ 21:08
I think I've sent the code below too soon. It will actually clear all 
items. I need to have another look:(


On 07. 04. 2014 22:42, Sebastjan Hribar wrote:
> Hi and welcome:)
>
> have the button run this:
> @notes.clear {@e.text}
>
> worked for me on green_shoes.
>
> regards,
> seba
>
> On 07. 04. 2014 19:12, Gosu Coder wrote:
>> Hey Guys,
>> I need help with the following code:
>>
>> Shoes.app do
>>     # Hacking out quick code to see how stacks and flows work
>>     flow :height => "90%", :width => "100%" do
>>         background "#FF716E" #pink
>>
>>         # Create a new stack
>>         stack :margin => 2, :height => "20%", :width => "100%" do
>>             background "#93A2FF"
>>             title "TO DO APP"
>>         end
>>
>>         # Create another stack, navigation bar
>>         stack :margin => 2, :height => "100%", :width => "30%" do
>>             background "#91FFA0"
>>             para "Nav Bar..."
>>         end
>>
>>         # Create another stack, the main body
>>         @body = stack :margin => 2, :height => "100%", :width => "70%" do
>>             background gray
>>             @notes = flow
>>         end
>>
>>     end #stack
>>
>>     flow :margin => 2, :height => "10%", :width => "100%" do
>>         background white
>>         @e = edit_line :width => 400
>>         button "+" do
>>             @notes.append do
>>                 para @e.text
>>
>>                 button "x" do
>> ##### I need help here
>> ##### I want this note to be removed
>> end
>>             end
>>         end
>>     end
>> end
>>
>>   So the problem is I want to remove the current "To do item" after 
>> the "x" button is pressed, but don't have any idea how. I went 
>> through the samples, and they use links. I don't want to use links, I 
>> want to use buttons.
>>   In the near future I want to make more apps, and having buttons 
>> would be better. I am also newish to programming, but hopefully can 
>> understand the solutions you guys throw out.
>

Re: [shoes] Hey, need help!

From:
Sebastjan Hribar
Date:
2014-04-07 @ 21:30
Hi again,

this button should do what you need:

         button "+" do
           @notes.append do
             a = stack do
               para @e.text
               button "x" do
                 a.clear
               end
             end
           end
         end

regards,
seba

On 07. 04. 2014 23:08, Sebastjan Hribar wrote:
> I think I've sent the code below too soon. It will actually clear all 
> items. I need to have another look:(
>
>
> On 07. 04. 2014 22:42, Sebastjan Hribar wrote:
>> Hi and welcome:)
>>
>> have the button run this:
>> @notes.clear {@e.text}
>>
>> worked for me on green_shoes.
>>
>> regards,
>> seba
>>
>> On 07. 04. 2014 19:12, Gosu Coder wrote:
>>> Hey Guys,
>>> I need help with the following code:
>>>
>>> Shoes.app do
>>>     # Hacking out quick code to see how stacks and flows work
>>>     flow :height => "90%", :width => "100%" do
>>>         background "#FF716E" #pink
>>>
>>>         # Create a new stack
>>>         stack :margin => 2, :height => "20%", :width => "100%" do
>>>             background "#93A2FF"
>>>             title "TO DO APP"
>>>         end
>>>
>>>         # Create another stack, navigation bar
>>>         stack :margin => 2, :height => "100%", :width => "30%" do
>>>             background "#91FFA0"
>>>             para "Nav Bar..."
>>>         end
>>>
>>>         # Create another stack, the main body
>>>         @body = stack :margin => 2, :height => "100%", :width => 
>>> "70%" do
>>>             background gray
>>>             @notes = flow
>>>         end
>>>
>>>     end #stack
>>>
>>>     flow :margin => 2, :height => "10%", :width => "100%" do
>>>         background white
>>>         @e = edit_line :width => 400
>>>         button "+" do
>>>             @notes.append do
>>>                 para @e.text
>>>
>>>                 button "x" do
>>> ##### I need help here
>>> ##### I want this note to be removed
>>>     end
>>>             end
>>>         end
>>>     end
>>> end
>>>
>>>   So the problem is I want to remove the current "To do item" after 
>>> the "x" button is pressed, but don't have any idea how. I went 
>>> through the samples, and they use links. I don't want to use links, 
>>> I want to use buttons.
>>>   In the near future I want to make more apps, and having buttons 
>>> would be better. I am also newish to programming, but hopefully can 
>>> understand the solutions you guys throw out.
>>
>

Re: [shoes] Hey, need help!

From:
Gosu Coder
Date:
2014-04-07 @ 21:41
Yes! Thanks for your super quick reply!
Really appreciate that. I had hit a wall.

Don't know how the code works yet, but I'll keep going through it.


Again, thanks so much.
Sam


On Mon, Apr 7, 2014 at 5:30 PM, Sebastjan Hribar <sebastjan.hribar@gmail.com
> wrote:

>  Hi again,
>
> this button should do what you need:
>
>
>         button "+" do
>           @notes.append do
>             a = stack do
>
>               para @e.text
>               button "x" do
>                 a.clear
>               end
>             end
>           end
>         end
>
> regards,
> seba
>
>
> On 07. 04. 2014 23:08, Sebastjan Hribar wrote:
>
> I think I've sent the code below too soon. It will actually clear all
> items. I need to have another look:(
>
>
> On 07. 04. 2014 22:42, Sebastjan Hribar wrote:
>
> Hi and welcome:)
>
> have the button run this:
> @notes.clear {@e.text}
>
> worked for me on green_shoes.
>
> regards,
> seba
>
> On 07. 04. 2014 19:12, Gosu Coder wrote:
>
>  Hey Guys,
> I need help with the following code:
>
> Shoes.app do
>     # Hacking out quick code to see how stacks and flows work
>     flow :height => "90%", :width => "100%" do
>         background "#FF716E" #pink
>
>         # Create a new stack
>         stack :margin => 2, :height => "20%", :width => "100%" do
>             background "#93A2FF"
>             title "TO DO APP"
>         end
>
>         # Create another stack, navigation bar
>         stack :margin => 2, :height => "100%", :width => "30%" do
>             background "#91FFA0"
>             para "Nav Bar..."
>         end
>
>         # Create another stack, the main body
>         @body = stack :margin => 2, :height => "100%", :width => "70%" do
>             background gray
>             @notes = flow
>         end
>
>     end #stack
>
>     flow :margin => 2, :height => "10%", :width => "100%" do
>         background white
>         @e = edit_line :width => 400
>         button "+" do
>             @notes.append do
>                 para @e.text
>
>                 button "x" do
>                   ##### I need help here
>                  ##### I want this note to be removed
>                  end
>             end
>         end
>     end
> end
>
>    So the problem is I want to remove the current "To do item" after the
> "x" button is pressed, but don't have any idea how. I went through the
> samples, and they use links. I don't want to use links, I want to use
> buttons.
>    In the near future I want to make more apps, and having buttons would
> be better. I am also newish to programming, but hopefully can understand
> the solutions you guys throw out.
>
>
>
>
>

Re: [shoes] Hey, need help!

From:
Gosu Coder
Date:
2014-04-09 @ 15:35
Hey guys,
This code doesn't work. The window shows up fine, however the hover and
leave do not work. Could you look into it. Thanks!

# To do:
#    1. Debug this program
#

Shoes.app  :width => 500, :height => 700 do
    # This program catches mouse hovering over a stack
    stack :width => "50%", :height => "100%" do
        background gainsboro
        hover do
            background black
        end

        leave do
            background white
        end

    end     #stack

    stack :width => "50%", :height => "100%" do
        background black
        hover do
            background white
        end

        leave do
            background black
        end

    end #stack

end #Shoes.app


On Mon, Apr 7, 2014 at 5:41 PM, Gosu Coder <codergosu@gmail.com> wrote:

> Yes! Thanks for your super quick reply!
> Really appreciate that. I had hit a wall.
>
> Don't know how the code works yet, but I'll keep going through it.
>
>
> Again, thanks so much.
> Sam
>
>
> On Mon, Apr 7, 2014 at 5:30 PM, Sebastjan Hribar <
> sebastjan.hribar@gmail.com> wrote:
>
>>  Hi again,
>>
>> this button should do what you need:
>>
>>
>>         button "+" do
>>           @notes.append do
>>             a = stack do
>>
>>               para @e.text
>>               button "x" do
>>                 a.clear
>>               end
>>             end
>>           end
>>         end
>>
>> regards,
>> seba
>>
>>
>> On 07. 04. 2014 23:08, Sebastjan Hribar wrote:
>>
>> I think I've sent the code below too soon. It will actually clear all
>> items. I need to have another look:(
>>
>>
>> On 07. 04. 2014 22:42, Sebastjan Hribar wrote:
>>
>> Hi and welcome:)
>>
>> have the button run this:
>> @notes.clear {@e.text}
>>
>> worked for me on green_shoes.
>>
>> regards,
>> seba
>>
>> On 07. 04. 2014 19:12, Gosu Coder wrote:
>>
>>  Hey Guys,
>> I need help with the following code:
>>
>> Shoes.app do
>>     # Hacking out quick code to see how stacks and flows work
>>     flow :height => "90%", :width => "100%" do
>>         background "#FF716E" #pink
>>
>>         # Create a new stack
>>         stack :margin => 2, :height => "20%", :width => "100%" do
>>             background "#93A2FF"
>>             title "TO DO APP"
>>         end
>>
>>         # Create another stack, navigation bar
>>         stack :margin => 2, :height => "100%", :width => "30%" do
>>             background "#91FFA0"
>>             para "Nav Bar..."
>>         end
>>
>>         # Create another stack, the main body
>>         @body = stack :margin => 2, :height => "100%", :width => "70%" do
>>             background gray
>>             @notes = flow
>>         end
>>
>>     end #stack
>>
>>     flow :margin => 2, :height => "10%", :width => "100%" do
>>         background white
>>         @e = edit_line :width => 400
>>         button "+" do
>>             @notes.append do
>>                 para @e.text
>>
>>                 button "x" do
>>                   ##### I need help here
>>                  ##### I want this note to be removed
>>                  end
>>             end
>>         end
>>     end
>> end
>>
>>    So the problem is I want to remove the current "To do item" after the
>> "x" button is pressed, but don't have any idea how. I went through the
>> samples, and they use links. I don't want to use links, I want to use
>> buttons.
>>    In the near future I want to make more apps, and having buttons would
>> be better. I am also newish to programming, but hopefully can understand
>> the solutions you guys throw out.
>>
>>
>>
>>
>>
>

Re: [shoes] Hey, need help!

From:
Gosu Coder
Date:
2014-04-09 @ 15:40
I also would like to add if anyone doesn't know, that even though the
Shoes3 app out box on Mac looks ugly, a change in plist can make it
"Retina-ready!"


On Wed, Apr 9, 2014 at 11:35 AM, Gosu Coder <codergosu@gmail.com> wrote:

> Hey guys,
> This code doesn't work. The window shows up fine, however the hover and
> leave do not work. Could you look into it. Thanks!
>
> # To do:
> #    1. Debug this program
> #
>
> Shoes.app  :width => 500, :height => 700 do
>     # This program catches mouse hovering over a stack
>     stack :width => "50%", :height => "100%" do
>         background gainsboro
>         hover do
>             background black
>         end
>
>         leave do
>             background white
>         end
>
>     end     #stack
>
>     stack :width => "50%", :height => "100%" do
>         background black
>         hover do
>             background white
>         end
>
>         leave do
>             background black
>         end
>
>     end #stack
>
> end #Shoes.app
>
>
> On Mon, Apr 7, 2014 at 5:41 PM, Gosu Coder <codergosu@gmail.com> wrote:
>
>> Yes! Thanks for your super quick reply!
>> Really appreciate that. I had hit a wall.
>>
>> Don't know how the code works yet, but I'll keep going through it.
>>
>>
>> Again, thanks so much.
>> Sam
>>
>>
>> On Mon, Apr 7, 2014 at 5:30 PM, Sebastjan Hribar <
>> sebastjan.hribar@gmail.com> wrote:
>>
>>>  Hi again,
>>>
>>> this button should do what you need:
>>>
>>>
>>>         button "+" do
>>>           @notes.append do
>>>             a = stack do
>>>
>>>               para @e.text
>>>               button "x" do
>>>                 a.clear
>>>               end
>>>             end
>>>           end
>>>         end
>>>
>>> regards,
>>> seba
>>>
>>>
>>> On 07. 04. 2014 23:08, Sebastjan Hribar wrote:
>>>
>>> I think I've sent the code below too soon. It will actually clear all
>>> items. I need to have another look:(
>>>
>>>
>>> On 07. 04. 2014 22:42, Sebastjan Hribar wrote:
>>>
>>> Hi and welcome:)
>>>
>>> have the button run this:
>>> @notes.clear {@e.text}
>>>
>>> worked for me on green_shoes.
>>>
>>> regards,
>>> seba
>>>
>>> On 07. 04. 2014 19:12, Gosu Coder wrote:
>>>
>>>  Hey Guys,
>>> I need help with the following code:
>>>
>>> Shoes.app do
>>>     # Hacking out quick code to see how stacks and flows work
>>>     flow :height => "90%", :width => "100%" do
>>>         background "#FF716E" #pink
>>>
>>>         # Create a new stack
>>>         stack :margin => 2, :height => "20%", :width => "100%" do
>>>             background "#93A2FF"
>>>             title "TO DO APP"
>>>         end
>>>
>>>         # Create another stack, navigation bar
>>>         stack :margin => 2, :height => "100%", :width => "30%" do
>>>             background "#91FFA0"
>>>             para "Nav Bar..."
>>>         end
>>>
>>>         # Create another stack, the main body
>>>         @body = stack :margin => 2, :height => "100%", :width => "70%" do
>>>             background gray
>>>             @notes = flow
>>>         end
>>>
>>>     end #stack
>>>
>>>     flow :margin => 2, :height => "10%", :width => "100%" do
>>>         background white
>>>         @e = edit_line :width => 400
>>>         button "+" do
>>>             @notes.append do
>>>                 para @e.text
>>>
>>>                 button "x" do
>>>                   ##### I need help here
>>>                  ##### I want this note to be removed
>>>                  end
>>>             end
>>>         end
>>>     end
>>> end
>>>
>>>    So the problem is I want to remove the current "To do item" after
>>> the "x" button is pressed, but don't have any idea how. I went through the
>>> samples, and they use links. I don't want to use links, I want to use
>>> buttons.
>>>    In the near future I want to make more apps, and having buttons
>>> would be better. I am also newish to programming, but hopefully can
>>> understand the solutions you guys throw out.
>>>
>>>
>>>
>>>
>>>
>>
>