Hi all,
I am new to LiveCode, however, not new to programming (C#, microcontroller, webdevelopment...) but the need has arisen to create a tool which can be used on Mac OS X.
A colleague showed me LiveCode and I quite like it so I chose it for this task.
What I want to do:
In the main stack I have a text input field in which a number is entered. After pressing a button a set of controls (1 label, 2 input fields) should be added to the main stack multiplied by the number in the input field (e.g. "6" will result in 6 of these control sets added to the UI).
My questions:
1) Can I model the set of controls first and then use a command to add various instances of this control set to the main stack?
2) Would it be easier just to create a new stack with createStack as this part of the UI will always be created new and doesn't have to be saved? Are there any drawbacks in this method?
I have done research on creating the UI on the runtime but I couldn't find useful stuff. Maybe I used the wrong terminology or I'm completely on the wrong way of tackling the problem, please let me know.
Thanks in advance for help & advices,
Mero
[SOLVED] Creating UI in runtime
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller
[SOLVED] Creating UI in runtime
Last edited by merowech on Tue Oct 04, 2011 12:44 pm, edited 1 time in total.
Re: Creating UI in runtime
Mero,
I have attached a stack that will 'basically' do what you require... the handlers are in the script of the button 'create controls'
be well
Dixie
I have attached a stack that will 'basically' do what you require... the handlers are in the script of the button 'create controls'
be well
Dixie
- Attachments
-
- createControls.livecode.zip
- (1.63 KiB) Downloaded 166 times
Re: Creating UI in runtime
Hi Dixie,
thank you very much for your solution which works perfect.
I just had time for a quick look into your stack but the whole principle seems pretty simple once you got there.
My next step will be to implement this into my stack and add the functionality needed.
Cheers,
Mero
thank you very much for your solution which works perfect.
I just had time for a quick look into your stack but the whole principle seems pretty simple once you got there.
My next step will be to implement this into my stack and add the functionality needed.
Cheers,
Mero