librelist archives

« back to archive

Multiple stack variables or layout help

Multiple stack variables or layout help

From:
Singh, Zachary H.
Date:
2014-07-21 @ 15:17
Hello,

So I am writing a GUI for an application I developed and am using green 
shoes. One aspect of the program requires the user to input about 30 
different things. I would like this to fit all on one app page, but it 
looks ridiculous with one column (the window has a greater height than my 
monitor. I thought I would cut the information in half and keep it in two 
half and give the window more width. So what I have is 4 stacks. 1 and 3 
are text to define what input is needed and 2 and 4 are a mashup of 
edit_lines and checks.  On stack four I want to have an 'apply' button 
that reads in all the inputted data and sets the necessary fields in an 
internal object that will be used elsewhere in the program. What I am 
running into is that when I call an element from stack 2 within the button
in stack 4 I get a "no superclass method" error which I assume comes from 
a nil object. I have tried making the elements of stack 2 instance 
variables but it has not worked either. Any help in dealing with this or 
maybe a different layout to bypass the info in two stacks would be 
appreciated.

Thank you,
Zack Singh

Re: [shoes] Multiple stack variables or layout help

From:
Sebastjan Hribar
Date:
2014-07-21 @ 16:57
Hi,

since you didn't provide the code the sample below is a quick mockup of 
what I gather you're trying to do. Basically the button in the fourth 
stack gathers all data and displays it via alert to check everything works.

require 'green_shoes'


Shoes.app do

   @main_frame = flow do

     @collection = []

     @stack_01 = stack do
       @input1 = edit_line
     end

     @stack_02 = stack do
       @input2 = edit_line
     end

     @stack_03 = stack do
       @input3 = edit_line
     end

     @stack_04 = stack do
       @input4 = edit_line
       @submit = button 'Submit' do
         @collection << @input1.text
         @collection << @input2.text
         @collection << @input3.text
         @collection << @input4.text
         alert @collection
       end
     end

   end
end

If this isn't what you're going for, please provide your code if possible.

hth
seba

On 21. 07. 2014 17:17, Singh, Zachary H. wrote:
>
> Hello,
>
> So I am writing a GUI for an application I developed and am using 
> green shoes. One aspect of the program requires the user to input 
> about 30 different things. I would like this to fit all on one app 
> page, but it looks ridiculous with one column (the window has a 
> greater height than my monitor. I thought I would cut the information 
> in half and keep it in two half and give the window more width. So 
> what I have is 4 stacks. 1 and 3 are text to define what input is 
> needed and 2 and 4 are a mashup of edit_lines and checks.  On stack 
> four I want to have an 'apply' button that reads in all the inputted 
> data and sets the necessary fields in an internal object that will be 
> used elsewhere in the program. What I am running into is that when I 
> call an element from stack 2 within the button in stack 4 I get a "no 
> superclass method" error which I assume comes from a nil object. I 
> have tried making the elements of stack 2 instance variables but it 
> has not worked either. Any help in dealing with this or maybe a 
> different layout to bypass the info in two stacks would be appreciated.
>
> Thank you,
>
> Zack Singh
>

Re: [shoes] Multiple stack variables or layout help

From:
Tobias Pfeiffer
Date:
2014-07-21 @ 17:09
Looks good what seba built :)

You could also add the inputs straight to collections, that way you 
wouldn't have to use so many instance variables :)

Cheers,
Tobi

On Mon 21 Jul 2014 06:57:03 PM CEST, Sebastjan Hribar wrote:
> Hi,
>
> since you didn't provide the code the sample below is a quick mockup
> of what I gather you're trying to do. Basically the button in the
> fourth stack gathers all data and displays it via alert to check
> everything works.
>
> require 'green_shoes'
>
>
> Shoes.app do
>
>   @main_frame = flow do
>
>     @collection = []
>
>     @stack_01 = stack do
>       @input1 = edit_line
>     end
>
>     @stack_02 = stack do
>       @input2 = edit_line
>     end
>
>     @stack_03 = stack do
>       @input3 = edit_line
>     end
>
>     @stack_04 = stack do
>       @input4 = edit_line
>       @submit = button 'Submit' do
>         @collection << @input1.text
>         @collection << @input2.text
>         @collection << @input3.text
>         @collection << @input4.text
>         alert @collection
>       end
>     end
>
>   end
> end
>
> If this isn't what you're going for, please provide your code if possible.
>
> hth
> seba
>
> On 21. 07. 2014 17:17, Singh, Zachary H. wrote:
>>
>> Hello,
>>
>>
>>
>> So I am writing a GUI for an application I developed and am using
>> green shoes. One aspect of the program requires the user to input
>> about 30 different things. I would like this to fit all on one app
>> page, but it looks ridiculous with one column (the window has a
>> greater height than my monitor. I thought I would cut the information
>> in half and keep it in two half and give the window more width. So
>> what I have is 4 stacks. 1 and 3 are text to define what input is
>> needed and 2 and 4 are a mashup of edit_lines and checks.  On stack
>> four I want to have an ‘apply’ button that reads in all the inputted
>> data and sets the necessary fields in an internal object that will be
>> used elsewhere in the program. What I am running into is that when I
>> call an element from stack 2 within the button in stack 4 I get a “no
>> superclass method” error which I assume comes from a nil object. I
>> have tried making the elements of stack 2 instance variables but it
>> has not worked either. Any help in dealing with this or maybe a
>> different layout to bypass the info in two stacks would be appreciated.
>>
>>
>>
>> Thank you,
>>
>> Zack Singh
>>
>

--
www.pragtob.info

Re: [shoes] Multiple stack variables or layout help

From:
Singh, Zachary H.
Date:
2014-07-21 @ 17:18
Would the different stacks need to be instance variables as well? Because 
it doesn't look like you are using them, unless calling the instance 
elements implicitly calls the stack. 
Zack

-----Original Message-----
From: shoes@librelist.com [mailto:shoes@librelist.com] On Behalf Of Tobias
Pfeiffer
Sent: Monday, July 21, 2014 1:09 PM
To: shoes@librelist.com
Subject: Re: [shoes] Multiple stack variables or layout help

Looks good what seba built :)

You could also add the inputs straight to collections, that way you 
wouldn't have to use so many instance variables :)

Cheers,
Tobi

On Mon 21 Jul 2014 06:57:03 PM CEST, Sebastjan Hribar wrote:
> Hi,
>
> since you didn't provide the code the sample below is a quick mockup 
> of what I gather you're trying to do. Basically the button in the 
> fourth stack gathers all data and displays it via alert to check 
> everything works.
>
> require 'green_shoes'
>
>
> Shoes.app do
>
>   @main_frame = flow do
>
>     @collection = []
>
>     @stack_01 = stack do
>       @input1 = edit_line
>     end
>
>     @stack_02 = stack do
>       @input2 = edit_line
>     end
>
>     @stack_03 = stack do
>       @input3 = edit_line
>     end
>
>     @stack_04 = stack do
>       @input4 = edit_line
>       @submit = button 'Submit' do
>         @collection << @input1.text
>         @collection << @input2.text
>         @collection << @input3.text
>         @collection << @input4.text
>         alert @collection
>       end
>     end
>
>   end
> end
>
> If this isn't what you're going for, please provide your code if possible.
>
> hth
> seba
>
> On 21. 07. 2014 17:17, Singh, Zachary H. wrote:
>>
>> Hello,
>>
>>
>>
>> So I am writing a GUI for an application I developed and am using 
>> green shoes. One aspect of the program requires the user to input 
>> about 30 different things. I would like this to fit all on one app 
>> page, but it looks ridiculous with one column (the window has a 
>> greater height than my monitor. I thought I would cut the information 
>> in half and keep it in two half and give the window more width. So 
>> what I have is 4 stacks. 1 and 3 are text to define what input is 
>> needed and 2 and 4 are a mashup of edit_lines and checks.  On stack 
>> four I want to have an ‘apply’ button that reads in all the inputted 
>> data and sets the necessary fields in an internal object that will be 
>> used elsewhere in the program. What I am running into is that when I 
>> call an element from stack 2 within the button in stack 4 I get a “no 
>> superclass method” error which I assume comes from a nil object. I 
>> have tried making the elements of stack 2 instance variables but it 
>> has not worked either. Any help in dealing with this or maybe a 
>> different layout to bypass the info in two stacks would be appreciated.
>>
>>
>>
>> Thank you,
>>
>> Zack Singh
>>
>

--
www.pragtob.info

Re: [shoes] Multiple stack variables or layout help

From:
Sebastjan Hribar
Date:
2014-07-21 @ 17:30
If you modify my sample and change the stacks from instance variables to 
plain stacks it also works.
I use instance variables for stacks and flows in order to manipulate 
them in different ways and in different places in the app.

regards,
seba


On 21. 07. 2014 19:18, Singh, Zachary H. wrote:
> Would the different stacks need to be instance variables as well? 
Because it doesn't look like you are using them, unless calling the 
instance elements implicitly calls the stack.
> Zack
>
> -----Original Message-----
> From: shoes@librelist.com [mailto:shoes@librelist.com] On Behalf Of 
Tobias Pfeiffer
> Sent: Monday, July 21, 2014 1:09 PM
> To: shoes@librelist.com
> Subject: Re: [shoes] Multiple stack variables or layout help
>
> Looks good what seba built :)
>
> You could also add the inputs straight to collections, that way you 
wouldn't have to use so many instance variables :)
>
> Cheers,
> Tobi
>
> On Mon 21 Jul 2014 06:57:03 PM CEST, Sebastjan Hribar wrote:
>> Hi,
>>
>> since you didn't provide the code the sample below is a quick mockup
>> of what I gather you're trying to do. Basically the button in the
>> fourth stack gathers all data and displays it via alert to check
>> everything works.
>>
>> require 'green_shoes'
>>
>>
>> Shoes.app do
>>
>>    @main_frame = flow do
>>
>>      @collection = []
>>
>>      @stack_01 = stack do
>>        @input1 = edit_line
>>      end
>>
>>      @stack_02 = stack do
>>        @input2 = edit_line
>>      end
>>
>>      @stack_03 = stack do
>>        @input3 = edit_line
>>      end
>>
>>      @stack_04 = stack do
>>        @input4 = edit_line
>>        @submit = button 'Submit' do
>>          @collection << @input1.text
>>          @collection << @input2.text
>>          @collection << @input3.text
>>          @collection << @input4.text
>>          alert @collection
>>        end
>>      end
>>
>>    end
>> end
>>
>> If this isn't what you're going for, please provide your code if possible.
>>
>> hth
>> seba
>>
>> On 21. 07. 2014 17:17, Singh, Zachary H. wrote:
>>> Hello,
>>>
>>>
>>>
>>> So I am writing a GUI for an application I developed and am using
>>> green shoes. One aspect of the program requires the user to input
>>> about 30 different things. I would like this to fit all on one app
>>> page, but it looks ridiculous with one column (the window has a
>>> greater height than my monitor. I thought I would cut the information
>>> in half and keep it in two half and give the window more width. So
>>> what I have is 4 stacks. 1 and 3 are text to define what input is
>>> needed and 2 and 4 are a mashup of edit_lines and checks.  On stack
>>> four I want to have an ‘apply’ button that reads in all the inputted
>>> data and sets the necessary fields in an internal object that will be
>>> used elsewhere in the program. What I am running into is that when I
>>> call an element from stack 2 within the button in stack 4 I get a “no
>>> superclass method” error which I assume comes from a nil object. I
>>> have tried making the elements of stack 2 instance variables but it
>>> has not worked either. Any help in dealing with this or maybe a
>>> different layout to bypass the info in two stacks would be appreciated.
>>>
>>>
>>>
>>> Thank you,
>>>
>>> Zack Singh
>>>
> --
> www.pragtob.info
>
>

Re: [shoes] Multiple stack variables or layout help

From:
Singh, Zachary H.
Date:
2014-07-21 @ 17:39
Thanks Seba,
I've gotten it to work. On a separate note, the shoes.app that is the form
that I spoke about in this question is created when you hit a button in my
main app. Is there a way to show an object, let's say a check mark image, 
in the main app if the form in the second app was filled out properly? I 
do have a Boolean variable to  check if that occurs that I can read in the
main app, but I don't know how to prompt the app window to check for that 
variable after the form app window closed.
Thanks,
Zack

-----Original Message-----
From: shoes@librelist.com [mailto:shoes@librelist.com] On Behalf Of 
Sebastjan Hribar
Sent: Monday, July 21, 2014 1:30 PM
To: shoes@librelist.com
Subject: Re: [shoes] Multiple stack variables or layout help

If you modify my sample and change the stacks from instance variables to 
plain stacks it also works.
I use instance variables for stacks and flows in order to manipulate them 
in different ways and in different places in the app.

regards,
seba


On 21. 07. 2014 19:18, Singh, Zachary H. wrote:
> Would the different stacks need to be instance variables as well? 
Because it doesn't look like you are using them, unless calling the 
instance elements implicitly calls the stack.
> Zack
>
> -----Original Message-----
> From: shoes@librelist.com [mailto:shoes@librelist.com] On Behalf Of 
> Tobias Pfeiffer
> Sent: Monday, July 21, 2014 1:09 PM
> To: shoes@librelist.com
> Subject: Re: [shoes] Multiple stack variables or layout help
>
> Looks good what seba built :)
>
> You could also add the inputs straight to collections, that way you 
> wouldn't have to use so many instance variables :)
>
> Cheers,
> Tobi
>
> On Mon 21 Jul 2014 06:57:03 PM CEST, Sebastjan Hribar wrote:
>> Hi,
>>
>> since you didn't provide the code the sample below is a quick mockup 
>> of what I gather you're trying to do. Basically the button in the 
>> fourth stack gathers all data and displays it via alert to check 
>> everything works.
>>
>> require 'green_shoes'
>>
>>
>> Shoes.app do
>>
>>    @main_frame = flow do
>>
>>      @collection = []
>>
>>      @stack_01 = stack do
>>        @input1 = edit_line
>>      end
>>
>>      @stack_02 = stack do
>>        @input2 = edit_line
>>      end
>>
>>      @stack_03 = stack do
>>        @input3 = edit_line
>>      end
>>
>>      @stack_04 = stack do
>>        @input4 = edit_line
>>        @submit = button 'Submit' do
>>          @collection << @input1.text
>>          @collection << @input2.text
>>          @collection << @input3.text
>>          @collection << @input4.text
>>          alert @collection
>>        end
>>      end
>>
>>    end
>> end
>>
>> If this isn't what you're going for, please provide your code if possible.
>>
>> hth
>> seba
>>
>> On 21. 07. 2014 17:17, Singh, Zachary H. wrote:
>>> Hello,
>>>
>>>
>>>
>>> So I am writing a GUI for an application I developed and am using 
>>> green shoes. One aspect of the program requires the user to input 
>>> about 30 different things. I would like this to fit all on one app 
>>> page, but it looks ridiculous with one column (the window has a 
>>> greater height than my monitor. I thought I would cut the 
>>> information in half and keep it in two half and give the window more 
>>> width. So what I have is 4 stacks. 1 and 3 are text to define what 
>>> input is needed and 2 and 4 are a mashup of edit_lines and checks.  
>>> On stack four I want to have an ‘apply’ button that reads in all the 
>>> inputted data and sets the necessary fields in an internal object 
>>> that will be used elsewhere in the program. What I am running into 
>>> is that when I call an element from stack 2 within the button in 
>>> stack 4 I get a “no superclass method” error which I assume comes 
>>> from a nil object. I have tried making the elements of stack 2 
>>> instance variables but it has not worked either. Any help in dealing 
>>> with this or maybe a different layout to bypass the info in two stacks
would be appreciated.
>>>
>>>
>>>
>>> Thank you,
>>>
>>> Zack Singh
>>>
> --
> www.pragtob.info
>
>

Re: [shoes] Multiple stack variables or layout help

From:
Sebastjan Hribar
Date:
2014-07-21 @ 18:18
Ok, here is a really simple url approach just to demonstrate the views:

require 'green_shoes'


class Form < Shoes

   url '/',            :welcome
   url '/form',        :form


     def welcome
       background honeydew
       para "This is the home screen"
       caption link("Get form") {visit '/form'}
     end

     def form
       background honeydew
       para "This is view for the form stuff"
       caption link("Home") {visit '/'}
     end
end

Shoes.app title: "Form"

regards
seba

On 21. 07. 2014 19:39, Singh, Zachary H. wrote:
> Thanks Seba,
> I've gotten it to work. On a separate note, the shoes.app that is the 
form that I spoke about in this question is created when you hit a button 
in my main app. Is there a way to show an object, let's say a check mark 
image, in the main app if the form in the second app was filled out 
properly? I do have a Boolean variable to  check if that occurs that I can
read in the main app, but I don't know how to prompt the app window to 
check for that variable after the form app window closed.
> Thanks,
> Zack
>
> -----Original Message-----
> From: shoes@librelist.com [mailto:shoes@librelist.com] On Behalf Of 
Sebastjan Hribar
> Sent: Monday, July 21, 2014 1:30 PM
> To: shoes@librelist.com
> Subject: Re: [shoes] Multiple stack variables or layout help
>
> If you modify my sample and change the stacks from instance variables to
plain stacks it also works.
> I use instance variables for stacks and flows in order to manipulate 
them in different ways and in different places in the app.
>
> regards,
> seba
>
>
> On 21. 07. 2014 19:18, Singh, Zachary H. wrote:
>> Would the different stacks need to be instance variables as well? 
Because it doesn't look like you are using them, unless calling the 
instance elements implicitly calls the stack.
>> Zack
>>
>> -----Original Message-----
>> From: shoes@librelist.com [mailto:shoes@librelist.com] On Behalf Of
>> Tobias Pfeiffer
>> Sent: Monday, July 21, 2014 1:09 PM
>> To: shoes@librelist.com
>> Subject: Re: [shoes] Multiple stack variables or layout help
>>
>> Looks good what seba built :)
>>
>> You could also add the inputs straight to collections, that way you
>> wouldn't have to use so many instance variables :)
>>
>> Cheers,
>> Tobi
>>
>> On Mon 21 Jul 2014 06:57:03 PM CEST, Sebastjan Hribar wrote:
>>> Hi,
>>>
>>> since you didn't provide the code the sample below is a quick mockup
>>> of what I gather you're trying to do. Basically the button in the
>>> fourth stack gathers all data and displays it via alert to check
>>> everything works.
>>>
>>> require 'green_shoes'
>>>
>>>
>>> Shoes.app do
>>>
>>>     @main_frame = flow do
>>>
>>>       @collection = []
>>>
>>>       @stack_01 = stack do
>>>         @input1 = edit_line
>>>       end
>>>
>>>       @stack_02 = stack do
>>>         @input2 = edit_line
>>>       end
>>>
>>>       @stack_03 = stack do
>>>         @input3 = edit_line
>>>       end
>>>
>>>       @stack_04 = stack do
>>>         @input4 = edit_line
>>>         @submit = button 'Submit' do
>>>           @collection << @input1.text
>>>           @collection << @input2.text
>>>           @collection << @input3.text
>>>           @collection << @input4.text
>>>           alert @collection
>>>         end
>>>       end
>>>
>>>     end
>>> end
>>>
>>> If this isn't what you're going for, please provide your code if possible.
>>>
>>> hth
>>> seba
>>>
>>> On 21. 07. 2014 17:17, Singh, Zachary H. wrote:
>>>> Hello,
>>>>
>>>>
>>>>
>>>> So I am writing a GUI for an application I developed and am using
>>>> green shoes. One aspect of the program requires the user to input
>>>> about 30 different things. I would like this to fit all on one app
>>>> page, but it looks ridiculous with one column (the window has a
>>>> greater height than my monitor. I thought I would cut the
>>>> information in half and keep it in two half and give the window more
>>>> width. So what I have is 4 stacks. 1 and 3 are text to define what
>>>> input is needed and 2 and 4 are a mashup of edit_lines and checks.
>>>> On stack four I want to have an ‘apply’ button that reads in all the
>>>> inputted data and sets the necessary fields in an internal object
>>>> that will be used elsewhere in the program. What I am running into
>>>> is that when I call an element from stack 2 within the button in
>>>> stack 4 I get a “no superclass method” error which I assume comes
>>>> from a nil object. I have tried making the elements of stack 2
>>>> instance variables but it has not worked either. Any help in dealing
>>>> with this or maybe a different layout to bypass the info in two 
stacks would be appreciated.
>>>>
>>>>
>>>>
>>>> Thank you,
>>>>
>>>> Zack Singh
>>>>
>> --
>> www.pragtob.info
>>
>>
>

Re: [shoes] Multiple stack variables or layout help

From:
peter marien
Date:
2014-07-21 @ 19:57
I used the solution of seba as a base but with less stacks to show how to
get values from the other window, the approach of Sebastjan is also very
nice though.
Hope this helps.

require 'green_shoes'

$formresults = []

Shoes.app do

  $main_window = flow do
    button 'Get form' do
      $w = window do
        para 'Form'
        @collection2 = [edit_line, edit_line, edit_line, edit_line]
        @submit = button 'Submit' do
          $formresults = @collection2
        end
      end
    end

    stack do
      @collection = [edit_line, edit_line, edit_line, edit_line]
    end

    stack do
      @submit = button 'Submit' do
        puts "first the results from this window"
        @collection.each do |element|
          p element.text
        end

        puts "like this you get to elements on the form"
        if $w
          $w.focusables.each do |element|
            p element.text if not element.text == 'Submit'
          end
        end

        puts "or like this.."
        $formresults.each do |element|
          p element.text
        end
      end
    end

   end
end


2014-07-21 20:18 GMT+02:00 Sebastjan Hribar <sebastjan.hribar@gmail.com>:

> Ok, here is a really simple url approach just to demonstrate the views:
>
> require 'green_shoes'
>
>
> class Form < Shoes
>
>    url '/',            :welcome
>    url '/form',        :form
>
>
>      def welcome
>        background honeydew
>        para "This is the home screen"
>        caption link("Get form") {visit '/form'}
>      end
>
>      def form
>        background honeydew
>        para "This is view for the form stuff"
>        caption link("Home") {visit '/'}
>      end
> end
>
> Shoes.app title: "Form"
>
> regards
> seba
>
> On 21. 07. 2014 19:39, Singh, Zachary H. wrote:
> > Thanks Seba,
> > I've gotten it to work. On a separate note, the shoes.app that is the
> form that I spoke about in this question is created when you hit a button
> in my main app. Is there a way to show an object, let's say a check mark
> image, in the main app if the form in the second app was filled out
> properly? I do have a Boolean variable to  check if that occurs that I can
> read in the main app, but I don't know how to prompt the app window to
> check for that variable after the form app window closed.
> > Thanks,
> > Zack
> >
> > -----Original Message-----
> > From: shoes@librelist.com [mailto:shoes@librelist.com] On Behalf Of
> Sebastjan Hribar
> > Sent: Monday, July 21, 2014 1:30 PM
> > To: shoes@librelist.com
> > Subject: Re: [shoes] Multiple stack variables or layout help
> >
> > If you modify my sample and change the stacks from instance variables to
> plain stacks it also works.
> > I use instance variables for stacks and flows in order to manipulate
> them in different ways and in different places in the app.
> >
> > regards,
> > seba
> >
> >
> > On 21. 07. 2014 19:18, Singh, Zachary H. wrote:
> >> Would the different stacks need to be instance variables as well?
> Because it doesn't look like you are using them, unless calling the
> instance elements implicitly calls the stack.
> >> Zack
> >>
> >> -----Original Message-----
> >> From: shoes@librelist.com [mailto:shoes@librelist.com] On Behalf Of
> >> Tobias Pfeiffer
> >> Sent: Monday, July 21, 2014 1:09 PM
> >> To: shoes@librelist.com
> >> Subject: Re: [shoes] Multiple stack variables or layout help
> >>
> >> Looks good what seba built :)
> >>
> >> You could also add the inputs straight to collections, that way you
> >> wouldn't have to use so many instance variables :)
> >>
> >> Cheers,
> >> Tobi
> >>
> >> On Mon 21 Jul 2014 06:57:03 PM CEST, Sebastjan Hribar wrote:
> >>> Hi,
> >>>
> >>> since you didn't provide the code the sample below is a quick mockup
> >>> of what I gather you're trying to do. Basically the button in the
> >>> fourth stack gathers all data and displays it via alert to check
> >>> everything works.
> >>>
> >>> require 'green_shoes'
> >>>
> >>>
> >>> Shoes.app do
> >>>
> >>>     @main_frame = flow do
> >>>
> >>>       @collection = []
> >>>
> >>>       @stack_01 = stack do
> >>>         @input1 = edit_line
> >>>       end
> >>>
> >>>       @stack_02 = stack do
> >>>         @input2 = edit_line
> >>>       end
> >>>
> >>>       @stack_03 = stack do
> >>>         @input3 = edit_line
> >>>       end
> >>>
> >>>       @stack_04 = stack do
> >>>         @input4 = edit_line
> >>>         @submit = button 'Submit' do
> >>>           @collection << @input1.text
> >>>           @collection << @input2.text
> >>>           @collection << @input3.text
> >>>           @collection << @input4.text
> >>>           alert @collection
> >>>         end
> >>>       end
> >>>
> >>>     end
> >>> end
> >>>
> >>> If this isn't what you're going for, please provide your code if
> possible.
> >>>
> >>> hth
> >>> seba
> >>>
> >>> On 21. 07. 2014 17:17, Singh, Zachary H. wrote:
> >>>> Hello,
> >>>>
> >>>>
> >>>>
> >>>> So I am writing a GUI for an application I developed and am using
> >>>> green shoes. One aspect of the program requires the user to input
> >>>> about 30 different things. I would like this to fit all on one app
> >>>> page, but it looks ridiculous with one column (the window has a
> >>>> greater height than my monitor. I thought I would cut the
> >>>> information in half and keep it in two half and give the window more
> >>>> width. So what I have is 4 stacks. 1 and 3 are text to define what
> >>>> input is needed and 2 and 4 are a mashup of edit_lines and checks.
> >>>> On stack four I want to have an ‘apply’ button that reads in all the
> >>>> inputted data and sets the necessary fields in an internal object
> >>>> that will be used elsewhere in the program. What I am running into
> >>>> is that when I call an element from stack 2 within the button in
> >>>> stack 4 I get a “no superclass method” error which I assume comes
> >>>> from a nil object. I have tried making the elements of stack 2
> >>>> instance variables but it has not worked either. Any help in dealing
> >>>> with this or maybe a different layout to bypass the info in two
> stacks would be appreciated.
> >>>>
> >>>>
> >>>>
> >>>> Thank you,
> >>>>
> >>>> Zack Singh
> >>>>
> >> --
> >> www.pragtob.info
> >>
> >>
> >
>
>

Re: [shoes] Multiple stack variables or layout help

From:
Oliver Gaida
Date:
2014-07-22 @ 10:29
There is another way to set variables from child-window to its parent 
window. You could use owner.instance_variable_set of the current 
window-object.

Shoes.app do
     button("start subwindow") do
         w = window do
             edit_line("").change do |e|
                 w.owner.instance_variable_set("@blaa", e.text)
             end
         end
     end
     button("show @blaa") do
         alert @blaa
     end
end

Olli

Am 21.07.2014 21:57, schrieb peter marien:
> I used the solution of seba as a base but with less stacks to show how to
> get values from the other window, the approach of Sebastjan is also very
> nice though.
> Hope this helps.
>
> require 'green_shoes'
>
> $formresults = []
>
> Shoes.app do
>
>    $main_window = flow do
>      button 'Get form' do
>        $w = window do
>          para 'Form'
>          @collection2 = [edit_line, edit_line, edit_line, edit_line]
>          @submit = button 'Submit' do
>            $formresults = @collection2
>          end
>        end
>      end
>
>      stack do
>        @collection = [edit_line, edit_line, edit_line, edit_line]
>      end
>
>      stack do
>        @submit = button 'Submit' do
>          puts "first the results from this window"
>          @collection.each do |element|
>            p element.text
>          end
>
>          puts "like this you get to elements on the form"
>          if $w
>            $w.focusables.each do |element|
>              p element.text if not element.text == 'Submit'
>            end
>          end
>
>          puts "or like this.."
>          $formresults.each do |element|
>            p element.text
>          end
>        end
>      end
>
>     end
> end
>
>
> 2014-07-21 20:18 GMT+02:00 Sebastjan Hribar <sebastjan.hribar@gmail.com>:
>
>> Ok, here is a really simple url approach just to demonstrate the views:
>>
>> require 'green_shoes'
>>
>>
>> class Form < Shoes
>>
>>     url '/',            :welcome
>>     url '/form',        :form
>>
>>
>>       def welcome
>>         background honeydew
>>         para "This is the home screen"
>>         caption link("Get form") {visit '/form'}
>>       end
>>
>>       def form
>>         background honeydew
>>         para "This is view for the form stuff"
>>         caption link("Home") {visit '/'}
>>       end
>> end
>>
>> Shoes.app title: "Form"
>>
>> regards
>> seba
>>
>> On 21. 07. 2014 19:39, Singh, Zachary H. wrote:
>>> Thanks Seba,
>>> I've gotten it to work. On a separate note, the shoes.app that is the
>> form that I spoke about in this question is created when you hit a button
>> in my main app. Is there a way to show an object, let's say a check mark
>> image, in the main app if the form in the second app was filled out
>> properly? I do have a Boolean variable to  check if that occurs that I can
>> read in the main app, but I don't know how to prompt the app window to
>> check for that variable after the form app window closed.
>>> Thanks,
>>> Zack
>>>
>>> -----Original Message-----
>>> From: shoes@librelist.com [mailto:shoes@librelist.com] On Behalf Of
>> Sebastjan Hribar
>>> Sent: Monday, July 21, 2014 1:30 PM
>>> To: shoes@librelist.com
>>> Subject: Re: [shoes] Multiple stack variables or layout help
>>>
>>> If you modify my sample and change the stacks from instance variables to
>> plain stacks it also works.
>>> I use instance variables for stacks and flows in order to manipulate
>> them in different ways and in different places in the app.
>>> regards,
>>> seba
>>>
>>>
>>> On 21. 07. 2014 19:18, Singh, Zachary H. wrote:
>>>> Would the different stacks need to be instance variables as well?
>> Because it doesn't look like you are using them, unless calling the
>> instance elements implicitly calls the stack.
>>>> Zack
>>>>
>>>> -----Original Message-----
>>>> From: shoes@librelist.com [mailto:shoes@librelist.com] On Behalf Of
>>>> Tobias Pfeiffer
>>>> Sent: Monday, July 21, 2014 1:09 PM
>>>> To: shoes@librelist.com
>>>> Subject: Re: [shoes] Multiple stack variables or layout help
>>>>
>>>> Looks good what seba built :)
>>>>
>>>> You could also add the inputs straight to collections, that way you
>>>> wouldn't have to use so many instance variables :)
>>>>
>>>> Cheers,
>>>> Tobi
>>>>
>>>> On Mon 21 Jul 2014 06:57:03 PM CEST, Sebastjan Hribar wrote:
>>>>> Hi,
>>>>>
>>>>> since you didn't provide the code the sample below is a quick mockup
>>>>> of what I gather you're trying to do. Basically the button in the
>>>>> fourth stack gathers all data and displays it via alert to check
>>>>> everything works.
>>>>>
>>>>> require 'green_shoes'
>>>>>
>>>>>
>>>>> Shoes.app do
>>>>>
>>>>>      @main_frame = flow do
>>>>>
>>>>>        @collection = []
>>>>>
>>>>>        @stack_01 = stack do
>>>>>          @input1 = edit_line
>>>>>        end
>>>>>
>>>>>        @stack_02 = stack do
>>>>>          @input2 = edit_line
>>>>>        end
>>>>>
>>>>>        @stack_03 = stack do
>>>>>          @input3 = edit_line
>>>>>        end
>>>>>
>>>>>        @stack_04 = stack do
>>>>>          @input4 = edit_line
>>>>>          @submit = button 'Submit' do
>>>>>            @collection << @input1.text
>>>>>            @collection << @input2.text
>>>>>            @collection << @input3.text
>>>>>            @collection << @input4.text
>>>>>            alert @collection
>>>>>          end
>>>>>        end
>>>>>
>>>>>      end
>>>>> end
>>>>>
>>>>> If this isn't what you're going for, please provide your code if
>> possible.
>>>>> hth
>>>>> seba
>>>>>
>>>>> On 21. 07. 2014 17:17, Singh, Zachary H. wrote:
>>>>>> Hello,
>>>>>>
>>>>>>
>>>>>>
>>>>>> So I am writing a GUI for an application I developed and am using
>>>>>> green shoes. One aspect of the program requires the user to input
>>>>>> about 30 different things. I would like this to fit all on one app
>>>>>> page, but it looks ridiculous with one column (the window has a
>>>>>> greater height than my monitor. I thought I would cut the
>>>>>> information in half and keep it in two half and give the window more
>>>>>> width. So what I have is 4 stacks. 1 and 3 are text to define what
>>>>>> input is needed and 2 and 4 are a mashup of edit_lines and checks.
>>>>>> On stack four I want to have an ‘apply’ button that reads in all the
>>>>>> inputted data and sets the necessary fields in an internal object
>>>>>> that will be used elsewhere in the program. What I am running into
>>>>>> is that when I call an element from stack 2 within the button in
>>>>>> stack 4 I get a “no superclass method” error which I assume comes
>>>>>> from a nil object. I have tried making the elements of stack 2
>>>>>> instance variables but it has not worked either. Any help in dealing
>>>>>> with this or maybe a different layout to bypass the info in two
>> stacks would be appreciated.
>>>>>>
>>>>>>
>>>>>> Thank you,
>>>>>>
>>>>>> Zack Singh
>>>>>>
>>>> --
>>>> www.pragtob.info
>>>>
>>>>
>>

Re: [shoes] Multiple stack variables or layout help

From:
Singh, Zachary H.
Date:
2014-07-21 @ 18:22
Well I have the URL view implemented for other parts of my app but since 
the form page must be much bigger in size than the rest of the app windows
I have just made a new app with the button. What is the difference between
that and the window approach? Also I was able to find the hidden style for
the check mark so that is solved.
Zack

-----Original Message-----
From: shoes@librelist.com [mailto:shoes@librelist.com] On Behalf Of 
Sebastjan Hribar
Sent: Monday, July 21, 2014 2:18 PM
To: shoes@librelist.com
Subject: Re: [shoes] Multiple stack variables or layout help

Ok, here is a really simple url approach just to demonstrate the views:

require 'green_shoes'


class Form < Shoes

   url '/',            :welcome
   url '/form',        :form


     def welcome
       background honeydew
       para "This is the home screen"
       caption link("Get form") {visit '/form'}
     end

     def form
       background honeydew
       para "This is view for the form stuff"
       caption link("Home") {visit '/'}
     end
end

Shoes.app title: "Form"

regards
seba

On 21. 07. 2014 19:39, Singh, Zachary H. wrote:
> Thanks Seba,
> I've gotten it to work. On a separate note, the shoes.app that is the 
form that I spoke about in this question is created when you hit a button 
in my main app. Is there a way to show an object, let's say a check mark 
image, in the main app if the form in the second app was filled out 
properly? I do have a Boolean variable to  check if that occurs that I can
read in the main app, but I don't know how to prompt the app window to 
check for that variable after the form app window closed.
> Thanks,
> Zack
>
> -----Original Message-----
> From: shoes@librelist.com [mailto:shoes@librelist.com] On Behalf Of 
> Sebastjan Hribar
> Sent: Monday, July 21, 2014 1:30 PM
> To: shoes@librelist.com
> Subject: Re: [shoes] Multiple stack variables or layout help
>
> If you modify my sample and change the stacks from instance variables to
plain stacks it also works.
> I use instance variables for stacks and flows in order to manipulate 
them in different ways and in different places in the app.
>
> regards,
> seba
>
>
> On 21. 07. 2014 19:18, Singh, Zachary H. wrote:
>> Would the different stacks need to be instance variables as well? 
Because it doesn't look like you are using them, unless calling the 
instance elements implicitly calls the stack.
>> Zack
>>
>> -----Original Message-----
>> From: shoes@librelist.com [mailto:shoes@librelist.com] On Behalf Of 
>> Tobias Pfeiffer
>> Sent: Monday, July 21, 2014 1:09 PM
>> To: shoes@librelist.com
>> Subject: Re: [shoes] Multiple stack variables or layout help
>>
>> Looks good what seba built :)
>>
>> You could also add the inputs straight to collections, that way you 
>> wouldn't have to use so many instance variables :)
>>
>> Cheers,
>> Tobi
>>
>> On Mon 21 Jul 2014 06:57:03 PM CEST, Sebastjan Hribar wrote:
>>> Hi,
>>>
>>> since you didn't provide the code the sample below is a quick mockup 
>>> of what I gather you're trying to do. Basically the button in the 
>>> fourth stack gathers all data and displays it via alert to check 
>>> everything works.
>>>
>>> require 'green_shoes'
>>>
>>>
>>> Shoes.app do
>>>
>>>     @main_frame = flow do
>>>
>>>       @collection = []
>>>
>>>       @stack_01 = stack do
>>>         @input1 = edit_line
>>>       end
>>>
>>>       @stack_02 = stack do
>>>         @input2 = edit_line
>>>       end
>>>
>>>       @stack_03 = stack do
>>>         @input3 = edit_line
>>>       end
>>>
>>>       @stack_04 = stack do
>>>         @input4 = edit_line
>>>         @submit = button 'Submit' do
>>>           @collection << @input1.text
>>>           @collection << @input2.text
>>>           @collection << @input3.text
>>>           @collection << @input4.text
>>>           alert @collection
>>>         end
>>>       end
>>>
>>>     end
>>> end
>>>
>>> If this isn't what you're going for, please provide your code if possible.
>>>
>>> hth
>>> seba
>>>
>>> On 21. 07. 2014 17:17, Singh, Zachary H. wrote:
>>>> Hello,
>>>>
>>>>
>>>>
>>>> So I am writing a GUI for an application I developed and am using 
>>>> green shoes. One aspect of the program requires the user to input 
>>>> about 30 different things. I would like this to fit all on one app 
>>>> page, but it looks ridiculous with one column (the window has a 
>>>> greater height than my monitor. I thought I would cut the 
>>>> information in half and keep it in two half and give the window 
>>>> more width. So what I have is 4 stacks. 1 and 3 are text to define 
>>>> what input is needed and 2 and 4 are a mashup of edit_lines and checks.
>>>> On stack four I want to have an ‘apply’ button that reads in all 
>>>> the inputted data and sets the necessary fields in an internal 
>>>> object that will be used elsewhere in the program. What I am 
>>>> running into is that when I call an element from stack 2 within the 
>>>> button in stack 4 I get a “no superclass method” error which I 
>>>> assume comes from a nil object. I have tried making the elements of 
>>>> stack 2 instance variables but it has not worked either. Any help 
>>>> in dealing with this or maybe a different layout to bypass the info 
in two stacks would be appreciated.
>>>>
>>>>
>>>>
>>>> Thank you,
>>>>
>>>> Zack Singh
>>>>
>> --
>> www.pragtob.info
>>
>>
>

Re: [shoes] Multiple stack variables or layout help

From:
Sebastjan Hribar
Date:
2014-07-21 @ 18:00
I usually don't work with several apps as I understand is in your case 
so maybe someone else can answer that. However, have you considered 
using a window for the form:
----------------------------------------------------------------------------
require 'green_shoes'


Shoes.app do

   @main_frame = flow do


     button 'Get form' do
       window do

       para 'Form'
       para 'rest of the form stuff:)'
       end
     end

     @collection = []

     stack do
       @input1 = edit_line
     end

     stack do
       @input2 = edit_line
     end

     stack do
       @input3 = edit_line
     end

     stack do
       @input4 = edit_line
       @submit = button 'Submit' do
         @collection << @input1.text
         @collection << @input2.text
         @collection << @input3.text
         @collection << @input4.text
         alert @collection
       end
     end

   end
end
------------------------------------------------------

Or maybe using urls to separate views?
I'm short on time right now and can't make an example, but check it out 
in NKS - https://cloud.github.com/downloads/shoes/shoes/nks.pdf if 
you're not familiar.

regards,
seba


On 21. 07. 2014 19:39, Singh, Zachary H. wrote:
> Thanks Seba,
> I've gotten it to work. On a separate note, the shoes.app that is the 
form that I spoke about in this question is created when you hit a button 
in my main app. Is there a way to show an object, let's say a check mark 
image, in the main app if the form in the second app was filled out 
properly? I do have a Boolean variable to  check if that occurs that I can
read in the main app, but I don't know how to prompt the app window to 
check for that variable after the form app window closed.
> Thanks,
> Zack
>
> -----Original Message-----
> From: shoes@librelist.com [mailto:shoes@librelist.com] On Behalf Of 
Sebastjan Hribar
> Sent: Monday, July 21, 2014 1:30 PM
> To: shoes@librelist.com
> Subject: Re: [shoes] Multiple stack variables or layout help
>
> If you modify my sample and change the stacks from instance variables to
plain stacks it also works.
> I use instance variables for stacks and flows in order to manipulate 
them in different ways and in different places in the app.
>
> regards,
> seba
>
>
> On 21. 07. 2014 19:18, Singh, Zachary H. wrote:
>> Would the different stacks need to be instance variables as well? 
Because it doesn't look like you are using them, unless calling the 
instance elements implicitly calls the stack.
>> Zack
>>
>> -----Original Message-----
>> From: shoes@librelist.com [mailto:shoes@librelist.com] On Behalf Of
>> Tobias Pfeiffer
>> Sent: Monday, July 21, 2014 1:09 PM
>> To: shoes@librelist.com
>> Subject: Re: [shoes] Multiple stack variables or layout help
>>
>> Looks good what seba built :)
>>
>> You could also add the inputs straight to collections, that way you
>> wouldn't have to use so many instance variables :)
>>
>> Cheers,
>> Tobi
>>
>> On Mon 21 Jul 2014 06:57:03 PM CEST, Sebastjan Hribar wrote:
>>> Hi,
>>>
>>> since you didn't provide the code the sample below is a quick mockup
>>> of what I gather you're trying to do. Basically the button in the
>>> fourth stack gathers all data and displays it via alert to check
>>> everything works.
>>>
>>> require 'green_shoes'
>>>
>>>
>>> Shoes.app do
>>>
>>>     @main_frame = flow do
>>>
>>>       @collection = []
>>>
>>>       @stack_01 = stack do
>>>         @input1 = edit_line
>>>       end
>>>
>>>       @stack_02 = stack do
>>>         @input2 = edit_line
>>>       end
>>>
>>>       @stack_03 = stack do
>>>         @input3 = edit_line
>>>       end
>>>
>>>       @stack_04 = stack do
>>>         @input4 = edit_line
>>>         @submit = button 'Submit' do
>>>           @collection << @input1.text
>>>           @collection << @input2.text
>>>           @collection << @input3.text
>>>           @collection << @input4.text
>>>           alert @collection
>>>         end
>>>       end
>>>
>>>     end
>>> end
>>>
>>> If this isn't what you're going for, please provide your code if possible.
>>>
>>> hth
>>> seba
>>>
>>> On 21. 07. 2014 17:17, Singh, Zachary H. wrote:
>>>> Hello,
>>>>
>>>>
>>>>
>>>> So I am writing a GUI for an application I developed and am using
>>>> green shoes. One aspect of the program requires the user to input
>>>> about 30 different things. I would like this to fit all on one app
>>>> page, but it looks ridiculous with one column (the window has a
>>>> greater height than my monitor. I thought I would cut the
>>>> information in half and keep it in two half and give the window more
>>>> width. So what I have is 4 stacks. 1 and 3 are text to define what
>>>> input is needed and 2 and 4 are a mashup of edit_lines and checks.
>>>> On stack four I want to have an ‘apply’ button that reads in all the
>>>> inputted data and sets the necessary fields in an internal object
>>>> that will be used elsewhere in the program. What I am running into
>>>> is that when I call an element from stack 2 within the button in
>>>> stack 4 I get a “no superclass method” error which I assume comes
>>>> from a nil object. I have tried making the elements of stack 2
>>>> instance variables but it has not worked either. Any help in dealing
>>>> with this or maybe a different layout to bypass the info in two 
stacks would be appreciated.
>>>>
>>>>
>>>>
>>>> Thank you,
>>>>
>>>> Zack Singh
>>>>
>> --
>> www.pragtob.info
>>
>>
>

Re: [shoes] Multiple stack variables or layout help

From:
Tobias Pfeiffer
Date:
2014-07-21 @ 17:22
They don't need to, only if you want to references them later :)

On Mon 21 Jul 2014 07:18:32 PM CEST, Singh, Zachary H. wrote:
> Would the different stacks need to be instance variables as well? 
Because it doesn't look like you are using them, unless calling the 
instance elements implicitly calls the stack.
> Zack
>
> -----Original Message-----
> From: shoes@librelist.com [mailto:shoes@librelist.com] On Behalf Of 
Tobias Pfeiffer
> Sent: Monday, July 21, 2014 1:09 PM
> To: shoes@librelist.com
> Subject: Re: [shoes] Multiple stack variables or layout help
>
> Looks good what seba built :)
>
> You could also add the inputs straight to collections, that way you 
wouldn't have to use so many instance variables :)
>
> Cheers,
> Tobi
>
> On Mon 21 Jul 2014 06:57:03 PM CEST, Sebastjan Hribar wrote:
>> Hi,
>>
>> since you didn't provide the code the sample below is a quick mockup
>> of what I gather you're trying to do. Basically the button in the
>> fourth stack gathers all data and displays it via alert to check
>> everything works.
>>
>> require 'green_shoes'
>>
>>
>> Shoes.app do
>>
>>   @main_frame = flow do
>>
>>     @collection = []
>>
>>     @stack_01 = stack do
>>       @input1 = edit_line
>>     end
>>
>>     @stack_02 = stack do
>>       @input2 = edit_line
>>     end
>>
>>     @stack_03 = stack do
>>       @input3 = edit_line
>>     end
>>
>>     @stack_04 = stack do
>>       @input4 = edit_line
>>       @submit = button 'Submit' do
>>         @collection << @input1.text
>>         @collection << @input2.text
>>         @collection << @input3.text
>>         @collection << @input4.text
>>         alert @collection
>>       end
>>     end
>>
>>   end
>> end
>>
>> If this isn't what you're going for, please provide your code if possible.
>>
>> hth
>> seba
>>
>> On 21. 07. 2014 17:17, Singh, Zachary H. wrote:
>>>
>>> Hello,
>>>
>>>
>>>
>>> So I am writing a GUI for an application I developed and am using
>>> green shoes. One aspect of the program requires the user to input
>>> about 30 different things. I would like this to fit all on one app
>>> page, but it looks ridiculous with one column (the window has a
>>> greater height than my monitor. I thought I would cut the information
>>> in half and keep it in two half and give the window more width. So
>>> what I have is 4 stacks. 1 and 3 are text to define what input is
>>> needed and 2 and 4 are a mashup of edit_lines and checks.  On stack
>>> four I want to have an ‘apply’ button that reads in all the inputted
>>> data and sets the necessary fields in an internal object that will be
>>> used elsewhere in the program. What I am running into is that when I
>>> call an element from stack 2 within the button in stack 4 I get a “no
>>> superclass method” error which I assume comes from a nil object. I
>>> have tried making the elements of stack 2 instance variables but it
>>> has not worked either. Any help in dealing with this or maybe a
>>> different layout to bypass the info in two stacks would be appreciated.
>>>
>>>
>>>
>>> Thank you,
>>>
>>> Zack Singh
>>>
>>
>
> --
> www.pragtob.info
>

--
www.pragtob.info